From 4763ae41c338f30265f3f15f513c979cfec097dd Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Wed, 1 Apr 2020 11:35:28 +0200 Subject: [PATCH 01/10] DAOS-4450 abt: upgrade to v1.0 (#2279) Signed-off-by: Johann Lombardi --- src/iosrv/sched.c | 2 +- utils/build.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iosrv/sched.c b/src/iosrv/sched.c index aee60975ca8..1af35c465a8 100644 --- a/src/iosrv/sched.c +++ b/src/iosrv/sched.c @@ -417,7 +417,7 @@ sched_run(ABT_sched sched) */ goto check_event; execute: - D_ASSERT(pool != ABT_UNIT_NULL); + D_ASSERT(pool != ABT_POOL_NULL); ABT_xstream_run_unit(unit, pool); start_cycle: if (cycle->sc_new_cycle) { diff --git a/utils/build.config b/utils/build.config index 392d2aa3de9..ab0e33df8a9 100644 --- a/utils/build.config +++ b/utils/build.config @@ -2,7 +2,7 @@ component=daos [commit_versions] -ARGOBOTS = 89507c1f8cfec4e918e8b9861e41b4e9cef71461 +ARGOBOTS = v1.0 PMDK = 1.8 ISAL = v2.26.0 SPDK = v19.04.1 From 27c11d644449a6df816acc99f3e8d0917dbb623f Mon Sep 17 00:00:00 2001 From: Michael MacDonald Date: Wed, 1 Apr 2020 10:33:18 -0400 Subject: [PATCH 02/10] DAOS-3634 doc: Fix dmg manpage generator (#2289) It's not necessary to wrap the output buffer in a buffered writer. Signed-off-by: Michael MacDonald --- doc/man/man8/dmg.8 | 26 ++++++++++++++++++++++++-- src/control/cmd/dmg/man_test.go | 3 +-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/doc/man/man8/dmg.8 b/doc/man/man8/dmg.8 index d8ca013eddf..3695fdb38f6 100644 --- a/doc/man/man8/dmg.8 +++ b/doc/man/man8/dmg.8 @@ -1,4 +1,4 @@ -.TH dmg 1 "30 March 2020" +.TH dmg 1 "1 April 2020" .SH NAME dmg \- Administrative tool for managing DAOS clusters .SH SYNOPSIS @@ -351,4 +351,26 @@ Query DAOS system status \fBAliases\fP: q .TP -\fB\fB\-v\fR, \fB\-\- \ No newline at end of file +\fB\fB\-v\fR, \fB\-\-verbose\fR\fP +Display more member details +.TP +\fB\fB\-r\fR, \fB\-\-ranks\fR\fP +Comma separated list of system ranks to query +.SS system start +Perform start of stopped DAOS system + +\fBAliases\fP: r + +.SS system stop +Perform controlled shutdown of DAOS system + +\fBUsage\fP: system stop [stop-OPTIONS] +.TP + +\fBAliases\fP: s + +.TP +\fB\fB\-\-force\fR\fP +Force stop DAOS system members +.SS version +Print dmg version diff --git a/src/control/cmd/dmg/man_test.go b/src/control/cmd/dmg/man_test.go index 0d342fdb7ac..17cdaa8ce34 100644 --- a/src/control/cmd/dmg/man_test.go +++ b/src/control/cmd/dmg/man_test.go @@ -23,7 +23,6 @@ package main import ( - "bufio" "bytes" "flag" "fmt" @@ -50,7 +49,7 @@ func TestDmg_ManPageIsCurrent(t *testing.T) { return out.Bytes() } - writeManPage(bufio.NewWriter(&manBytes)) + writeManPage(&manBytes) if *update { err := ioutil.WriteFile(goldenPath, manBytes.Bytes(), 0644) if err != nil { From 609f14f2d4d35e01f429e055bba04165bb2e4e5f Mon Sep 17 00:00:00 2001 From: Ashley Pittman Date: Wed, 1 Apr 2020 16:32:01 +0100 Subject: [PATCH 03/10] CORCI-896 test: Change check_script to work on older python versions. (#2269) Fix, and introduce a python error in mdtest to see what gets reported. Signed-off-by: Ashley Pittman --- src/SConscript | 2 +- src/client/pydaos/__init__.py | 2 +- src/tests/ftest/pool/multiple_creates_test.py | 4 ---- src/tests/ftest/util/daos_perf_utils.py | 1 - src/tests/ftest/util/fio_test_base.py | 10 ++-------- src/tests/ftest/util/ior_test_base.py | 1 - src/tests/ftest/util/mdtest_test_base.py | 9 ++------- utils/daos_build.py | 2 +- utils/sl/check_script.py | 10 ++++++++-- 9 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/SConscript b/src/SConscript index df1b6dd47b6..9aedd4c53cb 100644 --- a/src/SConscript +++ b/src/SConscript @@ -12,7 +12,7 @@ HEADERS_SRV = ['vos.h', 'vos_types.h'] def scons(): """Execute build""" - Import('env', 'prereqs') + Import('env') # For Common library (tse.h) env.AppendUnique(CPPPATH=[Dir('include/daos').srcnode()]) diff --git a/src/client/pydaos/__init__.py b/src/client/pydaos/__init__.py index 98cd38c3401..99c00139cf1 100644 --- a/src/client/pydaos/__init__.py +++ b/src/client/pydaos/__init__.py @@ -86,7 +86,7 @@ def __del__(self): @atexit.register def _cleanup(): global dc - dc = None; + dc = None from .pydaos_core import * diff --git a/src/tests/ftest/pool/multiple_creates_test.py b/src/tests/ftest/pool/multiple_creates_test.py index c3a34f51104..a4b7c496cca 100755 --- a/src/tests/ftest/pool/multiple_creates_test.py +++ b/src/tests/ftest/pool/multiple_creates_test.py @@ -25,15 +25,11 @@ import os import traceback -import json from avocado.utils import process from apricot import TestWithServers -import agent_utils -import server_utils import check_for_pool -import write_host_file # pylint: disable = broad-except class MultipleCreatesTest(TestWithServers): diff --git a/src/tests/ftest/util/daos_perf_utils.py b/src/tests/ftest/util/daos_perf_utils.py index 651fe5415b2..b3771d15937 100644 --- a/src/tests/ftest/util/daos_perf_utils.py +++ b/src/tests/ftest/util/daos_perf_utils.py @@ -25,7 +25,6 @@ from __future__ import print_function import os import subprocess -import json from distutils.spawn import find_executable from env_modules import load_mpi diff --git a/src/tests/ftest/util/fio_test_base.py b/src/tests/ftest/util/fio_test_base.py index e671182fa5b..3768c1ec2c0 100755 --- a/src/tests/ftest/util/fio_test_base.py +++ b/src/tests/ftest/util/fio_test_base.py @@ -23,8 +23,6 @@ ''' from __future__ import print_function -import subprocess -import os import re from ClusterShell.NodeSet import NodeSet @@ -86,13 +84,9 @@ def _create_pool(self): # Create a pool self.pool.create() - def _create_cont(self, doas_cmd): + def _create_cont(self): """Create a container. - Args: - daos_cmd (DaosCommand): doas command to issue the container - create - Returns: str: UUID of the created container @@ -121,7 +115,7 @@ def _start_dfuse(self): # update dfuse params self.dfuse.set_dfuse_params(self.pool) - self.dfuse.set_dfuse_cont_param(self._create_cont(self.daos_cmd)) + self.dfuse.set_dfuse_cont_param(self._create_cont()) try: # start dfuse diff --git a/src/tests/ftest/util/ior_test_base.py b/src/tests/ftest/util/ior_test_base.py index 26af90b2b06..5e63ab51a0a 100644 --- a/src/tests/ftest/util/ior_test_base.py +++ b/src/tests/ftest/util/ior_test_base.py @@ -22,7 +22,6 @@ portions thereof marked with this legend must also reproduce the markings. """ import os -import subprocess import threading import time diff --git a/src/tests/ftest/util/mdtest_test_base.py b/src/tests/ftest/util/mdtest_test_base.py index 4189268f8e9..28873b72c9f 100755 --- a/src/tests/ftest/util/mdtest_test_base.py +++ b/src/tests/ftest/util/mdtest_test_base.py @@ -24,7 +24,6 @@ from __future__ import print_function import os -import subprocess import re from ClusterShell.NodeSet import NodeSet @@ -98,13 +97,9 @@ def _create_pool(self): # Create a pool self.pool.create() - def _create_cont(self, doas_cmd): + def _create_cont(self): """Create a container. - Args: - daos_cmd (DaosCommand): doas command to issue the container - create - Returns: str: UUID of the created container @@ -134,7 +129,7 @@ def _start_dfuse(self): # update dfuse params self.dfuse.set_dfuse_params(self.pool) - self.dfuse.set_dfuse_cont_param(self._create_cont(self.daos_cmd)) + self.dfuse.set_dfuse_cont_param(self._create_cont()) try: # start dfuse diff --git a/utils/daos_build.py b/utils/daos_build.py index 12d5433c0b2..ec721b9b9c6 100644 --- a/utils/daos_build.py +++ b/utils/daos_build.py @@ -47,7 +47,7 @@ def clear_icc_env(env): for flag in oldflags: if 'diag-disable' in flag: continue - if '-Werror-all' == flag: + if flag == '-Werror-all': newflags.append('-Werror') continue newflags.append(flag) diff --git a/utils/sl/check_script.py b/utils/sl/check_script.py index d68930678b5..922484b2a15 100755 --- a/utils/sl/check_script.py +++ b/utils/sl/check_script.py @@ -151,7 +151,10 @@ def fix_log(self, log_file, fname): """Get the line number""" os.unlink("script") log_file.seek(0) - output = tempfile.TemporaryFile(mode='w+', encoding='utf-8') + try: + output = tempfile.TemporaryFile(mode='w+', encoding='utf-8') + except TypeError: + output = tempfile.TemporaryFile() for line in log_file.readlines(): match = re.search(r":(\d+):", line) if match: @@ -248,7 +251,10 @@ def check_script(fname, *args, **kw): if os.environ.get("DEBUG_CHECK_SCRIPT", 0): print(" ".join(cmd)) - log_file = tempfile.TemporaryFile(mode='w+', encoding='utf-8') + try: + log_file = tempfile.TemporaryFile(mode='w+', encoding='utf-8') + except TypeError: + log_file = tempfile.TemporaryFile() try: subprocess.check_call(cmd, stdout=log_file) From 8ccda609a23ea47ef7735022bb39a260e9313c41 Mon Sep 17 00:00:00 2001 From: Joel Rosenzweig Date: Wed, 1 Apr 2020 14:36:05 -0400 Subject: [PATCH 04/10] DAOS-2489 control: Infer libdaos params from server config (#2129) Adds server configuration data to the GetAttachInfo dRPC available to libdaos clients. Using the data to eliminate dependency on external environment variables is forthcoming. Signed-off-by: Joel Rosenzweig --- src/control/common/proto/ctl/system.pb.go | 70 +++---- src/control/common/proto/mgmt/mgmt.pb.go | 195 ++++++------------ src/control/common/proto/mgmt/srv.pb.go | 219 ++++++++++++--------- src/control/common/proto/srv/srv.pb.go | 28 ++- src/control/server/config.go | 26 +++ src/control/server/config_test.go | 2 + src/control/server/ioserver/config.go | 28 ++- src/control/server/ioserver/config_test.go | 40 ++-- src/control/server/ioserver/exec_test.go | 6 +- src/control/server/mgmt_svc.go | 24 ++- src/control/server/mgmt_svc_test.go | 16 +- src/control/server/server.go | 7 +- src/control/server/test_utils.go | 4 +- src/include/daos/mgmt.h | 12 +- src/include/daos_types.h | 3 + src/iosrv/srv.pb-c.h | 2 +- src/mgmt/cli_mgmt.c | 40 +++- src/mgmt/srv.pb-c.c | 71 ++++++- src/mgmt/srv.pb-c.h | 28 ++- src/pool/cli.c | 8 + src/proto/mgmt/srv.proto | 9 +- utils/config/daos_server.yml | 7 + 22 files changed, 508 insertions(+), 337 deletions(-) diff --git a/src/control/common/proto/ctl/system.pb.go b/src/control/common/proto/ctl/system.pb.go index d876ad129af..130b4a9b234 100644 --- a/src/control/common/proto/ctl/system.pb.go +++ b/src/control/common/proto/ctl/system.pb.go @@ -3,11 +3,9 @@ package ctl -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -18,7 +16,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // SystemMember refers to a data-plane instance that is a member of DAOS // system running on host with the control-plane listening at "Addr". @@ -36,17 +34,16 @@ func (m *SystemMember) Reset() { *m = SystemMember{} } func (m *SystemMember) String() string { return proto.CompactTextString(m) } func (*SystemMember) ProtoMessage() {} func (*SystemMember) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{0} + return fileDescriptor_system_836e24766cd92a0a, []int{0} } - func (m *SystemMember) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SystemMember.Unmarshal(m, b) } func (m *SystemMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SystemMember.Marshal(b, m, deterministic) } -func (m *SystemMember) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemMember.Merge(m, src) +func (dst *SystemMember) XXX_Merge(src proto.Message) { + xxx_messageInfo_SystemMember.Merge(dst, src) } func (m *SystemMember) XXX_Size() int { return xxx_messageInfo_SystemMember.Size(m) @@ -102,17 +99,16 @@ func (m *RankResult) Reset() { *m = RankResult{} } func (m *RankResult) String() string { return proto.CompactTextString(m) } func (*RankResult) ProtoMessage() {} func (*RankResult) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{1} + return fileDescriptor_system_836e24766cd92a0a, []int{1} } - func (m *RankResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RankResult.Unmarshal(m, b) } func (m *RankResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RankResult.Marshal(b, m, deterministic) } -func (m *RankResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_RankResult.Merge(m, src) +func (dst *RankResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_RankResult.Merge(dst, src) } func (m *RankResult) XXX_Size() int { return xxx_messageInfo_RankResult.Size(m) @@ -173,17 +169,16 @@ func (m *SystemStopReq) Reset() { *m = SystemStopReq{} } func (m *SystemStopReq) String() string { return proto.CompactTextString(m) } func (*SystemStopReq) ProtoMessage() {} func (*SystemStopReq) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{2} + return fileDescriptor_system_836e24766cd92a0a, []int{2} } - func (m *SystemStopReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SystemStopReq.Unmarshal(m, b) } func (m *SystemStopReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SystemStopReq.Marshal(b, m, deterministic) } -func (m *SystemStopReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemStopReq.Merge(m, src) +func (dst *SystemStopReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SystemStopReq.Merge(dst, src) } func (m *SystemStopReq) XXX_Size() int { return xxx_messageInfo_SystemStopReq.Size(m) @@ -235,17 +230,16 @@ func (m *SystemStopResp) Reset() { *m = SystemStopResp{} } func (m *SystemStopResp) String() string { return proto.CompactTextString(m) } func (*SystemStopResp) ProtoMessage() {} func (*SystemStopResp) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{3} + return fileDescriptor_system_836e24766cd92a0a, []int{3} } - func (m *SystemStopResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SystemStopResp.Unmarshal(m, b) } func (m *SystemStopResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SystemStopResp.Marshal(b, m, deterministic) } -func (m *SystemStopResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemStopResp.Merge(m, src) +func (dst *SystemStopResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SystemStopResp.Merge(dst, src) } func (m *SystemStopResp) XXX_Size() int { return xxx_messageInfo_SystemStopResp.Size(m) @@ -275,17 +269,16 @@ func (m *SystemStartReq) Reset() { *m = SystemStartReq{} } func (m *SystemStartReq) String() string { return proto.CompactTextString(m) } func (*SystemStartReq) ProtoMessage() {} func (*SystemStartReq) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{4} + return fileDescriptor_system_836e24766cd92a0a, []int{4} } - func (m *SystemStartReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SystemStartReq.Unmarshal(m, b) } func (m *SystemStartReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SystemStartReq.Marshal(b, m, deterministic) } -func (m *SystemStartReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemStartReq.Merge(m, src) +func (dst *SystemStartReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SystemStartReq.Merge(dst, src) } func (m *SystemStartReq) XXX_Size() int { return xxx_messageInfo_SystemStartReq.Size(m) @@ -316,17 +309,16 @@ func (m *SystemStartResp) Reset() { *m = SystemStartResp{} } func (m *SystemStartResp) String() string { return proto.CompactTextString(m) } func (*SystemStartResp) ProtoMessage() {} func (*SystemStartResp) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{5} + return fileDescriptor_system_836e24766cd92a0a, []int{5} } - func (m *SystemStartResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SystemStartResp.Unmarshal(m, b) } func (m *SystemStartResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SystemStartResp.Marshal(b, m, deterministic) } -func (m *SystemStartResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemStartResp.Merge(m, src) +func (dst *SystemStartResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SystemStartResp.Merge(dst, src) } func (m *SystemStartResp) XXX_Size() int { return xxx_messageInfo_SystemStartResp.Size(m) @@ -356,17 +348,16 @@ func (m *SystemQueryReq) Reset() { *m = SystemQueryReq{} } func (m *SystemQueryReq) String() string { return proto.CompactTextString(m) } func (*SystemQueryReq) ProtoMessage() {} func (*SystemQueryReq) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{6} + return fileDescriptor_system_836e24766cd92a0a, []int{6} } - func (m *SystemQueryReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SystemQueryReq.Unmarshal(m, b) } func (m *SystemQueryReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SystemQueryReq.Marshal(b, m, deterministic) } -func (m *SystemQueryReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemQueryReq.Merge(m, src) +func (dst *SystemQueryReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SystemQueryReq.Merge(dst, src) } func (m *SystemQueryReq) XXX_Size() int { return xxx_messageInfo_SystemQueryReq.Size(m) @@ -396,17 +387,16 @@ func (m *SystemQueryResp) Reset() { *m = SystemQueryResp{} } func (m *SystemQueryResp) String() string { return proto.CompactTextString(m) } func (*SystemQueryResp) ProtoMessage() {} func (*SystemQueryResp) Descriptor() ([]byte, []int) { - return fileDescriptor_86a7260ebdc12f47, []int{7} + return fileDescriptor_system_836e24766cd92a0a, []int{7} } - func (m *SystemQueryResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SystemQueryResp.Unmarshal(m, b) } func (m *SystemQueryResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SystemQueryResp.Marshal(b, m, deterministic) } -func (m *SystemQueryResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemQueryResp.Merge(m, src) +func (dst *SystemQueryResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SystemQueryResp.Merge(dst, src) } func (m *SystemQueryResp) XXX_Size() int { return xxx_messageInfo_SystemQueryResp.Size(m) @@ -435,9 +425,9 @@ func init() { proto.RegisterType((*SystemQueryResp)(nil), "ctl.SystemQueryResp") } -func init() { proto.RegisterFile("system.proto", fileDescriptor_86a7260ebdc12f47) } +func init() { proto.RegisterFile("system.proto", fileDescriptor_system_836e24766cd92a0a) } -var fileDescriptor_86a7260ebdc12f47 = []byte{ +var fileDescriptor_system_836e24766cd92a0a = []byte{ // 309 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xbf, 0x4e, 0xc3, 0x30, 0x10, 0xc6, 0x65, 0xd2, 0xbf, 0x47, 0x4b, 0xc1, 0x42, 0xc8, 0x63, 0x94, 0x01, 0x15, 0x21, 0x75, diff --git a/src/control/common/proto/mgmt/mgmt.pb.go b/src/control/common/proto/mgmt/mgmt.pb.go index 11c471da932..1904881ad8a 100644 --- a/src/control/common/proto/mgmt/mgmt.pb.go +++ b/src/control/common/proto/mgmt/mgmt.pb.go @@ -3,14 +3,13 @@ package mgmt +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,7 +21,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // Generic request indicating which ranks to operate on. // Used in gRPC fanout to operate on hosts with multiple ranks. @@ -38,17 +37,16 @@ func (m *RanksReq) Reset() { *m = RanksReq{} } func (m *RanksReq) String() string { return proto.CompactTextString(m) } func (*RanksReq) ProtoMessage() {} func (*RanksReq) Descriptor() ([]byte, []int) { - return fileDescriptor_24cf82780fd24e73, []int{0} + return fileDescriptor_mgmt_7dccf6115688f943, []int{0} } - func (m *RanksReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RanksReq.Unmarshal(m, b) } func (m *RanksReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RanksReq.Marshal(b, m, deterministic) } -func (m *RanksReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_RanksReq.Merge(m, src) +func (dst *RanksReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_RanksReq.Merge(dst, src) } func (m *RanksReq) XXX_Size() int { return xxx_messageInfo_RanksReq.Size(m) @@ -86,17 +84,16 @@ func (m *RanksResp) Reset() { *m = RanksResp{} } func (m *RanksResp) String() string { return proto.CompactTextString(m) } func (*RanksResp) ProtoMessage() {} func (*RanksResp) Descriptor() ([]byte, []int) { - return fileDescriptor_24cf82780fd24e73, []int{1} + return fileDescriptor_mgmt_7dccf6115688f943, []int{1} } - func (m *RanksResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RanksResp.Unmarshal(m, b) } func (m *RanksResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RanksResp.Marshal(b, m, deterministic) } -func (m *RanksResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_RanksResp.Merge(m, src) +func (dst *RanksResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_RanksResp.Merge(dst, src) } func (m *RanksResp) XXX_Size() int { return xxx_messageInfo_RanksResp.Size(m) @@ -130,17 +127,16 @@ func (m *RanksResp_RankResult) Reset() { *m = RanksResp_RankResult{} } func (m *RanksResp_RankResult) String() string { return proto.CompactTextString(m) } func (*RanksResp_RankResult) ProtoMessage() {} func (*RanksResp_RankResult) Descriptor() ([]byte, []int) { - return fileDescriptor_24cf82780fd24e73, []int{1, 0} + return fileDescriptor_mgmt_7dccf6115688f943, []int{1, 0} } - func (m *RanksResp_RankResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RanksResp_RankResult.Unmarshal(m, b) } func (m *RanksResp_RankResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RanksResp_RankResult.Marshal(b, m, deterministic) } -func (m *RanksResp_RankResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_RanksResp_RankResult.Merge(m, src) +func (dst *RanksResp_RankResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_RanksResp_RankResult.Merge(dst, src) } func (m *RanksResp_RankResult) XXX_Size() int { return xxx_messageInfo_RanksResp_RankResult.Size(m) @@ -192,51 +188,6 @@ func init() { proto.RegisterType((*RanksResp_RankResult)(nil), "mgmt.RanksResp.RankResult") } -func init() { proto.RegisterFile("mgmt.proto", fileDescriptor_24cf82780fd24e73) } - -var fileDescriptor_24cf82780fd24e73 = []byte{ - // 609 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xdd, 0x4e, 0x13, 0x41, - 0x14, 0xc7, 0xad, 0x94, 0x8f, 0x1e, 0x6c, 0x29, 0x03, 0xe2, 0xa6, 0x57, 0x0d, 0x37, 0xf6, 0x0a, - 0x13, 0x44, 0x94, 0xe8, 0x8d, 0xd0, 0xf8, 0x15, 0x88, 0x75, 0x37, 0x5e, 0x9b, 0xb1, 0x7b, 0x28, - 0x1b, 0xdb, 0x9d, 0xed, 0xcc, 0x69, 0x09, 0xbe, 0x9b, 0x4f, 0xe1, 0x0b, 0x99, 0x33, 0x33, 0xfb, - 0xd1, 0x82, 0x09, 0xdc, 0xcd, 0xf9, 0xf5, 0xff, 0xdb, 0x73, 0x66, 0x76, 0x3b, 0x00, 0x93, 0xd1, - 0x84, 0x0e, 0x32, 0xad, 0x48, 0x89, 0x3a, 0xaf, 0x3b, 0x90, 0x29, 0x35, 0x76, 0xa4, 0xd3, 0x30, - 0x7a, 0xee, 0x97, 0x3b, 0x86, 0x94, 0x96, 0x23, 0xfc, 0x31, 0x9d, 0xa1, 0xbe, 0xc9, 0x7f, 0x97, - 0x43, 0x1f, 0xdd, 0x3f, 0x86, 0x8d, 0x50, 0xa6, 0xbf, 0x4c, 0x88, 0x53, 0xb1, 0x0b, 0xab, 0x9a, - 0xd7, 0x41, 0xad, 0xbb, 0xd2, 0x6b, 0x86, 0xae, 0x60, 0x7a, 0xa9, 0xf4, 0x10, 0x83, 0x95, 0x6e, - 0xad, 0xb7, 0x11, 0xba, 0x62, 0xff, 0x4f, 0x0d, 0x1a, 0x5e, 0x34, 0x99, 0x38, 0x82, 0x75, 0x8d, - 0x66, 0x36, 0x26, 0xe7, 0x6e, 0x1e, 0x76, 0x0e, 0xec, 0x80, 0x45, 0xc2, 0xae, 0x42, 0x1b, 0x09, - 0xf3, 0x68, 0xe7, 0x37, 0x40, 0x89, 0x85, 0x80, 0x3a, 0x37, 0x0c, 0x6a, 0xdd, 0x5a, 0xaf, 0x19, - 0xda, 0xb5, 0xd8, 0x83, 0x35, 0x39, 0xa4, 0x44, 0xa5, 0xc1, 0xe3, 0x6e, 0xad, 0xd7, 0x08, 0x7d, - 0x25, 0x02, 0x58, 0x47, 0xad, 0x95, 0xc6, 0xd8, 0x4f, 0x95, 0x97, 0xa2, 0x0d, 0x2b, 0x13, 0x33, - 0x0a, 0xea, 0x36, 0xce, 0x4b, 0x9e, 0xdf, 0x90, 0x24, 0x0c, 0x56, 0xed, 0x83, 0x5d, 0x71, 0xf8, - 0xb7, 0x01, 0xeb, 0x17, 0xa3, 0x09, 0x45, 0xf3, 0xa1, 0x78, 0x0e, 0xf5, 0x2f, 0x2a, 0x49, 0x45, - 0xd3, 0x0d, 0xcd, 0xeb, 0x10, 0xa7, 0x9d, 0x56, 0xb5, 0x34, 0xd9, 0xfe, 0x23, 0xf1, 0x0e, 0x36, - 0xcf, 0x51, 0xc6, 0xa8, 0xbf, 0xf1, 0x61, 0x8a, 0x5d, 0x17, 0xa8, 0x20, 0xd6, 0x9e, 0xde, 0x41, - 0xad, 0x7d, 0x02, 0x30, 0x50, 0x6a, 0x7c, 0xa6, 0x51, 0x12, 0x8a, 0x1d, 0x17, 0x2b, 0x09, 0xbb, - 0xbb, 0xb7, 0x61, 0xde, 0x98, 0x59, 0x1f, 0x0d, 0x69, 0x55, 0x34, 0xae, 0xa0, 0x4a, 0xe3, 0x05, - 0x6a, 0xed, 0x63, 0x68, 0x30, 0x74, 0x43, 0x8b, 0x32, 0x55, 0x8c, 0xbc, 0x73, 0x8b, 0x55, 0xbb, - 0x46, 0x48, 0x03, 0xad, 0xb2, 0x6a, 0x57, 0x8f, 0x96, 0xba, 0x16, 0xd4, 0xda, 0x07, 0x6e, 0xbb, - 0x1f, 0x91, 0xde, 0x9f, 0x9d, 0x8b, 0x2d, 0x17, 0x73, 0x15, 0x7b, 0xfe, 0xb0, 0x6d, 0x65, 0xf3, - 0xaf, 0xa1, 0xcd, 0xf9, 0xaf, 0x73, 0xd4, 0xd7, 0x3a, 0x21, 0x64, 0xcb, 0x0f, 0x7b, 0xa1, 0xe2, - 0xe4, 0xf2, 0xe6, 0x7f, 0xe2, 0x11, 0x34, 0x59, 0xfc, 0x9e, 0xc5, 0xf2, 0xe1, 0x56, 0x1f, 0xc7, - 0xb8, 0x60, 0x15, 0xe0, 0x4e, 0xeb, 0x14, 0x9a, 0xbc, 0x05, 0x22, 0x39, 0xbc, 0xfa, 0x9c, 0x5e, - 0x2a, 0xb1, 0x57, 0xee, 0xab, 0x80, 0x6c, 0x3e, 0xbb, 0x93, 0xdb, 0x67, 0xbc, 0x85, 0xd6, 0x69, - 0xa2, 0x3e, 0xa1, 0x1c, 0xd3, 0xd5, 0xc2, 0x3b, 0x29, 0x68, 0xe5, 0x9d, 0x54, 0x98, 0x95, 0x0f, - 0x61, 0x33, 0x9a, 0xc4, 0xe7, 0x89, 0xa1, 0x3e, 0xce, 0x4d, 0x7e, 0xac, 0xd1, 0x24, 0xee, 0xe3, - 0x9c, 0xb5, 0xf6, 0x22, 0xb0, 0xce, 0x2b, 0x78, 0xe2, 0x1d, 0xde, 0xb1, 0x11, 0x65, 0x86, 0x6b, - 0xb6, 0xb6, 0x97, 0x48, 0xfe, 0xd9, 0x94, 0x8e, 0x1f, 0xb1, 0x00, 0x95, 0x11, 0x2b, 0xcc, 0x7a, - 0x6f, 0xa0, 0xd9, 0xc7, 0x79, 0xc4, 0x7f, 0x33, 0xb7, 0xbd, 0xed, 0xfc, 0x64, 0x1d, 0x64, 0x55, - 0x2c, 0x23, 0x7f, 0x32, 0xed, 0xc8, 0x5d, 0x57, 0x11, 0xd2, 0x07, 0x39, 0x1b, 0xd3, 0x03, 0xe4, - 0x13, 0x68, 0xf1, 0x24, 0x67, 0x2a, 0x25, 0x99, 0xa4, 0xa8, 0x4d, 0xae, 0xe6, 0xb4, 0xa2, 0x96, - 0xc8, 0xef, 0x74, 0x7b, 0xa0, 0x31, 0x8b, 0xae, 0x66, 0x14, 0xab, 0xeb, 0xd4, 0xde, 0x5a, 0xa2, - 0xb5, 0x70, 0x85, 0x4d, 0x3b, 0x5b, 0x4b, 0x57, 0x9a, 0xfd, 0xc4, 0x1b, 0x11, 0xa9, 0xec, 0x21, - 0xf9, 0x41, 0x92, 0x8e, 0xee, 0x9d, 0x7f, 0x01, 0x10, 0x91, 0xd4, 0x74, 0x5f, 0xe1, 0xe7, 0x9a, - 0xbd, 0xd4, 0x5f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x6b, 0xf5, 0xac, 0x1f, 0x06, 0x00, - 0x00, -} - // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -551,77 +502,6 @@ type MgmtSvcServer interface { StartRanks(context.Context, *RanksReq) (*RanksResp, error) } -// UnimplementedMgmtSvcServer can be embedded to have forward compatible implementations. -type UnimplementedMgmtSvcServer struct { -} - -func (*UnimplementedMgmtSvcServer) Join(ctx context.Context, req *JoinReq) (*JoinResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method Join not implemented") -} -func (*UnimplementedMgmtSvcServer) LeaderQuery(ctx context.Context, req *LeaderQueryReq) (*LeaderQueryResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method LeaderQuery not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolCreate(ctx context.Context, req *PoolCreateReq) (*PoolCreateResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolCreate not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolDestroy(ctx context.Context, req *PoolDestroyReq) (*PoolDestroyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolDestroy not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolQuery(ctx context.Context, req *PoolQueryReq) (*PoolQueryResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolQuery not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolSetProp(ctx context.Context, req *PoolSetPropReq) (*PoolSetPropResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolSetProp not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolGetACL(ctx context.Context, req *GetACLReq) (*ACLResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolGetACL not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolOverwriteACL(ctx context.Context, req *ModifyACLReq) (*ACLResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolOverwriteACL not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolUpdateACL(ctx context.Context, req *ModifyACLReq) (*ACLResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolUpdateACL not implemented") -} -func (*UnimplementedMgmtSvcServer) PoolDeleteACL(ctx context.Context, req *DeleteACLReq) (*ACLResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolDeleteACL not implemented") -} -func (*UnimplementedMgmtSvcServer) GetAttachInfo(ctx context.Context, req *GetAttachInfoReq) (*GetAttachInfoResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAttachInfo not implemented") -} -func (*UnimplementedMgmtSvcServer) BioHealthQuery(ctx context.Context, req *BioHealthReq) (*BioHealthResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method BioHealthQuery not implemented") -} -func (*UnimplementedMgmtSvcServer) SmdListDevs(ctx context.Context, req *SmdDevReq) (*SmdDevResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SmdListDevs not implemented") -} -func (*UnimplementedMgmtSvcServer) SmdListPools(ctx context.Context, req *SmdPoolReq) (*SmdPoolResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SmdListPools not implemented") -} -func (*UnimplementedMgmtSvcServer) ListPools(ctx context.Context, req *ListPoolsReq) (*ListPoolsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPools not implemented") -} -func (*UnimplementedMgmtSvcServer) DevStateQuery(ctx context.Context, req *DevStateReq) (*DevStateResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DevStateQuery not implemented") -} -func (*UnimplementedMgmtSvcServer) StorageSetFaulty(ctx context.Context, req *DevStateReq) (*DevStateResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method StorageSetFaulty not implemented") -} -func (*UnimplementedMgmtSvcServer) ListContainers(ctx context.Context, req *ListContReq) (*ListContResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListContainers not implemented") -} -func (*UnimplementedMgmtSvcServer) PrepShutdownRanks(ctx context.Context, req *RanksReq) (*RanksResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PrepShutdownRanks not implemented") -} -func (*UnimplementedMgmtSvcServer) StopRanks(ctx context.Context, req *RanksReq) (*RanksResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method StopRanks not implemented") -} -func (*UnimplementedMgmtSvcServer) PingRanks(ctx context.Context, req *RanksReq) (*RanksResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PingRanks not implemented") -} -func (*UnimplementedMgmtSvcServer) StartRanks(ctx context.Context, req *RanksReq) (*RanksResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method StartRanks not implemented") -} - func RegisterMgmtSvcServer(s *grpc.Server, srv MgmtSvcServer) { s.RegisterService(&_MgmtSvc_serviceDesc, srv) } @@ -1118,3 +998,48 @@ var _MgmtSvc_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "mgmt.proto", } + +func init() { proto.RegisterFile("mgmt.proto", fileDescriptor_mgmt_7dccf6115688f943) } + +var fileDescriptor_mgmt_7dccf6115688f943 = []byte{ + // 609 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xdd, 0x4e, 0x13, 0x41, + 0x14, 0xc7, 0xad, 0x94, 0x8f, 0x1e, 0x6c, 0x29, 0x03, 0xe2, 0xa6, 0x57, 0x0d, 0x37, 0xf6, 0x0a, + 0x13, 0x44, 0x94, 0xe8, 0x8d, 0xd0, 0xf8, 0x15, 0x88, 0x75, 0x37, 0x5e, 0x9b, 0xb1, 0x7b, 0x28, + 0x1b, 0xdb, 0x9d, 0xed, 0xcc, 0x69, 0x09, 0xbe, 0x9b, 0x4f, 0xe1, 0x0b, 0x99, 0x33, 0x33, 0xfb, + 0xd1, 0x82, 0x09, 0xdc, 0xcd, 0xf9, 0xf5, 0xff, 0xdb, 0x73, 0x66, 0x76, 0x3b, 0x00, 0x93, 0xd1, + 0x84, 0x0e, 0x32, 0xad, 0x48, 0x89, 0x3a, 0xaf, 0x3b, 0x90, 0x29, 0x35, 0x76, 0xa4, 0xd3, 0x30, + 0x7a, 0xee, 0x97, 0x3b, 0x86, 0x94, 0x96, 0x23, 0xfc, 0x31, 0x9d, 0xa1, 0xbe, 0xc9, 0x7f, 0x97, + 0x43, 0x1f, 0xdd, 0x3f, 0x86, 0x8d, 0x50, 0xa6, 0xbf, 0x4c, 0x88, 0x53, 0xb1, 0x0b, 0xab, 0x9a, + 0xd7, 0x41, 0xad, 0xbb, 0xd2, 0x6b, 0x86, 0xae, 0x60, 0x7a, 0xa9, 0xf4, 0x10, 0x83, 0x95, 0x6e, + 0xad, 0xb7, 0x11, 0xba, 0x62, 0xff, 0x4f, 0x0d, 0x1a, 0x5e, 0x34, 0x99, 0x38, 0x82, 0x75, 0x8d, + 0x66, 0x36, 0x26, 0xe7, 0x6e, 0x1e, 0x76, 0x0e, 0xec, 0x80, 0x45, 0xc2, 0xae, 0x42, 0x1b, 0x09, + 0xf3, 0x68, 0xe7, 0x37, 0x40, 0x89, 0x85, 0x80, 0x3a, 0x37, 0x0c, 0x6a, 0xdd, 0x5a, 0xaf, 0x19, + 0xda, 0xb5, 0xd8, 0x83, 0x35, 0x39, 0xa4, 0x44, 0xa5, 0xc1, 0xe3, 0x6e, 0xad, 0xd7, 0x08, 0x7d, + 0x25, 0x02, 0x58, 0x47, 0xad, 0x95, 0xc6, 0xd8, 0x4f, 0x95, 0x97, 0xa2, 0x0d, 0x2b, 0x13, 0x33, + 0x0a, 0xea, 0x36, 0xce, 0x4b, 0x9e, 0xdf, 0x90, 0x24, 0x0c, 0x56, 0xed, 0x83, 0x5d, 0x71, 0xf8, + 0xb7, 0x01, 0xeb, 0x17, 0xa3, 0x09, 0x45, 0xf3, 0xa1, 0x78, 0x0e, 0xf5, 0x2f, 0x2a, 0x49, 0x45, + 0xd3, 0x0d, 0xcd, 0xeb, 0x10, 0xa7, 0x9d, 0x56, 0xb5, 0x34, 0xd9, 0xfe, 0x23, 0xf1, 0x0e, 0x36, + 0xcf, 0x51, 0xc6, 0xa8, 0xbf, 0xf1, 0x61, 0x8a, 0x5d, 0x17, 0xa8, 0x20, 0xd6, 0x9e, 0xde, 0x41, + 0xad, 0x7d, 0x02, 0x30, 0x50, 0x6a, 0x7c, 0xa6, 0x51, 0x12, 0x8a, 0x1d, 0x17, 0x2b, 0x09, 0xbb, + 0xbb, 0xb7, 0x61, 0xde, 0x98, 0x59, 0x1f, 0x0d, 0x69, 0x55, 0x34, 0xae, 0xa0, 0x4a, 0xe3, 0x05, + 0x6a, 0xed, 0x63, 0x68, 0x30, 0x74, 0x43, 0x8b, 0x32, 0x55, 0x8c, 0xbc, 0x73, 0x8b, 0x55, 0xbb, + 0x46, 0x48, 0x03, 0xad, 0xb2, 0x6a, 0x57, 0x8f, 0x96, 0xba, 0x16, 0xd4, 0xda, 0x07, 0x6e, 0xbb, + 0x1f, 0x91, 0xde, 0x9f, 0x9d, 0x8b, 0x2d, 0x17, 0x73, 0x15, 0x7b, 0xfe, 0xb0, 0x6d, 0x65, 0xf3, + 0xaf, 0xa1, 0xcd, 0xf9, 0xaf, 0x73, 0xd4, 0xd7, 0x3a, 0x21, 0x64, 0xcb, 0x0f, 0x7b, 0xa1, 0xe2, + 0xe4, 0xf2, 0xe6, 0x7f, 0xe2, 0x11, 0x34, 0x59, 0xfc, 0x9e, 0xc5, 0xf2, 0xe1, 0x56, 0x1f, 0xc7, + 0xb8, 0x60, 0x15, 0xe0, 0x4e, 0xeb, 0x14, 0x9a, 0xbc, 0x05, 0x22, 0x39, 0xbc, 0xfa, 0x9c, 0x5e, + 0x2a, 0xb1, 0x57, 0xee, 0xab, 0x80, 0x6c, 0x3e, 0xbb, 0x93, 0xdb, 0x67, 0xbc, 0x85, 0xd6, 0x69, + 0xa2, 0x3e, 0xa1, 0x1c, 0xd3, 0xd5, 0xc2, 0x3b, 0x29, 0x68, 0xe5, 0x9d, 0x54, 0x98, 0x95, 0x0f, + 0x61, 0x33, 0x9a, 0xc4, 0xe7, 0x89, 0xa1, 0x3e, 0xce, 0x4d, 0x7e, 0xac, 0xd1, 0x24, 0xee, 0xe3, + 0x9c, 0xb5, 0xf6, 0x22, 0xb0, 0xce, 0x2b, 0x78, 0xe2, 0x1d, 0xde, 0xb1, 0x11, 0x65, 0x86, 0x6b, + 0xb6, 0xb6, 0x97, 0x48, 0xfe, 0xd9, 0x94, 0x8e, 0x1f, 0xb1, 0x00, 0x95, 0x11, 0x2b, 0xcc, 0x7a, + 0x6f, 0xa0, 0xd9, 0xc7, 0x79, 0xc4, 0x7f, 0x33, 0xb7, 0xbd, 0xed, 0xfc, 0x64, 0x1d, 0x64, 0x55, + 0x2c, 0x23, 0x7f, 0x32, 0xed, 0xc8, 0x5d, 0x57, 0x11, 0xd2, 0x07, 0x39, 0x1b, 0xd3, 0x03, 0xe4, + 0x13, 0x68, 0xf1, 0x24, 0x67, 0x2a, 0x25, 0x99, 0xa4, 0xa8, 0x4d, 0xae, 0xe6, 0xb4, 0xa2, 0x96, + 0xc8, 0xef, 0x74, 0x7b, 0xa0, 0x31, 0x8b, 0xae, 0x66, 0x14, 0xab, 0xeb, 0xd4, 0xde, 0x5a, 0xa2, + 0xb5, 0x70, 0x85, 0x4d, 0x3b, 0x5b, 0x4b, 0x57, 0x9a, 0xfd, 0xc4, 0x1b, 0x11, 0xa9, 0xec, 0x21, + 0xf9, 0x41, 0x92, 0x8e, 0xee, 0x9d, 0x7f, 0x01, 0x10, 0x91, 0xd4, 0x74, 0x5f, 0xe1, 0xe7, 0x9a, + 0xbd, 0xd4, 0x5f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x6b, 0xf5, 0xac, 0x1f, 0x06, 0x00, + 0x00, +} diff --git a/src/control/common/proto/mgmt/srv.pb.go b/src/control/common/proto/mgmt/srv.pb.go index d602aab2eac..e6cf795faa1 100644 --- a/src/control/common/proto/mgmt/srv.pb.go +++ b/src/control/common/proto/mgmt/srv.pb.go @@ -3,11 +3,9 @@ package mgmt -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -18,7 +16,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type JoinResp_State int32 @@ -31,7 +29,6 @@ var JoinResp_State_name = map[int32]string{ 0: "IN", 1: "OUT", } - var JoinResp_State_value = map[string]int32{ "IN": 0, "OUT": 1, @@ -40,9 +37,8 @@ var JoinResp_State_value = map[string]int32{ func (x JoinResp_State) String() string { return proto.EnumName(JoinResp_State_name, int32(x)) } - func (JoinResp_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{2, 0} + return fileDescriptor_srv_f216af06b8e06c7d, []int{2, 0} } // Generic response just containing DER from IO server. @@ -57,17 +53,16 @@ func (m *DaosResp) Reset() { *m = DaosResp{} } func (m *DaosResp) String() string { return proto.CompactTextString(m) } func (*DaosResp) ProtoMessage() {} func (*DaosResp) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{0} + return fileDescriptor_srv_f216af06b8e06c7d, []int{0} } - func (m *DaosResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DaosResp.Unmarshal(m, b) } func (m *DaosResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DaosResp.Marshal(b, m, deterministic) } -func (m *DaosResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_DaosResp.Merge(m, src) +func (dst *DaosResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DaosResp.Merge(dst, src) } func (m *DaosResp) XXX_Size() int { return xxx_messageInfo_DaosResp.Size(m) @@ -100,17 +95,16 @@ func (m *JoinReq) Reset() { *m = JoinReq{} } func (m *JoinReq) String() string { return proto.CompactTextString(m) } func (*JoinReq) ProtoMessage() {} func (*JoinReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{1} + return fileDescriptor_srv_f216af06b8e06c7d, []int{1} } - func (m *JoinReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinReq.Unmarshal(m, b) } func (m *JoinReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JoinReq.Marshal(b, m, deterministic) } -func (m *JoinReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinReq.Merge(m, src) +func (dst *JoinReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_JoinReq.Merge(dst, src) } func (m *JoinReq) XXX_Size() int { return xxx_messageInfo_JoinReq.Size(m) @@ -169,17 +163,16 @@ func (m *JoinResp) Reset() { *m = JoinResp{} } func (m *JoinResp) String() string { return proto.CompactTextString(m) } func (*JoinResp) ProtoMessage() {} func (*JoinResp) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{2} + return fileDescriptor_srv_f216af06b8e06c7d, []int{2} } - func (m *JoinResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinResp.Unmarshal(m, b) } func (m *JoinResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JoinResp.Marshal(b, m, deterministic) } -func (m *JoinResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinResp.Merge(m, src) +func (dst *JoinResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_JoinResp.Merge(dst, src) } func (m *JoinResp) XXX_Size() int { return xxx_messageInfo_JoinResp.Size(m) @@ -222,17 +215,16 @@ func (m *LeaderQueryReq) Reset() { *m = LeaderQueryReq{} } func (m *LeaderQueryReq) String() string { return proto.CompactTextString(m) } func (*LeaderQueryReq) ProtoMessage() {} func (*LeaderQueryReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{3} + return fileDescriptor_srv_f216af06b8e06c7d, []int{3} } - func (m *LeaderQueryReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LeaderQueryReq.Unmarshal(m, b) } func (m *LeaderQueryReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LeaderQueryReq.Marshal(b, m, deterministic) } -func (m *LeaderQueryReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaderQueryReq.Merge(m, src) +func (dst *LeaderQueryReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaderQueryReq.Merge(dst, src) } func (m *LeaderQueryReq) XXX_Size() int { return xxx_messageInfo_LeaderQueryReq.Size(m) @@ -262,17 +254,16 @@ func (m *LeaderQueryResp) Reset() { *m = LeaderQueryResp{} } func (m *LeaderQueryResp) String() string { return proto.CompactTextString(m) } func (*LeaderQueryResp) ProtoMessage() {} func (*LeaderQueryResp) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{4} + return fileDescriptor_srv_f216af06b8e06c7d, []int{4} } - func (m *LeaderQueryResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LeaderQueryResp.Unmarshal(m, b) } func (m *LeaderQueryResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LeaderQueryResp.Marshal(b, m, deterministic) } -func (m *LeaderQueryResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaderQueryResp.Merge(m, src) +func (dst *LeaderQueryResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaderQueryResp.Merge(dst, src) } func (m *LeaderQueryResp) XXX_Size() int { return xxx_messageInfo_LeaderQueryResp.Size(m) @@ -308,17 +299,16 @@ func (m *GetAttachInfoReq) Reset() { *m = GetAttachInfoReq{} } func (m *GetAttachInfoReq) String() string { return proto.CompactTextString(m) } func (*GetAttachInfoReq) ProtoMessage() {} func (*GetAttachInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{5} + return fileDescriptor_srv_f216af06b8e06c7d, []int{5} } - func (m *GetAttachInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAttachInfoReq.Unmarshal(m, b) } func (m *GetAttachInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetAttachInfoReq.Marshal(b, m, deterministic) } -func (m *GetAttachInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachInfoReq.Merge(m, src) +func (dst *GetAttachInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAttachInfoReq.Merge(dst, src) } func (m *GetAttachInfoReq) XXX_Size() int { return xxx_messageInfo_GetAttachInfoReq.Size(m) @@ -337,28 +327,34 @@ func (m *GetAttachInfoReq) GetSys() string { } type GetAttachInfoResp struct { - Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` - Psrs []*GetAttachInfoResp_Psr `protobuf:"bytes,2,rep,name=psrs,proto3" json:"psrs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` + Psrs []*GetAttachInfoResp_Psr `protobuf:"bytes,2,rep,name=psrs,proto3" json:"psrs,omitempty"` + // These CaRT settings are shared with the + // libdaos client to aid in CaRT initialization. + Provider string `protobuf:"bytes,3,opt,name=Provider,proto3" json:"Provider,omitempty"` + Interface string `protobuf:"bytes,4,opt,name=Interface,proto3" json:"Interface,omitempty"` + Domain string `protobuf:"bytes,5,opt,name=Domain,proto3" json:"Domain,omitempty"` + CrtCtxShareAddr uint32 `protobuf:"varint,6,opt,name=CrtCtxShareAddr,proto3" json:"CrtCtxShareAddr,omitempty"` + CrtTimeout uint32 `protobuf:"varint,7,opt,name=CrtTimeout,proto3" json:"CrtTimeout,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetAttachInfoResp) Reset() { *m = GetAttachInfoResp{} } func (m *GetAttachInfoResp) String() string { return proto.CompactTextString(m) } func (*GetAttachInfoResp) ProtoMessage() {} func (*GetAttachInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{6} + return fileDescriptor_srv_f216af06b8e06c7d, []int{6} } - func (m *GetAttachInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAttachInfoResp.Unmarshal(m, b) } func (m *GetAttachInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetAttachInfoResp.Marshal(b, m, deterministic) } -func (m *GetAttachInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachInfoResp.Merge(m, src) +func (dst *GetAttachInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAttachInfoResp.Merge(dst, src) } func (m *GetAttachInfoResp) XXX_Size() int { return xxx_messageInfo_GetAttachInfoResp.Size(m) @@ -383,6 +379,41 @@ func (m *GetAttachInfoResp) GetPsrs() []*GetAttachInfoResp_Psr { return nil } +func (m *GetAttachInfoResp) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *GetAttachInfoResp) GetInterface() string { + if m != nil { + return m.Interface + } + return "" +} + +func (m *GetAttachInfoResp) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *GetAttachInfoResp) GetCrtCtxShareAddr() uint32 { + if m != nil { + return m.CrtCtxShareAddr + } + return 0 +} + +func (m *GetAttachInfoResp) GetCrtTimeout() uint32 { + if m != nil { + return m.CrtTimeout + } + return 0 +} + type GetAttachInfoResp_Psr struct { Rank uint32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` @@ -395,17 +426,16 @@ func (m *GetAttachInfoResp_Psr) Reset() { *m = GetAttachInfoResp_Psr{} } func (m *GetAttachInfoResp_Psr) String() string { return proto.CompactTextString(m) } func (*GetAttachInfoResp_Psr) ProtoMessage() {} func (*GetAttachInfoResp_Psr) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{6, 0} + return fileDescriptor_srv_f216af06b8e06c7d, []int{6, 0} } - func (m *GetAttachInfoResp_Psr) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAttachInfoResp_Psr.Unmarshal(m, b) } func (m *GetAttachInfoResp_Psr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetAttachInfoResp_Psr.Marshal(b, m, deterministic) } -func (m *GetAttachInfoResp_Psr) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachInfoResp_Psr.Merge(m, src) +func (dst *GetAttachInfoResp_Psr) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAttachInfoResp_Psr.Merge(dst, src) } func (m *GetAttachInfoResp_Psr) XXX_Size() int { return xxx_messageInfo_GetAttachInfoResp_Psr.Size(m) @@ -441,17 +471,16 @@ func (m *PrepShutdownReq) Reset() { *m = PrepShutdownReq{} } func (m *PrepShutdownReq) String() string { return proto.CompactTextString(m) } func (*PrepShutdownReq) ProtoMessage() {} func (*PrepShutdownReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{7} + return fileDescriptor_srv_f216af06b8e06c7d, []int{7} } - func (m *PrepShutdownReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PrepShutdownReq.Unmarshal(m, b) } func (m *PrepShutdownReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PrepShutdownReq.Marshal(b, m, deterministic) } -func (m *PrepShutdownReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrepShutdownReq.Merge(m, src) +func (dst *PrepShutdownReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrepShutdownReq.Merge(dst, src) } func (m *PrepShutdownReq) XXX_Size() int { return xxx_messageInfo_PrepShutdownReq.Size(m) @@ -480,17 +509,16 @@ func (m *PingRankReq) Reset() { *m = PingRankReq{} } func (m *PingRankReq) String() string { return proto.CompactTextString(m) } func (*PingRankReq) ProtoMessage() {} func (*PingRankReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{8} + return fileDescriptor_srv_f216af06b8e06c7d, []int{8} } - func (m *PingRankReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PingRankReq.Unmarshal(m, b) } func (m *PingRankReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PingRankReq.Marshal(b, m, deterministic) } -func (m *PingRankReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingRankReq.Merge(m, src) +func (dst *PingRankReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_PingRankReq.Merge(dst, src) } func (m *PingRankReq) XXX_Size() int { return xxx_messageInfo_PingRankReq.Size(m) @@ -519,17 +547,16 @@ func (m *SetRankReq) Reset() { *m = SetRankReq{} } func (m *SetRankReq) String() string { return proto.CompactTextString(m) } func (*SetRankReq) ProtoMessage() {} func (*SetRankReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{9} + return fileDescriptor_srv_f216af06b8e06c7d, []int{9} } - func (m *SetRankReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetRankReq.Unmarshal(m, b) } func (m *SetRankReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SetRankReq.Marshal(b, m, deterministic) } -func (m *SetRankReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetRankReq.Merge(m, src) +func (dst *SetRankReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetRankReq.Merge(dst, src) } func (m *SetRankReq) XXX_Size() int { return xxx_messageInfo_SetRankReq.Size(m) @@ -560,17 +587,16 @@ func (m *CreateMsReq) Reset() { *m = CreateMsReq{} } func (m *CreateMsReq) String() string { return proto.CompactTextString(m) } func (*CreateMsReq) ProtoMessage() {} func (*CreateMsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{10} + return fileDescriptor_srv_f216af06b8e06c7d, []int{10} } - func (m *CreateMsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateMsReq.Unmarshal(m, b) } func (m *CreateMsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_CreateMsReq.Marshal(b, m, deterministic) } -func (m *CreateMsReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateMsReq.Merge(m, src) +func (dst *CreateMsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateMsReq.Merge(dst, src) } func (m *CreateMsReq) XXX_Size() int { return xxx_messageInfo_CreateMsReq.Size(m) @@ -603,7 +629,6 @@ func (m *CreateMsReq) GetAddr() string { } func init() { - proto.RegisterEnum("mgmt.JoinResp_State", JoinResp_State_name, JoinResp_State_value) proto.RegisterType((*DaosResp)(nil), "mgmt.DaosResp") proto.RegisterType((*JoinReq)(nil), "mgmt.JoinReq") proto.RegisterType((*JoinResp)(nil), "mgmt.JoinResp") @@ -616,38 +641,42 @@ func init() { proto.RegisterType((*PingRankReq)(nil), "mgmt.PingRankReq") proto.RegisterType((*SetRankReq)(nil), "mgmt.SetRankReq") proto.RegisterType((*CreateMsReq)(nil), "mgmt.CreateMsReq") + proto.RegisterEnum("mgmt.JoinResp_State", JoinResp_State_name, JoinResp_State_value) } -func init() { - proto.RegisterFile("srv.proto", fileDescriptor_2bbe8325d22c1a26) -} - -var fileDescriptor_2bbe8325d22c1a26 = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xeb, 0x6a, 0xd4, 0x40, - 0x14, 0x80, 0x4d, 0xb2, 0xd9, 0x6e, 0xce, 0xd2, 0x36, 0x0e, 0x45, 0x42, 0xf5, 0x47, 0x1c, 0x2a, - 0x04, 0x85, 0x08, 0xf5, 0x09, 0x44, 0x41, 0x2a, 0x5e, 0xe2, 0x44, 0x1f, 0x60, 0x9a, 0x8c, 0x6d, - 0xa8, 0xc9, 0xc4, 0x73, 0x26, 0xea, 0x82, 0x2f, 0xe0, 0x5b, 0xcb, 0x4c, 0xd2, 0x94, 0xed, 0xed, - 0xdf, 0xb9, 0x7c, 0xe7, 0x3a, 0x67, 0x20, 0x22, 0xfc, 0x95, 0xf7, 0xa8, 0x8d, 0x66, 0x8b, 0xf6, - 0xac, 0x35, 0x9c, 0xc3, 0xea, 0xad, 0xd4, 0x24, 0x14, 0xf5, 0xec, 0x11, 0x2c, 0xc9, 0x48, 0x33, - 0x50, 0xe2, 0xa5, 0x5e, 0x16, 0x8a, 0x49, 0xe3, 0x2d, 0xec, 0xbc, 0xd7, 0x4d, 0x27, 0xd4, 0x4f, - 0xc6, 0x60, 0x31, 0x0c, 0x4d, 0xed, 0x80, 0x48, 0x38, 0xd9, 0xda, 0x50, 0x76, 0x17, 0x89, 0x9f, - 0x7a, 0xd9, 0xae, 0x70, 0x32, 0x8b, 0x21, 0x18, 0xb0, 0x49, 0x02, 0x87, 0x59, 0x91, 0x1d, 0x40, - 0xd8, 0x55, 0xe6, 0x0f, 0x25, 0x0b, 0x87, 0x8d, 0x8a, 0x8d, 0x95, 0x75, 0x8d, 0x49, 0x38, 0xe6, - 0xb3, 0x32, 0xff, 0x0b, 0xab, 0xb1, 0xdc, 0xdd, 0x2d, 0xdd, 0x5a, 0xf3, 0x39, 0x84, 0xd6, 0xab, - 0x5c, 0xd5, 0xbd, 0xe3, 0x83, 0xdc, 0x0e, 0x98, 0x5f, 0xa6, 0xca, 0x4b, 0xeb, 0x13, 0x23, 0xc2, - 0x13, 0x08, 0x9d, 0xce, 0x96, 0xe0, 0x9f, 0x7c, 0x8a, 0x1f, 0xb0, 0x1d, 0x08, 0x3e, 0x7f, 0xfb, - 0x1a, 0x7b, 0x3c, 0x83, 0xbd, 0x0f, 0x4a, 0xd6, 0x0a, 0xbf, 0x0c, 0x0a, 0x37, 0x76, 0x66, 0xdb, - 0xc3, 0x86, 0x8c, 0x6a, 0xa7, 0xa9, 0x27, 0x8d, 0x97, 0xb0, 0xbf, 0x45, 0x52, 0xcf, 0x8e, 0x60, - 0xb7, 0x1a, 0x10, 0x55, 0x67, 0x46, 0xcf, 0x14, 0xb1, 0x6d, 0x64, 0x87, 0xb0, 0x42, 0xd5, 0xff, - 0x68, 0x2a, 0x49, 0x89, 0x9f, 0x06, 0x59, 0x24, 0x66, 0x9d, 0x1f, 0x41, 0xfc, 0x4e, 0x99, 0xd7, - 0xc6, 0xc8, 0xea, 0xfc, 0xa4, 0xfb, 0xae, 0x6d, 0x03, 0x31, 0x04, 0xb4, 0xa1, 0x29, 0x97, 0x15, - 0xf9, 0x3f, 0x0f, 0x1e, 0x5e, 0xc3, 0xee, 0x59, 0xd6, 0x4b, 0x58, 0xf4, 0x84, 0x63, 0xad, 0xf5, - 0xf1, 0xe3, 0x71, 0x2f, 0x37, 0xc2, 0xf3, 0x82, 0x50, 0x38, 0xf0, 0xf0, 0x05, 0x04, 0x05, 0xe1, - 0xbc, 0x64, 0xef, 0xe6, 0xc3, 0xfa, 0xf3, 0xc3, 0xf2, 0x67, 0xb0, 0x5f, 0xa0, 0xea, 0xcb, 0xf3, - 0xc1, 0xd4, 0xfa, 0xf7, 0xe5, 0x95, 0x5c, 0x0f, 0xe4, 0x4f, 0x61, 0x5d, 0x34, 0xdd, 0x99, 0x90, - 0xdd, 0xc5, 0x5d, 0x48, 0x0a, 0x50, 0x2a, 0x73, 0x1f, 0x51, 0xc2, 0xfa, 0x0d, 0x2a, 0x69, 0xd4, - 0x47, 0xb2, 0xc8, 0x13, 0x88, 0x4e, 0xb5, 0x36, 0x64, 0x50, 0xf6, 0x8e, 0x5b, 0x89, 0x2b, 0xc3, - 0x7c, 0xab, 0xfe, 0xf6, 0xad, 0xba, 0x7b, 0x0b, 0xae, 0xee, 0xed, 0x74, 0xe9, 0xfe, 0xc3, 0xab, - 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x37, 0xe1, 0x67, 0x1c, 0x03, 0x00, 0x00, +func init() { proto.RegisterFile("srv.proto", fileDescriptor_srv_f216af06b8e06c7d) } + +var fileDescriptor_srv_f216af06b8e06c7d = []byte{ + // 486 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x6b, 0x6a, 0xdb, 0x40, + 0x10, 0xae, 0x25, 0xbf, 0x34, 0x26, 0xb1, 0xbb, 0x84, 0x22, 0xd2, 0x50, 0xdc, 0x25, 0x05, 0xd3, + 0x82, 0x0b, 0xe9, 0x09, 0x82, 0x03, 0xc5, 0xa5, 0x0f, 0x75, 0x95, 0x1e, 0x60, 0x23, 0x6d, 0x62, + 0x91, 0x4a, 0xab, 0xce, 0x8e, 0xd2, 0x18, 0x7a, 0x9d, 0xde, 0xb3, 0xec, 0x4a, 0x91, 0x6b, 0xe7, + 0xf1, 0x6f, 0xbe, 0x6f, 0xbf, 0x79, 0xed, 0xcc, 0x40, 0x60, 0xf0, 0x66, 0x5e, 0xa2, 0x26, 0xcd, + 0xba, 0xf9, 0x55, 0x4e, 0x9c, 0xc3, 0xf0, 0x4c, 0x6a, 0x23, 0x94, 0x29, 0xd9, 0x0b, 0xe8, 0x1b, + 0x92, 0x54, 0x99, 0xb0, 0x33, 0xed, 0xcc, 0x7a, 0xa2, 0x41, 0x3c, 0x87, 0xc1, 0x27, 0x9d, 0x15, + 0x42, 0xfd, 0x62, 0x0c, 0xba, 0x55, 0x95, 0xa5, 0x4e, 0x10, 0x08, 0x67, 0x5b, 0x0e, 0x65, 0x71, + 0x1d, 0x7a, 0xd3, 0xce, 0x6c, 0x4f, 0x38, 0x9b, 0x4d, 0xc0, 0xaf, 0x30, 0x0b, 0x7d, 0x27, 0xb3, + 0x26, 0x3b, 0x80, 0x5e, 0x91, 0xd0, 0xad, 0x09, 0xbb, 0x4e, 0x56, 0x03, 0xeb, 0x2b, 0xd3, 0x14, + 0xc3, 0x5e, 0x1d, 0xcf, 0xda, 0xfc, 0x0f, 0x0c, 0xeb, 0x74, 0x8f, 0x97, 0xf4, 0x60, 0xce, 0xb7, + 0xd0, 0xb3, 0xaf, 0xca, 0x65, 0xdd, 0x3f, 0x39, 0x98, 0xdb, 0x06, 0xe7, 0x77, 0xa1, 0xe6, 0xb1, + 0x7d, 0x13, 0xb5, 0x84, 0x87, 0xd0, 0x73, 0x98, 0xf5, 0xc1, 0x5b, 0x7e, 0x9d, 0x3c, 0x63, 0x03, + 0xf0, 0xbf, 0xfd, 0x38, 0x9f, 0x74, 0xf8, 0x0c, 0xf6, 0x3f, 0x2b, 0x99, 0x2a, 0xfc, 0x5e, 0x29, + 0x5c, 0xdb, 0x9e, 0x6d, 0x0d, 0x6b, 0x43, 0x2a, 0x6f, 0xba, 0x6e, 0x10, 0x8f, 0x61, 0xbc, 0xa5, + 0x34, 0x25, 0x3b, 0x86, 0xbd, 0xa4, 0x42, 0x54, 0x05, 0xd5, 0x2f, 0x8d, 0xc7, 0x36, 0xc9, 0x0e, + 0x61, 0x88, 0xaa, 0xfc, 0x99, 0x25, 0xd2, 0x84, 0xde, 0xd4, 0x9f, 0x05, 0xa2, 0xc5, 0xfc, 0x18, + 0x26, 0x1f, 0x15, 0x9d, 0x12, 0xc9, 0x64, 0xb5, 0x2c, 0x2e, 0xb5, 0x2d, 0x60, 0x02, 0xbe, 0x59, + 0x9b, 0x26, 0x96, 0x35, 0xf9, 0x5f, 0x0f, 0x9e, 0xef, 0xc8, 0x9e, 0xf8, 0xac, 0xf7, 0xd0, 0x2d, + 0x0d, 0xd6, 0xb9, 0x46, 0x27, 0x2f, 0xeb, 0x7f, 0xb9, 0xe7, 0x3e, 0x8f, 0x0c, 0x0a, 0x27, 0xb4, + 0x05, 0x46, 0xa8, 0x6f, 0x32, 0xdb, 0x41, 0x3d, 0xc2, 0x16, 0xb3, 0x23, 0x08, 0x96, 0x05, 0x29, + 0xbc, 0x94, 0x89, 0x72, 0xb3, 0x0c, 0xc4, 0x86, 0xb0, 0x25, 0x9c, 0xe9, 0x5c, 0x66, 0x45, 0x33, + 0xd1, 0x06, 0xb1, 0x19, 0x8c, 0x17, 0x48, 0x0b, 0xba, 0x8d, 0x57, 0x12, 0xd5, 0xa9, 0x1d, 0x79, + 0xdf, 0x8d, 0x6e, 0x97, 0x66, 0xaf, 0x00, 0x16, 0x48, 0xe7, 0x59, 0xae, 0x74, 0x45, 0xe1, 0xc0, + 0x89, 0xfe, 0x63, 0x0e, 0xdf, 0x81, 0x1f, 0x19, 0x6c, 0x17, 0xa0, 0x73, 0x7f, 0xe9, 0xbc, 0x76, + 0xe9, 0xf8, 0x1b, 0x18, 0x47, 0xa8, 0xca, 0x78, 0x55, 0x51, 0xaa, 0x7f, 0xdf, 0x6d, 0xf0, 0xae, + 0x23, 0x7f, 0x0d, 0xa3, 0x28, 0x2b, 0xae, 0x84, 0x2c, 0xae, 0x1f, 0x93, 0x4c, 0x01, 0x62, 0x45, + 0x4f, 0x29, 0x62, 0x18, 0x2d, 0x50, 0x49, 0x52, 0x5f, 0x8c, 0x95, 0x1c, 0x41, 0x70, 0xa1, 0x35, + 0x19, 0x42, 0x59, 0x3a, 0xdd, 0x50, 0x6c, 0x88, 0xf6, 0x8e, 0xbc, 0xed, 0x3b, 0x72, 0xb7, 0xe0, + 0x6f, 0x6e, 0xe1, 0xa2, 0xef, 0x6e, 0xf5, 0xc3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x63, + 0x3d, 0xc1, 0xb8, 0x03, 0x00, 0x00, } diff --git a/src/control/common/proto/srv/srv.pb.go b/src/control/common/proto/srv/srv.pb.go index 999edd16374..7266ecc15dd 100644 --- a/src/control/common/proto/srv/srv.pb.go +++ b/src/control/common/proto/srv/srv.pb.go @@ -3,11 +3,9 @@ package srv -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -18,7 +16,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type NotifyReadyReq struct { Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` @@ -35,17 +33,16 @@ func (m *NotifyReadyReq) Reset() { *m = NotifyReadyReq{} } func (m *NotifyReadyReq) String() string { return proto.CompactTextString(m) } func (*NotifyReadyReq) ProtoMessage() {} func (*NotifyReadyReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{0} + return fileDescriptor_srv_4bbf5276e94a62bb, []int{0} } - func (m *NotifyReadyReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NotifyReadyReq.Unmarshal(m, b) } func (m *NotifyReadyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_NotifyReadyReq.Marshal(b, m, deterministic) } -func (m *NotifyReadyReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotifyReadyReq.Merge(m, src) +func (dst *NotifyReadyReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotifyReadyReq.Merge(dst, src) } func (m *NotifyReadyReq) XXX_Size() int { return xxx_messageInfo_NotifyReadyReq.Size(m) @@ -108,17 +105,16 @@ func (m *BioErrorReq) Reset() { *m = BioErrorReq{} } func (m *BioErrorReq) String() string { return proto.CompactTextString(m) } func (*BioErrorReq) ProtoMessage() {} func (*BioErrorReq) Descriptor() ([]byte, []int) { - return fileDescriptor_2bbe8325d22c1a26, []int{1} + return fileDescriptor_srv_4bbf5276e94a62bb, []int{1} } - func (m *BioErrorReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BioErrorReq.Unmarshal(m, b) } func (m *BioErrorReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_BioErrorReq.Marshal(b, m, deterministic) } -func (m *BioErrorReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_BioErrorReq.Merge(m, src) +func (dst *BioErrorReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_BioErrorReq.Merge(dst, src) } func (m *BioErrorReq) XXX_Size() int { return xxx_messageInfo_BioErrorReq.Size(m) @@ -183,9 +179,9 @@ func init() { proto.RegisterType((*BioErrorReq)(nil), "srv.BioErrorReq") } -func init() { proto.RegisterFile("srv.proto", fileDescriptor_2bbe8325d22c1a26) } +func init() { proto.RegisterFile("srv.proto", fileDescriptor_srv_4bbf5276e94a62bb) } -var fileDescriptor_2bbe8325d22c1a26 = []byte{ +var fileDescriptor_srv_4bbf5276e94a62bb = []byte{ // 246 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x4a, 0x03, 0x31, 0x10, 0xc6, 0x49, 0x63, 0xfa, 0x67, 0x8a, 0x52, 0x82, 0x87, 0xe0, 0x69, 0xe9, 0xa9, 0x78, 0xf0, diff --git a/src/control/server/config.go b/src/control/server/config.go index b19775e73a1..65bbc283cfa 100644 --- a/src/control/server/config.go +++ b/src/control/server/config.go @@ -53,6 +53,14 @@ const ( type networkProviderValidation func(string, string) error type networkNUMAValidation func(string, uint) error +// ClientNetworkCfg elements are used by the libdaos clients to help initialize CaRT. +// These settings bring coherence between the client and server network configuration. +type ClientNetworkCfg struct { + Provider string + CrtCtxShareAddr uint32 + CrtTimeout uint32 +} + // Configuration describes options for DAOS control plane. // See utils/config/daos_server.yml for parameter descriptions. type Configuration struct { @@ -154,6 +162,24 @@ func (c *Configuration) WithFabricProvider(provider string) *Configuration { return c } +// WithCrtCtxShareAddr sets the top-level CrtCtxShareAddr. +func (c *Configuration) WithCrtCtxShareAddr(addr uint32) *Configuration { + c.Fabric.CrtCtxShareAddr = addr + for _, srv := range c.Servers { + srv.Fabric.Update(c.Fabric) + } + return c +} + +// WithCrtTimeout sets the top-level CrtTimeout. +func (c *Configuration) WithCrtTimeout(timeout uint32) *Configuration { + c.Fabric.CrtTimeout = timeout + for _, srv := range c.Servers { + srv.Fabric.Update(c.Fabric) + } + return c +} + // NB: In order to ease maintenance, the set of chained config functions // which modify nested ioserver configurations should be kept above this // one as a reference for which things should be set/updated in the next diff --git a/src/control/server/config_test.go b/src/control/server/config_test.go index 0b7c4980e92..2f66fc95f1c 100644 --- a/src/control/server/config_test.go +++ b/src/control/server/config_test.go @@ -219,6 +219,8 @@ func TestServer_ConstructedConfig(t *testing.T) { WithSystemName("daos"). WithSocketDir("./.daos/daos_server"). WithFabricProvider("ofi+verbs;ofi_rxm"). + WithCrtCtxShareAddr(1). + WithCrtTimeout(30). WithAccessPoints("hostname1"). WithFaultCb("./.daos/fd_callback"). WithFaultPath("/vcdu0/rack1/hostname"). diff --git a/src/control/server/ioserver/config.go b/src/control/server/ioserver/config.go index f5aaf0dc3fd..344a388c108 100644 --- a/src/control/server/ioserver/config.go +++ b/src/control/server/ioserver/config.go @@ -55,10 +55,12 @@ func (sc *StorageConfig) Validate() error { // FabricConfig encapsulates networking fabric configuration. type FabricConfig struct { - Provider string `yaml:"provider,omitempty" cmdEnv:"CRT_PHY_ADDR_STR"` - Interface string `yaml:"fabric_iface,omitempty" cmdEnv:"OFI_INTERFACE"` - InterfacePort int `yaml:"fabric_iface_port,omitempty" cmdEnv:"OFI_PORT,nonzero"` - PinnedNumaNode *uint `yaml:"pinned_numa_node,omitempty" cmdLongFlag:"--pinned_numa_node" cmdShortFlag:"-p"` + Provider string `yaml:"provider,omitempty" cmdEnv:"CRT_PHY_ADDR_STR"` + Interface string `yaml:"fabric_iface,omitempty" cmdEnv:"OFI_INTERFACE"` + InterfacePort int `yaml:"fabric_iface_port,omitempty" cmdEnv:"OFI_PORT,nonzero"` + PinnedNumaNode *uint `yaml:"pinned_numa_node,omitempty" cmdLongFlag:"--pinned_numa_node" cmdShortFlag:"-p"` + CrtCtxShareAddr uint32 `yaml:"crt_ctx_share_addr,omitempty" cmdEnv:"CRT_CTX_SHARE_ADDR"` + CrtTimeout uint32 `yaml:"crt_timeout,omitempty" cmdEnv:"CRT_TIMEOUT"` } // Update fills in any missing fields from the provided FabricConfig. @@ -72,6 +74,12 @@ func (fc *FabricConfig) Update(other FabricConfig) { if fc.InterfacePort == 0 { fc.InterfacePort = other.InterfacePort } + if fc.CrtCtxShareAddr == 0 { + fc.CrtCtxShareAddr = other.CrtCtxShareAddr + } + if fc.CrtTimeout == 0 { + fc.CrtTimeout = other.CrtTimeout + } } // GetNumaNode retrieves the value configured by the YML if it was supplied @@ -320,6 +328,18 @@ func (c *Config) WithPinnedNumaNode(numa *uint) *Config { return c } +// WithCrtCtxShareAddr defines the CRT_CTX_SHARE_ADDR for this instance +func (c *Config) WithCrtCtxShareAddr(addr uint32) *Config { + c.Fabric.CrtCtxShareAddr = addr + return c +} + +// WithCrtTimeout defines the CRT_TIMEOUT for this instance +func (c *Config) WithCrtTimeout(timeout uint32) *Config { + c.Fabric.CrtTimeout = timeout + return c +} + // WithTargetCount sets the number of VOS targets to run on this instance. func (c *Config) WithTargetCount(count int) *Config { c.TargetCount = count diff --git a/src/control/server/ioserver/config_test.go b/src/control/server/ioserver/config_test.go index b05649b1fef..0611c1543b9 100644 --- a/src/control/server/ioserver/config_test.go +++ b/src/control/server/ioserver/config_test.go @@ -294,22 +294,24 @@ func TestIOServer_ConfigValidation(t *testing.T) { func TestConfigToCmdVals(t *testing.T) { var ( - mountPoint = "/mnt/test" - provider = "test+foo" - interfaceName = "qib0" - modules = "foo,bar,baz" - systemName = "test-system" - socketDir = "/var/run/foo" - logMask = "LOG_MASK_VALUE" - logFile = "/path/to/log" - cfgPath = "/path/to/nvme.conf" - shmId = 42 - interfacePort = 20 - targetCount = 4 - helperCount = 1 - serviceCore = 8 - index = 2 - pinnedNumaNode = uint(1) + mountPoint = "/mnt/test" + provider = "test+foo" + interfaceName = "qib0" + modules = "foo,bar,baz" + systemName = "test-system" + socketDir = "/var/run/foo" + logMask = "LOG_MASK_VALUE" + logFile = "/path/to/log" + cfgPath = "/path/to/nvme.conf" + shmId = 42 + interfacePort = 20 + targetCount = 4 + helperCount = 1 + serviceCore = 8 + index = 2 + pinnedNumaNode = uint(1) + crtCtxShareAddr = uint32(1) + crtTimeout = uint32(30) ) cfg := NewConfig(). WithScmMountPoint(mountPoint). @@ -326,7 +328,9 @@ func TestConfigToCmdVals(t *testing.T) { WithLogMask(logMask). WithShmID(shmId). WithBdevConfigPath(cfgPath). - WithSystemName(systemName) + WithSystemName(systemName). + WithCrtCtxShareAddr(crtCtxShareAddr). + WithCrtTimeout(crtTimeout) cfg.Index = uint32(index) @@ -349,6 +353,8 @@ func TestConfigToCmdVals(t *testing.T) { "CRT_PHY_ADDR_STR=" + provider, "D_LOG_FILE=" + logFile, "D_LOG_MASK=" + logMask, + "CRT_TIMEOUT=" + strconv.FormatUint(uint64(crtTimeout), 10), + "CRT_CTX_SHARE_ADDR=" + strconv.FormatUint(uint64(crtCtxShareAddr), 10), } gotArgs, err := cfg.CmdLineArgs() diff --git a/src/control/server/ioserver/exec_test.go b/src/control/server/ioserver/exec_test.go index 7ba8e76f8e6..eb09edb4885 100644 --- a/src/control/server/ioserver/exec_test.go +++ b/src/control/server/ioserver/exec_test.go @@ -146,7 +146,9 @@ func TestRunnerNormalExit(t *testing.T) { WithHelperStreamCount(1). WithFabricInterface("qib0"). WithLogMask("DEBUG,MGMT=DEBUG,RPC=ERR,MEM=ERR"). - WithPinnedNumaNode(&numaNode) + WithPinnedNumaNode(&numaNode). + WithCrtCtxShareAddr(1). + WithCrtTimeout(30) runner := NewRunner(log, cfg) errOut := make(chan error) @@ -163,6 +165,8 @@ func TestRunnerNormalExit(t *testing.T) { wantArgs := "-t 42 -x 1 -p 1 -I 0" var gotArgs string env := []string{ + "CRT_CTX_SHARE_ADDR=1", + "CRT_TIMEOUT=30", "OFI_INTERFACE=qib0", "D_LOG_MASK=DEBUG,MGMT=DEBUG,RPC=ERR,MEM=ERR", } diff --git a/src/control/server/mgmt_svc.go b/src/control/server/mgmt_svc.go index 2a90289eed6..2dc10acf246 100644 --- a/src/control/server/mgmt_svc.go +++ b/src/control/server/mgmt_svc.go @@ -191,20 +191,26 @@ func getListenIPs(listenAddr *net.TCPAddr) (listenIPs []net.IP, err error) { // mgmtSvc implements (the Go portion of) Management Service, satisfying // mgmtpb.MgmtSvcServer. type mgmtSvc struct { - log logging.Logger - harness *IOServerHarness - membership *system.Membership // if MS leader, system membership list + log logging.Logger + harness *IOServerHarness + membership *system.Membership // if MS leader, system membership list + clientNetworkCfg *ClientNetworkCfg } -func newMgmtSvc(h *IOServerHarness, m *system.Membership) *mgmtSvc { +func newMgmtSvc(h *IOServerHarness, m *system.Membership, c *ClientNetworkCfg) *mgmtSvc { return &mgmtSvc{ - log: h.log, - harness: h, - membership: m, + log: h.log, + harness: h, + membership: m, + clientNetworkCfg: c, } } func (svc *mgmtSvc) GetAttachInfo(ctx context.Context, req *mgmtpb.GetAttachInfoReq) (*mgmtpb.GetAttachInfoResp, error) { + if svc.clientNetworkCfg == nil { + return nil, errors.New("clientNetworkCfg is missing") + } + mi, err := svc.harness.GetMSLeaderInstance() if err != nil { return nil, err @@ -220,6 +226,10 @@ func (svc *mgmtSvc) GetAttachInfo(ctx context.Context, req *mgmtpb.GetAttachInfo return nil, errors.Wrap(err, "unmarshal GetAttachInfo response") } + resp.Provider = svc.clientNetworkCfg.Provider + resp.CrtCtxShareAddr = svc.clientNetworkCfg.CrtCtxShareAddr + resp.CrtTimeout = svc.clientNetworkCfg.CrtTimeout + return resp, nil } diff --git a/src/control/server/mgmt_svc_test.go b/src/control/server/mgmt_svc_test.go index 5600bb49e30..4ec4ab30687 100644 --- a/src/control/server/mgmt_svc_test.go +++ b/src/control/server/mgmt_svc_test.go @@ -259,7 +259,7 @@ func TestMgmtSvc_PoolCreate(t *testing.T) { } harness.setStarted() - tc.mgmtSvc = newMgmtSvc(harness, nil) + tc.mgmtSvc = newMgmtSvc(harness, nil, nil) } tc.mgmtSvc.log = log @@ -381,7 +381,7 @@ func TestListPools_NoMS(t *testing.T) { h := NewIOServerHarness(log) h.setStarted() - svc := newMgmtSvc(h, nil) + svc := newMgmtSvc(h, nil, nil) resp, err := svc.ListPools(context.TODO(), newTestListPoolsReq()) @@ -464,7 +464,7 @@ func TestListCont_NoMS(t *testing.T) { log, buf := logging.NewTestLogger(t.Name()) defer common.ShowBufferOnFailure(t, buf) - svc := newMgmtSvc(NewIOServerHarness(log), nil) + svc := newMgmtSvc(NewIOServerHarness(log), nil, nil) resp, err := svc.ListContainers(context.TODO(), newTestListContReq()) @@ -570,7 +570,7 @@ func TestPoolGetACL_NoMS(t *testing.T) { log, buf := logging.NewTestLogger(t.Name()) defer common.ShowBufferOnFailure(t, buf) - svc := newMgmtSvc(NewIOServerHarness(log), nil) + svc := newMgmtSvc(NewIOServerHarness(log), nil, nil) resp, err := svc.PoolGetACL(context.TODO(), newTestGetACLReq()) @@ -654,7 +654,7 @@ func TestPoolOverwriteACL_NoMS(t *testing.T) { log, buf := logging.NewTestLogger(t.Name()) defer common.ShowBufferOnFailure(t, buf) - svc := newMgmtSvc(NewIOServerHarness(log), nil) + svc := newMgmtSvc(NewIOServerHarness(log), nil, nil) resp, err := svc.PoolOverwriteACL(context.TODO(), newTestModifyACLReq()) @@ -729,7 +729,7 @@ func TestPoolUpdateACL_NoMS(t *testing.T) { log, buf := logging.NewTestLogger(t.Name()) defer common.ShowBufferOnFailure(t, buf) - svc := newMgmtSvc(NewIOServerHarness(log), nil) + svc := newMgmtSvc(NewIOServerHarness(log), nil, nil) resp, err := svc.PoolUpdateACL(context.TODO(), newTestModifyACLReq()) @@ -811,7 +811,7 @@ func TestPoolDeleteACL_NoMS(t *testing.T) { log, buf := logging.NewTestLogger(t.Name()) defer common.ShowBufferOnFailure(t, buf) - svc := newMgmtSvc(NewIOServerHarness(log), nil) + svc := newMgmtSvc(NewIOServerHarness(log), nil, nil) resp, err := svc.PoolDeleteACL(context.TODO(), newTestDeleteACLReq()) @@ -904,7 +904,7 @@ func TestMgmtSvc_LeaderQuery(t *testing.T) { expErr: errors.New("wrong system"), }, "no i/o servers": { - mgmtSvc: newMgmtSvc(NewIOServerHarness(nil), nil), + mgmtSvc: newMgmtSvc(NewIOServerHarness(nil), nil, nil), req: &mgmtpb.LeaderQueryReq{}, expErr: errors.New("no I/O servers"), }, diff --git a/src/control/server/server.go b/src/control/server/server.go index 983092c6e0f..206d23d9060 100644 --- a/src/control/server/server.go +++ b/src/control/server/server.go @@ -262,7 +262,12 @@ func Start(log *logging.LeveledLogger, cfg *Configuration) error { grpcServer := grpc.NewServer(opts...) ctlpb.RegisterMgmtCtlServer(grpcServer, controlService) - mgmtpb.RegisterMgmtSvcServer(grpcServer, newMgmtSvc(harness, membership)) + clientNetworkCfg := ClientNetworkCfg{ + Provider: cfg.Fabric.Provider, + CrtCtxShareAddr: cfg.Fabric.CrtCtxShareAddr, + CrtTimeout: cfg.Fabric.CrtTimeout, + } + mgmtpb.RegisterMgmtSvcServer(grpcServer, newMgmtSvc(harness, membership, &clientNetworkCfg)) go func() { _ = grpcServer.Serve(lis) diff --git a/src/control/server/test_utils.go b/src/control/server/test_utils.go index 0759a9254cf..a21a63c96bf 100644 --- a/src/control/server/test_utils.go +++ b/src/control/server/test_utils.go @@ -141,7 +141,7 @@ func newTestMgmtSvc(log logging.Logger) *mgmtSvc { } harness.setStarted() - return newMgmtSvc(harness, nil) + return newMgmtSvc(harness, nil, nil) } // newTestMgmtSvcMulti creates a mgmtSvc that contains the requested @@ -158,5 +158,5 @@ func newTestMgmtSvcMulti(log logging.Logger, count int, isAP bool) *mgmtSvc { } } - return newMgmtSvc(harness, nil) + return newMgmtSvc(harness, nil, nil) } diff --git a/src/include/daos/mgmt.h b/src/include/daos/mgmt.h index 48972e55a48..18324ef10ff 100644 --- a/src/include/daos/mgmt.h +++ b/src/include/daos/mgmt.h @@ -1,5 +1,5 @@ /** - * (C) Copyright 2016 Intel Corporation. + * (C) Copyright 2016-2020 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,15 @@ int dc_mgmt_list_pools(tse_task_t *task); int dc_mgmt_profile(uint64_t modules, char *path, int avg, bool start); int dc_mgmt_add_mark(const char *mark); +/** GetAttachInfo system info */ +struct sys_info { + char provider[DAOS_SYS_INFO_STRING_MAX + 1]; + char interface[DAOS_SYS_INFO_STRING_MAX + 1]; + char domain[DAOS_SYS_INFO_STRING_MAX + 1]; + uint32_t crt_ctx_share_addr; + uint32_t crt_timeout; +}; + /** Client system handle */ struct dc_mgmt_sys { d_list_t sy_link; @@ -54,6 +63,7 @@ struct dc_mgmt_sys { int sy_npsrs; struct dc_mgmt_psr *sy_psrs; crt_group_t *sy_group; + struct sys_info sy_info; }; int dc_mgmt_sys_attach(const char *name, struct dc_mgmt_sys **sysp); diff --git a/src/include/daos_types.h b/src/include/daos_types.h index 3013abfc23a..46b42002db2 100644 --- a/src/include/daos_types.h +++ b/src/include/daos_types.h @@ -52,6 +52,9 @@ extern "C" { /** Maximum length (excluding the '\0') of a DAOS system name */ #define DAOS_SYS_NAME_MAX 15 +/** Maximum length (excluding the '\0') of info string info via GetAttachInfo */ +#define DAOS_SYS_INFO_STRING_MAX 63 + /** * Generic data type definition */ diff --git a/src/iosrv/srv.pb-c.h b/src/iosrv/srv.pb-c.h index befd82dfc01..19ccde0ac11 100644 --- a/src/iosrv/srv.pb-c.h +++ b/src/iosrv/srv.pb-c.h @@ -10,7 +10,7 @@ PROTOBUF_C__BEGIN_DECLS #if PROTOBUF_C_VERSION_NUMBER < 1003000 # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. -#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif diff --git a/src/mgmt/cli_mgmt.c b/src/mgmt/cli_mgmt.c index 82274a85f7a..b1e2d6d5257 100644 --- a/src/mgmt/cli_mgmt.c +++ b/src/mgmt/cli_mgmt.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2016-2019 Intel Corporation. + * (C) Copyright 2016-2020 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -275,7 +275,8 @@ struct dc_mgmt_psr { * Callers are responsible for freeing psrs using put_attach_info. */ static int -get_attach_info(const char *name, int *npsrs, struct dc_mgmt_psr **psrs) +get_attach_info(const char *name, int *npsrs, struct dc_mgmt_psr **psrs, + struct sys_info *sy_info) { struct drpc *ctx; Mgmt__GetAttachInfoReq req = MGMT__GET_ATTACH_INFO_REQ__INIT; @@ -287,6 +288,7 @@ get_attach_info(const char *name, int *npsrs, struct dc_mgmt_psr **psrs) struct dc_mgmt_psr *p; int i; int rc; + int size; D_DEBUG(DB_MGMT, "getting attach info for %s\n", name); @@ -367,6 +369,37 @@ get_attach_info(const char *name, int *npsrs, struct dc_mgmt_psr **psrs) *npsrs = resp->n_psrs; *psrs = p; + if (sy_info) { + size = sizeof(sy_info->provider); + if (strnlen(resp->provider, size) == size) { + D_ERROR("GetAttachInfo provider string too long\n"); + D_GOTO(out_resp, rc = -DER_INVAL); + } + strncpy(sy_info->provider, resp->provider, size); + + size = sizeof(sy_info->interface); + if (strnlen(resp->interface, size) == size) { + D_ERROR("GetAttachInfo interface string too long\n"); + D_GOTO(out_resp, rc = -DER_INVAL); + } + strncpy(sy_info->interface, resp->interface, size); + + size = sizeof(sy_info->domain); + if (strnlen(resp->domain, size) == size) { + D_ERROR("GetAttachInfo domain string too long\n"); + D_GOTO(out_resp, rc = -DER_INVAL); + } + strncpy(sy_info->domain, resp->domain, size); + + sy_info->crt_ctx_share_addr = resp->crtctxshareaddr; + sy_info->crt_timeout = resp->crttimeout; + D_DEBUG(DB_MGMT, + "GetAttachInfo Provider: %s, Interface: %s, Domain: %s," + "CRT_CTX_SHARE_ADDR: %u, CRT_TIMEOUT: %u\n", + sy_info->provider, sy_info->interface, sy_info->domain, + sy_info->crt_ctx_share_addr, sy_info->crt_timeout); + } + out_resp: mgmt__get_attach_info_resp__free_unpacked(resp, NULL); out_dresp: @@ -524,7 +557,8 @@ attach(const char *name, int npsrbs, struct psr_buf *psrbs, } if (psrbs == NULL) - rc = get_attach_info(name, &sys->sy_npsrs, &sys->sy_psrs); + rc = get_attach_info(name, &sys->sy_npsrs, &sys->sy_psrs, + &sys->sy_info); else rc = get_attach_info_from_buf(npsrbs, psrbs, &sys->sy_npsrs, &sys->sy_psrs); diff --git a/src/mgmt/srv.pb-c.c b/src/mgmt/srv.pb-c.c index 797652030ac..8672cac550b 100644 --- a/src/mgmt/srv.pb-c.c +++ b/src/mgmt/srv.pb-c.c @@ -906,7 +906,7 @@ const ProtobufCMessageDescriptor mgmt__get_attach_info_resp__psr__descriptor = (ProtobufCMessageInit) mgmt__get_attach_info_resp__psr__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__get_attach_info_resp__field_descriptors[2] = +static const ProtobufCFieldDescriptor mgmt__get_attach_info_resp__field_descriptors[7] = { { "status", @@ -932,15 +932,80 @@ static const ProtobufCFieldDescriptor mgmt__get_attach_info_resp__field_descript 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "Provider", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Mgmt__GetAttachInfoResp, provider), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Interface", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Mgmt__GetAttachInfoResp, interface), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Domain", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Mgmt__GetAttachInfoResp, domain), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "CrtCtxShareAddr", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__GetAttachInfoResp, crtctxshareaddr), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "CrtTimeout", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__GetAttachInfoResp, crttimeout), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__get_attach_info_resp__field_indices_by_name[] = { + 5, /* field[5] = CrtCtxShareAddr */ + 6, /* field[6] = CrtTimeout */ + 4, /* field[4] = Domain */ + 3, /* field[3] = Interface */ + 2, /* field[2] = Provider */ 1, /* field[1] = psrs */ 0, /* field[0] = status */ }; static const ProtobufCIntRange mgmt__get_attach_info_resp__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 7 } }; const ProtobufCMessageDescriptor mgmt__get_attach_info_resp__descriptor = { @@ -950,7 +1015,7 @@ const ProtobufCMessageDescriptor mgmt__get_attach_info_resp__descriptor = "Mgmt__GetAttachInfoResp", "mgmt", sizeof(Mgmt__GetAttachInfoResp), - 2, + 7, mgmt__get_attach_info_resp__field_descriptors, mgmt__get_attach_info_resp__field_indices_by_name, 1, mgmt__get_attach_info_resp__number_ranges, diff --git a/src/mgmt/srv.pb-c.h b/src/mgmt/srv.pb-c.h index 3095b1f0256..24c8942da48 100644 --- a/src/mgmt/srv.pb-c.h +++ b/src/mgmt/srv.pb-c.h @@ -10,7 +10,7 @@ PROTOBUF_C__BEGIN_DECLS #if PROTOBUF_C_VERSION_NUMBER < 1003000 # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. -#elif 1003001 < PROTOBUF_C_MIN_COMPILER_VERSION +#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif @@ -172,10 +172,34 @@ struct _Mgmt__GetAttachInfoResp */ size_t n_psrs; Mgmt__GetAttachInfoResp__Psr **psrs; + /* + * These CaRT settings are shared with the + * libdaos client to aid in CaRT initialization. + */ + /* + * CaRT OFI provider + */ + char *provider; + /* + * CaRT OFI_INTERFACE + */ + char *interface; + /* + * CaRT OFI_DOMAIN for given OFI_INTERFACE + */ + char *domain; + /* + * CaRT CRT_CTX_SHARE_ADDR + */ + uint32_t crtctxshareaddr; + /* + * CaRT CRT_TIMEOUT + */ + uint32_t crttimeout; }; #define MGMT__GET_ATTACH_INFO_RESP__INIT \ { PROTOBUF_C_MESSAGE_INIT (&mgmt__get_attach_info_resp__descriptor) \ - , 0, 0,NULL } + , 0, 0,NULL, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, 0 } struct _Mgmt__PrepShutdownReq diff --git a/src/pool/cli.c b/src/pool/cli.c index ef18a87fcbb..c939901989d 100644 --- a/src/pool/cli.c +++ b/src/pool/cli.c @@ -511,6 +511,14 @@ dc_pool_connect(tse_task_t *task) rc = dc_mgmt_sys_attach(args->grp, &pool->dp_sys); if (rc != 0) D_GOTO(out_pool, rc); + + /** Agent configuration data from pool->dp_sys->sy_info */ + /** sy_info.provider */ + /** sy_info.interface */ + /** sy_info.domain */ + /** sy_info.crt_ctx_share_addr */ + /** sy_info.crt_timeout */ + rc = rsvc_client_init(&pool->dp_client, args->svc); if (rc != 0) D_GOTO(out_pool, rc); diff --git a/src/proto/mgmt/srv.proto b/src/proto/mgmt/srv.proto index d9e827df596..6e889d78985 100644 --- a/src/proto/mgmt/srv.proto +++ b/src/proto/mgmt/srv.proto @@ -1,5 +1,5 @@ // -// (C) Copyright 2018-2019 Intel Corporation. +// (C) Copyright 2018-2020 Intel Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -70,6 +70,13 @@ message GetAttachInfoResp { string uri = 2; } repeated Psr psrs = 2; // CaRT PSRs of the system group. + // These CaRT settings are shared with the + // libdaos client to aid in CaRT initialization. + string Provider = 3; // CaRT OFI provider + string Interface = 4; // CaRT OFI_INTERFACE + string Domain = 5; // CaRT OFI_DOMAIN for given OFI_INTERFACE + uint32 CrtCtxShareAddr = 6; // CaRT CRT_CTX_SHARE_ADDR + uint32 CrtTimeout = 7; // CaRT CRT_TIMEOUT } message PrepShutdownReq { diff --git a/utils/config/daos_server.yml b/utils/config/daos_server.yml index c5c5d711a42..0641e0e0240 100644 --- a/utils/config/daos_server.yml +++ b/utils/config/daos_server.yml @@ -75,6 +75,13 @@ #provider: ofi+verbs;ofi_rxm # # +## global CRT_CTX_SHARE_ADDR shared with client +#crt_ctx_share_addr: 1 +# +# +## global CRT_TIMEOUT shared with client +#crt_timeout: 30 +# # ## NVMe SSD whitelist # From c416d77780ecfbaa89851c1b10e0fe9d0b731e57 Mon Sep 17 00:00:00 2001 From: Michael MacDonald Date: Wed, 1 Apr 2020 14:53:40 -0400 Subject: [PATCH 05/10] DAOS-2881 control: Print correct caller info in logging.Debugf() (#2271) Use the runtime package to inspect the call stack and adjust for any Debug() or Debugf() wrappers. Ensures that the correct caller info is logged. Signed-off-by: Michael MacDonald --- src/control/logging/debug.go | 25 +++++++-- src/control/logging/logging_test.go | 80 +++++++++++++++++++++++++++-- 2 files changed, 96 insertions(+), 9 deletions(-) diff --git a/src/control/logging/debug.go b/src/control/logging/debug.go index e99d787b7d1..521fb5e9925 100644 --- a/src/control/logging/debug.go +++ b/src/control/logging/debug.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019 Intel Corporation. +// (C) Copyright 2019-2020 Intel Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,8 @@ import ( "io" "log" "os" + "runtime" + "strings" ) const debugLogFlags = log.Lmicroseconds | log.Lshortfile @@ -50,9 +52,24 @@ type DefaultDebugLogger struct { // Debugf emits a formatted debug message. func (l *DefaultDebugLogger) Debugf(format string, args ...interface{}) { depth := logOutputDepth - if len(args) == 0 { - // Adjust for the extra call to Debug() - depth += 1 + + // Adjust depth to account for any convenience wrappers. Enables + // printing of correct caller info. + pc := make([]uintptr, depth+5) + n := runtime.Callers(depth, pc) + if n > 0 { + pc = pc[:n] + frames := runtime.CallersFrames(pc) + for { + frame, more := frames.Next() + if !more { + break + } + fnName := frame.Function[strings.LastIndex(frame.Function, ".")+1:] + if fnName == "Debug" || fnName == "Debugf" { + depth++ + } + } } out := fmt.Sprintf(format, args...) diff --git a/src/control/logging/logging_test.go b/src/control/logging/logging_test.go index e7558dc461a..d818cc8aa5d 100644 --- a/src/control/logging/logging_test.go +++ b/src/control/logging/logging_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019 Intel Corporation. +// (C) Copyright 2019-2020 Intel Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,13 +24,83 @@ package logging_test import ( "bytes" + "fmt" "regexp" + "runtime" + "strings" "testing" "github.com/daos-stack/daos/src/control/logging" ) -func TestStandardFormat(t *testing.T) { +type testWrap struct { + log logging.Logger +} + +func (tw *testWrap) Debug(msg string) { + tw.log.Debug(msg) +} + +func (tw *testWrap) Debugf(fmtStr string, args ...interface{}) { + tw.log.Debugf(fmtStr, args...) +} + +func getLineNumber(t *testing.T) int { + pc := make([]uintptr, 2) + n := runtime.Callers(2, pc) + if n > 0 { + pc = pc[:n] + frames := runtime.CallersFrames(pc) + for { + frame, _ := frames.Next() + return frame.Line + } + } + + t.Fatal("failed to get test line number") + return 0 +} + +func TestLogging_DebugOutputDepth(t *testing.T) { + log, buf := logging.NewTestLogger(t.Name()) + + // not a perfect diff, but good enough for this test + cmpOut := func(t *testing.T, want, got string) { + if !strings.Contains(got, want) { + t.Fatalf("incorrect caller info (-want, +got):\n-%s\n+%s\n", want, got) + } + } + + line := getLineNumber(t) + 1 + log.Debug("test 1") + wanted := fmt.Sprintf("logging_test.go:%d: test 1", line) + cmpOut(t, wanted, buf.String()) + buf.Reset() + + line = getLineNumber(t) + 1 + log.Debugf("test 2") + wanted = fmt.Sprintf("logging_test.go:%d: test 2", line) + cmpOut(t, wanted, buf.String()) + buf.Reset() + + tw := &testWrap{ + log: log, + } + + line = getLineNumber(t) + 1 + tw.Debug("test 3") + wanted = fmt.Sprintf("logging_test.go:%d: test 3", line) + cmpOut(t, wanted, buf.String()) + buf.Reset() + + line = getLineNumber(t) + 1 + tw.Debugf("test 4") + wanted = fmt.Sprintf("logging_test.go:%d: test 4", line) + cmpOut(t, wanted, buf.String()) + buf.Reset() +} + +func TestLogging_StandardFormat(t *testing.T) { logger, buf := logging.NewTestLogger("testPrefix") tests := map[string]struct { @@ -74,7 +144,7 @@ func TestStandardFormat(t *testing.T) { } } -func TestJSONFormat(t *testing.T) { +func TestLogging_JSONFormat(t *testing.T) { var buf bytes.Buffer logger := logging.NewCombinedLogger("testPrefix", &buf). @@ -122,7 +192,7 @@ func TestJSONFormat(t *testing.T) { } } -func TestMultipleFormats(t *testing.T) { +func TestLogging_MultipleFormats(t *testing.T) { var stdBuf bytes.Buffer var jsonBuf bytes.Buffer @@ -195,7 +265,7 @@ func TestMultipleFormats(t *testing.T) { } } -func TestLogLevels(t *testing.T) { +func TestLogging_LogLevels(t *testing.T) { var buf bytes.Buffer logger := logging.NewCombinedLogger("testPrefix", &buf) From 11bc5e34fddf298f83b3879e2c1367a28fa40705 Mon Sep 17 00:00:00 2001 From: Michael MacDonald Date: Wed, 1 Apr 2020 16:48:32 -0400 Subject: [PATCH 06/10] DAOS-3835 control: Convert DAOS err codes to strings (#2259) Use the d_errstr() function in libgurt to provide somewhat-more comprehensible error messages to control API callers. Uses a server-side gRPC interceptor to handle the conversion before sending the response. Updates drpc.DaosStatus to conform to the Error interface by returning a string using d_errstr(). Signed-off-by: Michael MacDonald --- src/control/SConscript | 4 + src/control/drpc/status.go | 131 +++++++++++++----------- src/control/drpc/status_test.go | 56 ++++++++++ src/control/server/interceptors.go | 29 ++++++ src/control/server/interceptors_test.go | 83 +++++++++++++++ src/control/server/server.go | 1 + 6 files changed, 246 insertions(+), 58 deletions(-) create mode 100644 src/control/drpc/status_test.go create mode 100644 src/control/server/interceptors_test.go diff --git a/src/control/SConscript b/src/control/SConscript index 348d8351609..78ae98887bb 100644 --- a/src/control/SConscript +++ b/src/control/SConscript @@ -140,6 +140,8 @@ def scons(): gosrc = Dir('.').srcnode().abspath cartpath = Dir('#/src/cart/src/include').srcnode().abspath + denv.AppendENVPath("CGO_LDFLAGS", + denv.subst("-L$BUILD_DIR/src/cart/src/gurt")) denv.AppendENVPath("CGO_CFLAGS", "-I%s" % cartpath, sep=" ") agentbin = install_go_bin(denv, gosrc, None, "agent", "daos_agent") @@ -154,6 +156,8 @@ def scons(): prereqs.require(senv, 'pmdk', 'spdk', 'ofi', 'hwloc') cgolibdirs = senv.subst("-L$BUILD_DIR/src/control/lib/spdk " + "-L$BUILD_DIR/src/cart/src/gurt " + "-L$BUILD_DIR/src/cart/src/cart " "-L$PREFIX/lib64 -L$SPDK_PREFIX/lib " "-L$HWLOC_PREFIX/lib -L$OFI_PREFIX/lib " "-L$ISAL_PREFIX/lib $_RPATH") diff --git a/src/control/drpc/status.go b/src/control/drpc/status.go index f88af5f432e..e250bdc2e23 100644 --- a/src/control/drpc/status.go +++ b/src/control/drpc/status.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019 Intel Corporation. +// (C) Copyright 2019-2020 Intel Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,130 +25,145 @@ package drpc -// #include +import "fmt" + +/* +#cgo LDFLAGS: -lgurt + +#include +*/ import "C" // DaosStatus is a status code in the set defined by the DAOS data plane. type DaosStatus int32 +func (ds DaosStatus) Error() string { + // NB: Currently, d_errstr() just returns a string of the status + // name, e.g. -1007 -> "DER_NOSPACE". This is better than nothing, + // but hopefully d_errstr() will be extended to provide better strings + // similar to perror(). + dErrStr := C.GoString(C.d_errstr(C.int(ds))) + return fmt.Sprintf("DAOS error (%d): %s", ds, dErrStr) +} + const ( // DaosSuccess indicates no error DaosSuccess DaosStatus = 0 // DaosNoPermission indicates that access to a resource was denied - DaosNoPermission = -C.DER_NO_PERM + DaosNoPermission DaosStatus = -C.DER_NO_PERM // DaosNoHandle indicates the handle was invalid - DaosNoHandle = -C.DER_NO_HDL + DaosNoHandle DaosStatus = -C.DER_NO_HDL // DaosInvalidInput indicates an input was invalid - DaosInvalidInput = -C.DER_INVAL + DaosInvalidInput DaosStatus = -C.DER_INVAL // DaosExists indicates the entity already exists - DaosExists = -C.DER_EXIST + DaosExists DaosStatus = -C.DER_EXIST // DaosNonexistant indicates the entity does not exist - DaosNonexistant = -C.DER_NONEXIST + DaosNonexistant DaosStatus = -C.DER_NONEXIST // DaosUnreachable indicates a node was unreachable - DaosUnreachable = -C.DER_UNREACH + DaosUnreachable DaosStatus = -C.DER_UNREACH // DaosNoSpace indicates there was not enough storage space - DaosNoSpace = -C.DER_NOSPACE + DaosNoSpace DaosStatus = -C.DER_NOSPACE // DaosAlready indicates the operation was already done - DaosAlready = -C.DER_ALREADY + DaosAlready DaosStatus = -C.DER_ALREADY // DaosNoMemory indicates the system ran out of memory - DaosNoMemory = -C.DER_NOMEM + DaosNoMemory DaosStatus = -C.DER_NOMEM // DaosNotImpl indicates the requested functionality is not implemented - DaosNotImpl = -C.DER_NOSYS + DaosNotImpl DaosStatus = -C.DER_NOSYS // DaosTimedOut indicates the operation timed out - DaosTimedOut = -C.DER_TIMEDOUT + DaosTimedOut DaosStatus = -C.DER_TIMEDOUT // DaosBusy indicates the system was busy and didn't process the request - DaosBusy = -C.DER_BUSY + DaosBusy DaosStatus = -C.DER_BUSY // DaosTryAgain indicates the operation failed, but should be tried again - DaosTryAgain = -C.DER_AGAIN + DaosTryAgain DaosStatus = -C.DER_AGAIN // DaosProtocolError indicates incompatibility in communications protocols - DaosProtocolError = -C.DER_PROTO + DaosProtocolError DaosStatus = -C.DER_PROTO // DaosNotInit indicates something in the system wasn't initialized - DaosNotInit = -C.DER_UNINIT + DaosNotInit DaosStatus = -C.DER_UNINIT // DaosBufTooSmall indicates a provided buffer was too small - DaosBufTooSmall = -C.DER_TRUNC + DaosBufTooSmall DaosStatus = -C.DER_TRUNC // DaosStructTooSmall indicates data could not fit in the provided structure - DaosStructTooSmall = -C.DER_OVERFLOW + DaosStructTooSmall DaosStatus = -C.DER_OVERFLOW // DaosCanceled indicates the operation was canceled - DaosCanceled = -C.DER_CANCELED + DaosCanceled DaosStatus = -C.DER_CANCELED // DaosOutOfGroup indicates that a rank wasn't found in the group - DaosOutOfGroup = -C.DER_OOG + DaosOutOfGroup DaosStatus = -C.DER_OOG // DaosMercuryError indicates that there was an error in the Mercury transport layer - DaosMercuryError = -C.DER_HG + DaosMercuryError DaosStatus = -C.DER_HG // DaosUnregistered indicates that a requested RPC was not registered - DaosUnregistered = -C.DER_UNREG + DaosUnregistered DaosStatus = -C.DER_UNREG // DaosAddrStringFailed indicates that an address string couldn't be generated - DaosAddrStringFailed = -C.DER_ADDRSTR_GEN + DaosAddrStringFailed DaosStatus = -C.DER_ADDRSTR_GEN // DaosPMIXError indicates an error in the PMIX layer - DaosPMIXError = -C.DER_PMIX + DaosPMIXError DaosStatus = -C.DER_PMIX // DaosIVCallback indicates that the IV callback cannot be handled locally - DaosIVCallback = -C.DER_IVCB_FORWARD + DaosIVCallback DaosStatus = -C.DER_IVCB_FORWARD // DaosMiscError indicates an unspecified error - DaosMiscError = -C.DER_MISC + DaosMiscError DaosStatus = -C.DER_MISC // DaosBadPath indicates that a bad file or directory path was provided - DaosBadPath = -C.DER_BADPATH + DaosBadPath DaosStatus = -C.DER_BADPATH // DaosNotDir indicates that the path is not to a directory - DaosNotDir = -C.DER_NOTDIR + DaosNotDir DaosStatus = -C.DER_NOTDIR // DaosCorpcIncomplete indicates that corpc failed - DaosCorpcIncomplete = -C.DER_CORPC_INCOMPLETE + DaosCorpcIncomplete DaosStatus = -C.DER_CORPC_INCOMPLETE // DaosNoRASRank indicates that no rank is subscribed to RAS - DaosNoRASRank = -C.DER_NO_RAS_RANK + DaosNoRASRank DaosStatus = -C.DER_NO_RAS_RANK // DaosNotAttached indicates that a service group is not attached - DaosNotAttached = -C.DER_NOTATTACH + DaosNotAttached DaosStatus = -C.DER_NOTATTACH // DaosMismatch indicates a version mismatch - DaosMismatch = -C.DER_MISMATCH + DaosMismatch DaosStatus = -C.DER_MISMATCH // DaosEvicted indicates that the rank was evicted - DaosEvicted = -C.DER_EVICTED + DaosEvicted DaosStatus = -C.DER_EVICTED // DaosNoReply indicates that there was no reply to an RPC - DaosNoReply = -C.DER_NOREPLY + DaosNoReply DaosStatus = -C.DER_NOREPLY // DaosDenialOfService indicates that there was a denial of service - DaosDenialOfService = -C.DER_DOS + DaosDenialOfService DaosStatus = -C.DER_DOS // DaosBadTarget indicates that the target was wrong for the RPC - DaosBadTarget = -C.DER_BAD_TARGET + DaosBadTarget DaosStatus = -C.DER_BAD_TARGET // DaosGroupVersionMismatch indicates that group versions didn't match - DaosGroupVersionMismatch = -C.DER_GRPVER + DaosGroupVersionMismatch DaosStatus = -C.DER_GRPVER ) const ( // DaosIOError indicates a generic IO error DaosIOError DaosStatus = -C.DER_IO // DaosFreeMemError indicates an error freeing memory - DaosFreeMemError = -C.DER_FREE_MEM + DaosFreeMemError DaosStatus = -C.DER_FREE_MEM // DaosNoEntry indicates that the entry was not found - DaosNoEntry = -C.DER_ENOENT + DaosNoEntry DaosStatus = -C.DER_ENOENT // DaosUnknownType indicates that the entity type was unknown - DaosUnknownType = -C.DER_NOTYPE + DaosUnknownType DaosStatus = -C.DER_NOTYPE // DaosUnknownSchema indicates that the entity schema was unknown - DaosUnknownSchema = -C.DER_NOSCHEMA + DaosUnknownSchema DaosStatus = -C.DER_NOSCHEMA // DaosNotLocal indicates that the entity was not local - DaosNotLocal = -C.DER_NOLOCAL + DaosNotLocal DaosStatus = -C.DER_NOLOCAL // DaosStale indicates that a resource was stale - DaosStale = -C.DER_STALE + DaosStale DaosStatus = -C.DER_STALE // DaosNotLeader indicates that the replica is not the service leader - DaosNotLeader = -C.DER_NOTLEADER + DaosNotLeader DaosStatus = -C.DER_NOTLEADER // DaosTargetCreateError indicates that target creation failed - DaosTargetCreateError = -C.DER_TGT_CREATE + DaosTargetCreateError DaosStatus = -C.DER_TGT_CREATE // DaosEpochReadOnly indicates that the epoch couldn't be modified - DaosEpochReadOnly = -C.DER_EP_RO + DaosEpochReadOnly DaosStatus = -C.DER_EP_RO // DaosEpochRecycled indicates that the epoch was recycled due to age - DaosEpochRecycled = -C.DER_EP_OLD + DaosEpochRecycled DaosStatus = -C.DER_EP_OLD // DaosKeyTooBig indicates that the key is too big - DaosKeyTooBig = -C.DER_KEY2BIG + DaosKeyTooBig DaosStatus = -C.DER_KEY2BIG // DaosRecordTooBig indicates that the record is too big - DaosRecordTooBig = -C.DER_REC2BIG + DaosRecordTooBig DaosStatus = -C.DER_REC2BIG // DaosIOInvalid indicates a mismatch between IO buffers and object extents - DaosIOInvalid = -C.DER_IO_INVAL + DaosIOInvalid DaosStatus = -C.DER_IO_INVAL // DaosEventQueueBusy indicates that the event queue is busy - DaosEventQueueBusy = -C.DER_EQ_BUSY + DaosEventQueueBusy DaosStatus = -C.DER_EQ_BUSY // DaosDomainMismatch indicates that there was a mismatch of domains in cluster components - DaosDomainMismatch = -C.DER_DOMAIN + DaosDomainMismatch DaosStatus = -C.DER_DOMAIN // DaosShutdown indicates that the service should shut down - DaosShutdown = -C.DER_SHUTDOWN + DaosShutdown DaosStatus = -C.DER_SHUTDOWN // DaosInProgress indicates that the operation is in progress - DaosInProgress = -C.DER_INPROGRESS + DaosInProgress DaosStatus = -C.DER_INPROGRESS // DaosNotApplicable indicates that the operation is not applicable - DaosNotApplicable = -C.DER_NOTAPPLICABLE + DaosNotApplicable DaosStatus = -C.DER_NOTAPPLICABLE // DaosNotReplica indicates that the requested component is not a service replica - DaosNotReplica = -C.DER_NOTREPLICA + DaosNotReplica DaosStatus = -C.DER_NOTREPLICA // DaosChecksumError indicates a checksum error - DaosChecksumError = -C.DER_CSUM + DaosChecksumError DaosStatus = -C.DER_CSUM ) diff --git a/src/control/drpc/status_test.go b/src/control/drpc/status_test.go new file mode 100644 index 00000000000..91a234c8018 --- /dev/null +++ b/src/control/drpc/status_test.go @@ -0,0 +1,56 @@ +// +// (C) Copyright 2020 Intel Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE +// The Government's rights to use, modify, reproduce, release, perform, display, +// or disclose this software are subject to the terms of the Apache License as +// provided in Contract No. 8F-30005. +// Any reproduction of computer software, computer software documentation, or +// portions thereof marked with this legend must also reproduce the markings. +// +package drpc_test + +import ( + "testing" + + "github.com/pkg/errors" + + "github.com/daos-stack/daos/src/control/common" + "github.com/daos-stack/daos/src/control/drpc" +) + +func TestDrpc_Status(t *testing.T) { + for name, tc := range map[string]struct { + in int32 + expErr error + }{ + "rc 0": { + expErr: drpc.DaosSuccess, + }, + "-1007": { + in: -1007, + expErr: drpc.DaosNoSpace, + }, + "-424242": { + in: -424242, + expErr: errors.New("DER_UNKNOWN"), + }, + } { + t.Run(name, func(t *testing.T) { + ds := drpc.DaosStatus(tc.in) + common.CmpErr(t, tc.expErr, ds) + }) + } +} diff --git a/src/control/server/interceptors.go b/src/control/server/interceptors.go index d3c6e4c2554..44a9e367de3 100644 --- a/src/control/server/interceptors.go +++ b/src/control/server/interceptors.go @@ -35,6 +35,7 @@ import ( "google.golang.org/grpc/status" "github.com/daos-stack/daos/src/control/common/proto" + "github.com/daos-stack/daos/src/control/drpc" "github.com/daos-stack/daos/src/control/security" ) @@ -133,3 +134,31 @@ func streamErrorInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.St err := handler(srv, ss) return proto.AnnotateError(err) } + +type statusGetter interface { + GetStatus() int32 +} + +// dErrFromStatus converts a numeric DAOS return status code +// into an error. +func dErrFromStatus(sg statusGetter) error { + dStatus := sg.GetStatus() + if dStatus == 0 { + return nil + } + + return drpc.DaosStatus(dStatus) +} + +func unaryStatusInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + res, err := handler(ctx, req) + if err != nil { + return res, err + } + + if sg, ok := res.(statusGetter); ok { + return res, dErrFromStatus(sg) + } + + return res, err +} diff --git a/src/control/server/interceptors_test.go b/src/control/server/interceptors_test.go new file mode 100644 index 00000000000..627c48ee672 --- /dev/null +++ b/src/control/server/interceptors_test.go @@ -0,0 +1,83 @@ +// +// (C) Copyright 2020 Intel Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE +// The Government's rights to use, modify, reproduce, release, perform, display, +// or disclose this software are subject to the terms of the Apache License as +// provided in Contract No. 8F-30005. +// Any reproduction of computer software, computer software documentation, or +// portions thereof marked with this legend must also reproduce the markings. +// + +package server + +import ( + "context" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + + "github.com/daos-stack/daos/src/control/common" + "github.com/daos-stack/daos/src/control/drpc" +) + +type testStatus struct { + Status int32 +} + +func (ts *testStatus) GetStatus() int32 { + return ts.Status +} + +func TestServer_unaryStatusInterceptor(t *testing.T) { + for name, tc := range map[string]struct { + handlerResp interface{} + handlerErr error + expErr error + }{ + "handler error": { + handlerErr: errors.New("whoops"), + expErr: errors.New("whoops"), + }, + "DAOS status 0": { + handlerResp: &testStatus{}, + }, + "DAOS status -1005": { + handlerResp: &testStatus{ + Status: -1005, + }, + expErr: drpc.DaosNonexistant, + }, + "non-status resp": { + handlerResp: 42, + }, + } { + t.Run(name, func(t *testing.T) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return tc.handlerResp, tc.handlerErr + } + gotResp, gotErr := unaryStatusInterceptor(context.TODO(), nil, nil, handler) + common.CmpErr(t, tc.expErr, gotErr) + if tc.expErr != nil { + return + } + + if diff := cmp.Diff(tc.handlerResp, gotResp); diff != "" { + t.Fatalf("unexpected response (-want, +got):\n%s\n", diff) + } + }) + } +} diff --git a/src/control/server/server.go b/src/control/server/server.go index 206d23d9060..2c06c161445 100644 --- a/src/control/server/server.go +++ b/src/control/server/server.go @@ -230,6 +230,7 @@ func Start(log *logging.LeveledLogger, cfg *Configuration) error { // Create new grpc server, register services and start serving. unaryInterceptors := []grpc.UnaryServerInterceptor{ unaryErrorInterceptor, + unaryStatusInterceptor, } streamInterceptors := []grpc.StreamServerInterceptor{ streamErrorInterceptor, From f0f3c58f8555fa6ce43bcce49617455fbb5f4020 Mon Sep 17 00:00:00 2001 From: Nasf-Fan Date: Thu, 2 Apr 2020 10:30:13 +0800 Subject: [PATCH 07/10] DAOS-4406 vos: check PMDK TX operation result (#2237) In current implementation, sometimes we may inogre some simple PMDK TX oepration result. It is dangerous under some special cases, such as the server is out of memory or space. Under such cases, the PMDK TX operation may fail and related PMDK TX will be aborted silently. If we do not check the return value and continuously use such PMDK TX handle for subsequent PMDK TX operation, then it will cause PMDK assertion. Signed-off-by: Fan Yong --- src/vos/evtree.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/vos/evtree.c b/src/vos/evtree.c index 7febef361eb..47152dfefb7 100644 --- a/src/vos/evtree.c +++ b/src/vos/evtree.c @@ -1138,7 +1138,7 @@ evt_node_tx_add(struct evt_context *tcx, struct evt_node *nd) return umem_tx_add_ptr(evt_umm(tcx), nd, evt_node_size(tcx)); } -static int +static inline int evt_node_free(struct evt_context *tcx, umem_off_t nd_off) { return umem_free(evt_umm(tcx), nd_off); @@ -1210,11 +1210,12 @@ evt_node_destroy(struct evt_context *tcx, umem_off_t nd_off, int level, if (empty) { rc = evt_node_free(tcx, nd_off); } else { - evt_node_tx_add(tcx, nd); - nd->tn_nr = i; + rc = evt_node_tx_add(tcx, nd); + if (rc == 0) + nd->tn_nr = i; } - if (empty_ret) + if (rc == 0 && empty_ret) *empty_ret = empty; out: return rc; @@ -1461,7 +1462,7 @@ static int evt_root_destroy(struct evt_context *tcx, bool *destroyed) { struct evt_root *root; - int rc; + int rc = 0; bool empty = true; root = tcx->tc_root; @@ -1474,9 +1475,9 @@ evt_root_destroy(struct evt_context *tcx, bool *destroyed) *destroyed = empty; if (empty) - evt_root_free(tcx); + rc = evt_root_free(tcx); - return 0; + return rc; } static int64_t @@ -2865,10 +2866,8 @@ evt_node_delete(struct evt_context *tcx) if (node->tn_nr == 1) { /* this node can be removed so bubble up */ - if (level == 0) { - evt_root_deactivate(tcx); - return 0; - } + if (level == 0) + return evt_root_deactivate(tcx); old_cur = nm_cur; rc = umem_free(evt_umm(tcx), nm_cur); From 46ad7e0bae6f3ef2b8e6479076ba40df445b89dd Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 2 Apr 2020 10:31:42 -0700 Subject: [PATCH 08/10] DAOS-3672 rebuild: Do not use bit to track rebuild (#2122) Because the pool might be created on selected servers, let's not use single bit to track single server rebuild status. Signed-off-by: Di Wang --- src/rebuild/rebuild_internal.h | 39 +++------- src/rebuild/srv.c | 131 ++++++++++++++++++++++----------- 2 files changed, 100 insertions(+), 70 deletions(-) diff --git a/src/rebuild/rebuild_internal.h b/src/rebuild/rebuild_internal.h index 600d7b8c0ed..62afaecae24 100644 --- a/src/rebuild/rebuild_internal.h +++ b/src/rebuild/rebuild_internal.h @@ -91,6 +91,12 @@ struct rebuild_tgt_pool_tracker { rt_global_done:1; }; +struct rebuild_server_status { + d_rank_t rank; + uint32_t scan_done:1, + pull_done:1; +}; + /* Track the rebuild status globally */ struct rebuild_global_pool_tracker { /* rebuild status */ @@ -110,16 +116,11 @@ struct rebuild_global_pool_tracker { /** the current version being rebuilt */ uint32_t rgt_rebuild_ver; - /* bits to track scan status for all targets */ - uint8_t *rgt_scan_bits; + /** rebuild status for each server */ + struct rebuild_server_status *rgt_servers; - /* bits to track pull status for all targets */ - uint8_t *rgt_pull_bits; - - /* The size of rgt_scan_bits and - * rgt_pull_bits in bit - */ - uint32_t rgt_bits_size; + /** number of rgt_server_status */ + uint32_t rgt_servers_number; /* The term of the current rebuild leader */ uint64_t rgt_leader_term; @@ -280,26 +281,6 @@ int rebuild_iv_ns_create(struct ds_pool *pool, uint32_t map_ver, d_rank_list_t *exclude_tgts, unsigned int master_rank); -static inline bool -is_rebuild_global_pull_done(struct rebuild_global_pool_tracker *rgt) -{ - return isset_range(rgt->rgt_pull_bits, 0, rgt->rgt_bits_size - 1); -} - -static inline bool -is_rebuild_global_scan_done(struct rebuild_global_pool_tracker *rgt) -{ - return isset_range(rgt->rgt_scan_bits, 0, rgt->rgt_bits_size - 1); -} - -static inline bool -is_rebuild_global_done(struct rebuild_global_pool_tracker *rgt) -{ - return is_rebuild_global_scan_done(rgt) && - is_rebuild_global_pull_done(rgt); - -} - int rebuild_iv_init(void); int rebuild_iv_fini(void); diff --git a/src/rebuild/srv.c b/src/rebuild/srv.c index dc9f662ab0c..59b6aa9fa08 100644 --- a/src/rebuild/srv.c +++ b/src/rebuild/srv.c @@ -140,6 +140,67 @@ rebuild_tls_init(const struct dss_thread_local_storage *dtls, return tls; } +static bool +is_rebuild_global_pull_done(struct rebuild_global_pool_tracker *rgt) +{ + int i; + + D_ASSERT(rgt->rgt_servers_number > 0); + D_ASSERT(rgt->rgt_servers != NULL); + + for (i = 0; i < rgt->rgt_servers_number; i++) + if (!rgt->rgt_servers[i].pull_done) + return false; + return true; +} + +static bool +is_rebuild_global_scan_done(struct rebuild_global_pool_tracker *rgt) +{ + int i; + + D_ASSERT(rgt->rgt_servers_number > 0); + D_ASSERT(rgt->rgt_servers != NULL); + + for (i = 0; i < rgt->rgt_servers_number; i++) + if (!rgt->rgt_servers[i].scan_done) + return false; + return true; +} + +static bool +is_rebuild_global_done(struct rebuild_global_pool_tracker *rgt) +{ + return is_rebuild_global_scan_done(rgt) && + is_rebuild_global_pull_done(rgt); + +} + +#define SCAN_DONE 0x1 +#define PULL_DONE 0x2 +static void +rebuild_leader_set_status(struct rebuild_global_pool_tracker *rgt, + d_rank_t rank, unsigned flags) +{ + struct rebuild_server_status *status = NULL; + int i; + + D_ASSERT(rgt->rgt_servers_number > 0); + D_ASSERT(rgt->rgt_servers != NULL); + for (i = 0; i < rgt->rgt_servers_number; i++) { + if (rgt->rgt_servers[i].rank == rank) { + status = &rgt->rgt_servers[i]; + break; + } + } + + D_ASSERTF(status != NULL, "Can not find rank %u\n", rank); + if (flags & SCAN_DONE) + status->scan_done = 1; + if (flags & PULL_DONE) + status->pull_done = 1; +} + struct rebuild_tgt_pool_tracker * rpt_lookup(uuid_t pool_uuid, unsigned int ver) { @@ -190,10 +251,9 @@ rebuild_global_status_update(struct rebuild_global_pool_tracker *rgt, return 0; if (!is_rebuild_global_scan_done(rgt)) { - setbit(rgt->rgt_scan_bits, iv->riv_rank); - D_DEBUG(DB_REBUILD, "rebuild ver %d tgt %d scan" - " done bits %x\n", rgt->rgt_rebuild_ver, - iv->riv_rank, rgt->rgt_scan_bits[0]); + rebuild_leader_set_status(rgt, iv->riv_rank, SCAN_DONE); + D_DEBUG(DB_REBUILD, "rebuild ver %d tgt %d scan done\n", + rgt->rgt_rebuild_ver, iv->riv_rank); /* If global scan is not done, then you can not trust * pull status. But if the rebuild on that target is * failed(riv_status != 0), then the target will report @@ -206,10 +266,9 @@ rebuild_global_status_update(struct rebuild_global_pool_tracker *rgt, /* Only trust pull done if scan is done globally */ if (iv->riv_pull_done) { - setbit(rgt->rgt_pull_bits, iv->riv_rank); - D_DEBUG(DB_REBUILD, "rebuild ver %d tgt %d pull" - " done bits %x\n", rgt->rgt_rebuild_ver, - iv->riv_rank, rgt->rgt_pull_bits[0]); + rebuild_leader_set_status(rgt, iv->riv_rank, PULL_DONE); + D_DEBUG(DB_REBUILD, "rebuild ver %d tgt %d pull done\n", + rgt->rgt_rebuild_ver, iv->riv_rank); } return 0; @@ -546,10 +605,9 @@ rebuild_leader_status_check(struct ds_pool *pool, uint32_t map_ver, dom->do_comp.co_rank); if (pool_component_unavail(&dom->do_comp, false)) { - setbit(rgt->rgt_scan_bits, - dom->do_comp.co_rank); - setbit(rgt->rgt_pull_bits, - dom->do_comp.co_rank); + rebuild_leader_set_status(rgt, + dom->do_comp.co_rank, + SCAN_DONE|PULL_DONE); } } D_FREE(targets); @@ -637,11 +695,8 @@ static void rebuild_global_pool_tracker_destroy(struct rebuild_global_pool_tracker *rgt) { d_list_del(&rgt->rgt_list); - if (rgt->rgt_scan_bits) - D_FREE(rgt->rgt_scan_bits); - - if (rgt->rgt_pull_bits) - D_FREE(rgt->rgt_pull_bits); + if (rgt->rgt_servers) + D_FREE(rgt->rgt_servers); D_FREE(rgt); } @@ -652,25 +707,26 @@ rebuild_global_pool_tracker_create(struct ds_pool *pool, uint32_t ver, { struct rebuild_global_pool_tracker *rgt; unsigned int node_nr; - unsigned int array_size; + struct pool_domain *doms; + int i; int rc = 0; D_ALLOC_PTR(rgt); if (rgt == NULL) return -DER_NOMEM; - D_INIT_LIST_HEAD(&rgt->rgt_list); - node_nr = pool_map_node_nr(pool->sp_map); - array_size = roundup(node_nr, NBBY) / NBBY; - rgt->rgt_bits_size = node_nr; + D_INIT_LIST_HEAD(&rgt->rgt_list); + node_nr = pool_map_find_nodes(pool->sp_map, PO_COMP_ID_ALL, &doms); + if (node_nr < 0) + D_GOTO(out, rc = node_nr); - D_ALLOC_ARRAY(rgt->rgt_scan_bits, array_size); - if (rgt->rgt_scan_bits == NULL) + D_ALLOC_ARRAY(rgt->rgt_servers, node_nr); + if (rgt->rgt_servers == NULL) D_GOTO(out, rc = -DER_NOMEM); - D_ALLOC_ARRAY(rgt->rgt_pull_bits, array_size); - if (rgt->rgt_pull_bits == NULL) - D_GOTO(out, rc = -DER_NOMEM); + for (i = 0; i < node_nr; i++) + rgt->rgt_servers[i].rank = doms[i].do_comp.co_rank; + rgt->rgt_servers_number = node_nr; uuid_copy(rgt->rgt_pool_uuid, pool->sp_uuid); rgt->rgt_rebuild_ver = ver; @@ -680,7 +736,7 @@ rebuild_global_pool_tracker_create(struct ds_pool *pool, uint32_t ver, out: if (rc) rebuild_global_pool_tracker_destroy(rgt); - return 0; + return rc; } /* To notify all targets to prepare the rebuild */ @@ -712,7 +768,7 @@ rebuild_prepare(struct ds_pool *pool, uint32_t rebuild_ver, bool excluded = false; int i; - /* Set failed(being rebuilt) targets scan/pull bits.*/ + /* Set failed(being rebuilt) targets scan/pull status.*/ for (i = 0; i < exclude_tgts->pti_number; i++) { struct pool_target *target; struct pool_domain *dom; @@ -731,18 +787,11 @@ rebuild_prepare(struct ds_pool *pool, uint32_t rebuild_ver, dom = pool_map_find_node_by_rank(pool->sp_map, target->ta_comp.co_rank); if (dom && dom->do_comp.co_status == PO_COMP_ST_DOWN) { - D_ASSERT(dom->do_comp.co_rank < - (*rgt)->rgt_bits_size); - setbit((*rgt)->rgt_scan_bits, - dom->do_comp.co_rank); - setbit((*rgt)->rgt_pull_bits, - dom->do_comp.co_rank); - D_DEBUG(DB_REBUILD, "exclude target fail with" - "%u/%u scan bits 0x%x pull bits 0x%x\n", - target->ta_comp.co_rank, - target->ta_comp.co_id, - *(*rgt)->rgt_scan_bits, - *(*rgt)->rgt_pull_bits); + rebuild_leader_set_status(*rgt, + dom->do_comp.co_rank, + SCAN_DONE|PULL_DONE); + D_DEBUG(DB_REBUILD, "exclude target %u\n", + target->ta_comp.co_rank); } } /* Sigh these failed targets does not exist in the pool From 1a4617bb13ae630eb433889a4febc2a5e87f5c2c Mon Sep 17 00:00:00 2001 From: Ryon Jensen Date: Thu, 2 Apr 2020 12:03:43 -0600 Subject: [PATCH 09/10] DAOS-4292 csum: Fix for overlapping extents after first chunk (#2280) Fixes a bug that caused errant checksum failures. The logic for choosing checksums didn't take into account that chunk 0 of an extent isn't chunk 0 of the system and so was using incorrect chunk dimensions. Signed-off-by: Ryon Jensen --- src/common/tests/checksum_tests.c | 2 +- src/object/srv_csum.c | 8 +++++--- src/tests/suite/daos_checksum.c | 16 +++++++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/common/tests/checksum_tests.c b/src/common/tests/checksum_tests.c index 1a21440a4b2..fb0459d48ff 100644 --- a/src/common/tests/checksum_tests.c +++ b/src/common/tests/checksum_tests.c @@ -1081,7 +1081,7 @@ simple_sv(void **state) iod.iod_nr = 1; iod.iod_recxs = NULL; - iod.iod_size = 1; /* [todo-ryon]: this should be bigger than 1 */ + iod.iod_size = daos_sgl_buf_size(&sgl); iod.iod_type = DAOS_IOD_SINGLE; rc = daos_csummer_calc_iods(csummer, &sgl, &iod, 1, 0, NULL, 0, diff --git a/src/object/srv_csum.c b/src/object/srv_csum.c index 4695203888e..98323569e15 100644 --- a/src/object/srv_csum.c +++ b/src/object/srv_csum.c @@ -423,7 +423,8 @@ cc_add_csums_for_recx(struct csum_context *ctx, daos_recx_t *recx, uint32_t chunksize; size_t rec_size; uint32_t chunk_nr; - uint32_t c; + uint32_t c; /** recx chunk index */ + uint32_t sc; /** system chunk index */ int rc = 0; chunksize = daos_csummer_get_chunksize(ctx->cc_csummer); @@ -437,11 +438,12 @@ cc_add_csums_for_recx(struct csum_context *ctx, daos_recx_t *recx, cc_set_iov2ranges(ctx, cc2iov(ctx)); - for (c = 0; c < chunk_nr; c++) { /** for each chunk/checksum */ + sc = (recx->rx_idx * rec_size) / chunksize; + for (c = 0; c < chunk_nr; c++, sc++) { /** for each chunk/checksum */ ctx->cc_recx_chunk = csum_recx_chunkidx2range(recx, rec_size, chunksize, c); ctx->cc_chunk = csum_chunkrange(chunksize / ctx->cc_rec_len, - c); + sc); ctx->cc_chunk_bytes_left = ctx->cc_recx_chunk.dcr_nr * rec_size; diff --git a/src/tests/suite/daos_checksum.c b/src/tests/suite/daos_checksum.c index 3f123a07232..e66092d0efa 100644 --- a/src/tests/suite/daos_checksum.c +++ b/src/tests/suite/daos_checksum.c @@ -593,7 +593,8 @@ setup_obj_data_for_sv(struct csum_test_ctx *ctx, bool large_buf) /** Fill an iov buf with data, using \data (duplicate if necessary) */ -static void iov_update_fill(d_iov_t *iov, char *data, uint64_t len_to_fill) +static void +iov_update_fill(d_iov_t *iov, char *data, uint64_t len_to_fill) { iov->iov_len = len_to_fill; const size_t data_len = strlen(data); /** don't include '\0' */ @@ -773,6 +774,19 @@ fetch_with_multiple_extents(void **state) .fetch_recx = {.rx_idx = 2, .rx_nr = 800}, }); + /** Overwrites after the first chunk */ + ARRAY_UPDATE_FETCH_TESTCASE(state, { + .chunksize = 32, + .csum_prop_type = DAOS_PROP_CO_CSUM_CRC64, + .server_verify = false, + .rec_size = 4, + .recx_cfgs = { + {.idx = 8, .nr = 2, .data = "B"}, + {.idx = 9, .nr = 2, .data = "C"}, + }, + .fetch_recx = {.rx_idx = 8, .rx_nr = 3}, + }); + /** Extents with holes */ /** TODO: Holes not supported yet */ #if 0 From b499ed6e84021c9af12135460f1db147ac721140 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi <9256862+mchaarawi@users.noreply.github.com> Date: Thu, 2 Apr 2020 16:11:39 -0500 Subject: [PATCH 10/10] DAOS-2666 build: fix clang build error (#2317) Signed-off-by: Mohamad Chaarawi --- src/rebuild/srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rebuild/srv.c b/src/rebuild/srv.c index 59b6aa9fa08..f824eb54a21 100644 --- a/src/rebuild/srv.c +++ b/src/rebuild/srv.c @@ -706,7 +706,7 @@ rebuild_global_pool_tracker_create(struct ds_pool *pool, uint32_t ver, struct rebuild_global_pool_tracker **p_rgt) { struct rebuild_global_pool_tracker *rgt; - unsigned int node_nr; + int node_nr; struct pool_domain *doms; int i; int rc = 0;