diff --git a/src/control/cmd/daos/pool.go b/src/control/cmd/daos/pool.go index 88098815972..320957b8cf4 100644 --- a/src/control/cmd/daos/pool.go +++ b/src/control/cmd/daos/pool.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2023 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -15,11 +15,9 @@ import ( "github.com/google/uuid" "github.com/pkg/errors" - "github.com/daos-stack/daos/src/control/cmd/dmg/pretty" + "github.com/daos-stack/daos/src/control/cmd/daos/pretty" "github.com/daos-stack/daos/src/control/common" - "github.com/daos-stack/daos/src/control/common/proto/convert" - mgmtpb "github.com/daos-stack/daos/src/control/common/proto/mgmt" - "github.com/daos-stack/daos/src/control/lib/control" + "github.com/daos-stack/daos/src/control/lib/daos" "github.com/daos-stack/daos/src/control/lib/ranklist" "github.com/daos-stack/daos/src/control/lib/ui" ) @@ -198,27 +196,27 @@ type poolQueryCmd struct { ShowDisabledRanks bool `short:"b" long:"show-disabled" description:"Show engine unique identifiers (ranks) which are disabled"` } -func convertPoolSpaceInfo(in *C.struct_daos_pool_space, mt C.uint) *mgmtpb.StorageUsageStats { +func convertPoolSpaceInfo(in *C.struct_daos_pool_space, mt C.uint) *daos.StorageUsageStats { if in == nil { return nil } - return &mgmtpb.StorageUsageStats{ + return &daos.StorageUsageStats{ Total: uint64(in.ps_space.s_total[mt]), Free: uint64(in.ps_space.s_free[mt]), Min: uint64(in.ps_free_min[mt]), Max: uint64(in.ps_free_max[mt]), Mean: uint64(in.ps_free_mean[mt]), - MediaType: mgmtpb.StorageMediaType(mt), + MediaType: daos.StorageMediaType(mt), } } -func convertPoolRebuildStatus(in *C.struct_daos_rebuild_status) *mgmtpb.PoolRebuildStatus { +func convertPoolRebuildStatus(in *C.struct_daos_rebuild_status) *daos.PoolRebuildStatus { if in == nil { return nil } - out := &mgmtpb.PoolRebuildStatus{ + out := &daos.PoolRebuildStatus{ Status: int32(in.rs_errno), } if out.Status == 0 { @@ -226,46 +224,39 @@ func convertPoolRebuildStatus(in *C.struct_daos_rebuild_status) *mgmtpb.PoolRebu out.Records = uint64(in.rs_rec_nr) switch { case in.rs_version == 0: - out.State = mgmtpb.PoolRebuildStatus_IDLE + out.State = daos.PoolRebuildStateIdle case C.get_rebuild_state(in) == C.DRS_COMPLETED: - out.State = mgmtpb.PoolRebuildStatus_DONE + out.State = daos.PoolRebuildStateDone default: - out.State = mgmtpb.PoolRebuildStatus_BUSY + out.State = daos.PoolRebuildStateBusy } } return out } -// This is not great... But it allows us to leverage the existing -// pretty printer that dmg uses for this info. Better to find some -// way to unify all of this and remove redundancy/manual conversion. -// -// We're basically doing the same thing as ds_mgmt_drpc_pool_query() -// to stuff the info into a protobuf message and then using the -// automatic conversion from proto to control. Kind of ugly but -// gets the job done. We could potentially create some function -// that's shared between this code and the drpc handlers to deal -// with stuffing the protobuf message but it's probably overkill. -func convertPoolInfo(pinfo *C.daos_pool_info_t) (*control.PoolQueryResp, error) { - pqp := new(mgmtpb.PoolQueryResp) - - pqp.Uuid = uuid.Must(uuidFromC(pinfo.pi_uuid)).String() - pqp.TotalTargets = uint32(pinfo.pi_ntargets) - pqp.DisabledTargets = uint32(pinfo.pi_ndisabled) - pqp.ActiveTargets = uint32(pinfo.pi_space.ps_ntargets) - pqp.TotalEngines = uint32(pinfo.pi_nnodes) - pqp.Leader = uint32(pinfo.pi_leader) - pqp.Version = uint32(pinfo.pi_map_ver) - - pqp.TierStats = []*mgmtpb.StorageUsageStats{ +func convertPoolInfo(pinfo *C.daos_pool_info_t) (*daos.PoolInfo, error) { + poolInfo := new(daos.PoolInfo) + + poolInfo.UUID = uuid.Must(uuidFromC(pinfo.pi_uuid)) + poolInfo.TotalTargets = uint32(pinfo.pi_ntargets) + poolInfo.DisabledTargets = uint32(pinfo.pi_ndisabled) + poolInfo.ActiveTargets = uint32(pinfo.pi_space.ps_ntargets) + poolInfo.TotalEngines = uint32(pinfo.pi_nnodes) + poolInfo.ServiceLeader = uint32(pinfo.pi_leader) + poolInfo.Version = uint32(pinfo.pi_map_ver) + poolInfo.State = daos.PoolServiceStateReady + if poolInfo.DisabledTargets > 0 { + poolInfo.State = daos.PoolServiceStateDegraded + } + + poolInfo.Rebuild = convertPoolRebuildStatus(&pinfo.pi_rebuild_st) + poolInfo.TierStats = []*daos.StorageUsageStats{ convertPoolSpaceInfo(&pinfo.pi_space, C.DAOS_MEDIA_SCM), convertPoolSpaceInfo(&pinfo.pi_space, C.DAOS_MEDIA_NVME), } - pqp.Rebuild = convertPoolRebuildStatus(&pinfo.pi_rebuild_st) - pqr := new(control.PoolQueryResp) - return pqr, convert.Types(pqp, pqr) + return poolInfo, nil } const ( @@ -308,46 +299,40 @@ func (cmd *poolQueryCmd) Execute(_ []string) error { } defer cleanup() - pinfo := C.daos_pool_info_t{ + cPoolInfo := C.daos_pool_info_t{ pi_bits: dpiQueryAll, } if cmd.ShowDisabledRanks { - pinfo.pi_bits &= C.uint64_t(^(uint64(C.DPI_ENGINES_ENABLED))) + cPoolInfo.pi_bits &= C.uint64_t(^(uint64(C.DPI_ENGINES_ENABLED))) } - rc := C.daos_pool_query(cmd.cPoolHandle, rlPtr, &pinfo, nil, nil) + rc := C.daos_pool_query(cmd.cPoolHandle, rlPtr, &cPoolInfo, nil, nil) defer C.d_rank_list_free(rl) if err := daosError(rc); err != nil { return errors.Wrapf(err, "failed to query pool %s", cmd.poolUUID) } - pqr, err := convertPoolInfo(&pinfo) + poolInfo, err := convertPoolInfo(&cPoolInfo) if err != nil { return err } if rlPtr != nil { if cmd.ShowEnabledRanks { - pqr.EnabledRanks = ranklist.MustCreateRankSet(generateRankSet(rl)) + poolInfo.EnabledRanks = ranklist.MustCreateRankSet(generateRankSet(rl)) } if cmd.ShowDisabledRanks { - pqr.DisabledRanks = ranklist.MustCreateRankSet(generateRankSet(rl)) + poolInfo.DisabledRanks = ranklist.MustCreateRankSet(generateRankSet(rl)) } } - // Update the Pool Query State based on response - err = pqr.UpdateState() - if err != nil { - return err - } - if cmd.JSONOutputEnabled() { - return cmd.OutputJSON(pqr, nil) + return cmd.OutputJSON(poolInfo, nil) } var bld strings.Builder - if err := pretty.PrintPoolQueryResponse(pqr, &bld); err != nil { + if err := pretty.PrintPoolInfo(poolInfo, &bld); err != nil { return err } @@ -364,11 +349,11 @@ type poolQueryTargetsCmd struct { } // For using the pretty printer that dmg uses for this target info. -func convertPoolTargetInfo(ptinfo *C.daos_target_info_t) (*control.PoolQueryTargetInfo, error) { - pqti := new(control.PoolQueryTargetInfo) - pqti.Type = control.PoolQueryTargetType(ptinfo.ta_type) - pqti.State = control.PoolQueryTargetState(ptinfo.ta_state) - pqti.Space = []*control.StorageTargetUsage{ +func convertPoolTargetInfo(ptinfo *C.daos_target_info_t) (*daos.PoolQueryTargetInfo, error) { + pqti := new(daos.PoolQueryTargetInfo) + pqti.Type = daos.PoolQueryTargetType(ptinfo.ta_type) + pqti.State = daos.PoolQueryTargetState(ptinfo.ta_state) + pqti.Space = []*daos.StorageUsageStats{ { Total: uint64(ptinfo.ta_space.s_total[C.DAOS_MEDIA_SCM]), Free: uint64(ptinfo.ta_space.s_free[C.DAOS_MEDIA_SCM]), @@ -396,10 +381,10 @@ func (cmd *poolQueryTargetsCmd) Execute(_ []string) error { return errors.WithMessage(err, "parsing target list") } - infoResp := new(control.PoolQueryTargetResp) ptInfo := new(C.daos_target_info_t) var rc C.int + infos := make([]*daos.PoolQueryTargetInfo, 0, len(idxList)) for tgt := 0; tgt < len(idxList); tgt++ { rc = C.daos_pool_query_target(cmd.cPoolHandle, C.uint32_t(idxList[tgt]), C.uint32_t(cmd.Rank), ptInfo, nil) if err := daosError(rc); err != nil { @@ -408,19 +393,21 @@ func (cmd *poolQueryTargetsCmd) Execute(_ []string) error { } tgtInfo, err := convertPoolTargetInfo(ptInfo) - infoResp.Infos = append(infoResp.Infos, tgtInfo) if err != nil { return err } + infos = append(infos, tgtInfo) } if cmd.JSONOutputEnabled() { - return cmd.OutputJSON(infoResp, nil) + return cmd.OutputJSON(infos, nil) } var bld strings.Builder - if err := pretty.PrintPoolQueryTargetResponse(infoResp, &bld); err != nil { - return err + for _, info := range infos { + if err := pretty.PrintPoolQueryTargetInfo(info, &bld); err != nil { + return err + } } cmd.Info(bld.String()) diff --git a/src/control/cmd/daos/pretty/pool.go b/src/control/cmd/daos/pretty/pool.go new file mode 100644 index 00000000000..01a8d81bd0e --- /dev/null +++ b/src/control/cmd/daos/pretty/pool.go @@ -0,0 +1,97 @@ +// +// (C) Copyright 2020-2024 Intel Corporation. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +package pretty + +import ( + "fmt" + "io" + + "github.com/dustin/go-humanize" + "github.com/pkg/errors" + + "github.com/daos-stack/daos/src/control/lib/daos" + "github.com/daos-stack/daos/src/control/lib/txtfmt" +) + +const msgNoPools = "No pools in system" + +func getTierNameText(tierIdx int) string { + switch tierIdx { + case int(daos.StorageMediaTypeScm): + return fmt.Sprintf("- Storage tier %d (SCM):", tierIdx) + case int(daos.StorageMediaTypeNvme): + return fmt.Sprintf("- Storage tier %d (NVMe):", tierIdx) + default: + return fmt.Sprintf("- Storage tier %d (unknown):", tierIdx) + } +} + +// PrintPoolInfo generates a human-readable representation of the supplied +// PoolQueryResp struct and writes it to the supplied io.Writer. +func PrintPoolInfo(pi *daos.PoolInfo, out io.Writer) error { + if pi == nil { + return errors.Errorf("nil %T", pi) + } + w := txtfmt.NewErrWriter(out) + + // Maintain output compatibility with the `daos pool query` output. + fmt.Fprintf(w, "Pool %s, ntarget=%d, disabled=%d, leader=%d, version=%d, state=%s\n", + pi.UUID, pi.TotalTargets, pi.DisabledTargets, pi.ServiceLeader, pi.Version, pi.State) + + if pi.PoolLayoutVer != pi.UpgradeLayoutVer { + fmt.Fprintf(w, "Pool layout out of date (%d < %d) -- see `dmg pool upgrade` for details.\n", + pi.PoolLayoutVer, pi.UpgradeLayoutVer) + } + fmt.Fprintln(w, "Pool space info:") + if pi.EnabledRanks != nil { + fmt.Fprintf(w, "- Enabled ranks: %s\n", pi.EnabledRanks) + } + if pi.DisabledRanks != nil { + fmt.Fprintf(w, "- Disabled ranks: %s\n", pi.DisabledRanks) + } + fmt.Fprintf(w, "- Target(VOS) count:%d\n", pi.ActiveTargets) + if pi.TierStats != nil { + for tierIdx, tierStats := range pi.TierStats { + fmt.Fprintln(w, getTierNameText(tierIdx)) + fmt.Fprintf(w, " Total size: %s\n", humanize.Bytes(tierStats.Total)) + fmt.Fprintf(w, " Free: %s, min:%s, max:%s, mean:%s\n", + humanize.Bytes(tierStats.Free), humanize.Bytes(tierStats.Min), + humanize.Bytes(tierStats.Max), humanize.Bytes(tierStats.Mean)) + } + } + if pi.Rebuild != nil { + if pi.Rebuild.Status == 0 { + fmt.Fprintf(w, "Rebuild %s, %d objs, %d recs\n", + pi.Rebuild.State, pi.Rebuild.Objects, pi.Rebuild.Records) + } else { + fmt.Fprintf(w, "Rebuild failed, status=%d\n", pi.Rebuild.Status) + } + } + + return w.Err +} + +// PrintPoolQueryTargetInfo generates a human-readable representation of the supplied +// PoolQueryTargetResp struct and writes it to the supplied io.Writer. +func PrintPoolQueryTargetInfo(pqti *daos.PoolQueryTargetInfo, out io.Writer) error { + if pqti == nil { + return errors.Errorf("nil %T", pqti) + } + w := txtfmt.NewErrWriter(out) + + // Maintain output compatibility with the `daos pool query-targets` output. + fmt.Fprintf(w, "Target: type %s, state %s\n", pqti.Type, pqti.State) + if pqti.Space != nil { + for tierIdx, tierUsage := range pqti.Space { + fmt.Fprintln(w, getTierNameText(tierIdx)) + fmt.Fprintf(w, " Total size: %s\n", humanize.Bytes(tierUsage.Total)) + fmt.Fprintf(w, " Free: %s\n", humanize.Bytes(tierUsage.Free)) + } + } + + return w.Err +} diff --git a/src/control/cmd/daos/pretty/pool_test.go b/src/control/cmd/daos/pretty/pool_test.go new file mode 100644 index 00000000000..ef10485b00e --- /dev/null +++ b/src/control/cmd/daos/pretty/pool_test.go @@ -0,0 +1,437 @@ +// +// (C) Copyright 2020-2024 Intel Corporation. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +package pretty + +import ( + "errors" + "fmt" + "strings" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + + "github.com/daos-stack/daos/src/control/common/test" + "github.com/daos-stack/daos/src/control/lib/daos" + "github.com/daos-stack/daos/src/control/lib/ranklist" +) + +func TestPretty_PrintPoolInfo(t *testing.T) { + poolUUID := test.MockPoolUUID() + backtickStr := "`" + "dmg pool upgrade" + "`" + for name, tc := range map[string]struct { + pi *daos.PoolInfo + expPrintStr string + }{ + "empty response": { + pi: &daos.PoolInfo{}, + expPrintStr: fmt.Sprintf(` +Pool %s, ntarget=0, disabled=0, leader=0, version=0, state=Creating +Pool space info: +- Target(VOS) count:0 +`, uuid.Nil.String()), + }, + "normal response": { + pi: &daos.PoolInfo{ + State: daos.PoolServiceStateDegraded, + UUID: poolUUID, + TotalTargets: 2, + DisabledTargets: 1, + ActiveTargets: 1, + ServiceLeader: 42, + Version: 100, + PoolLayoutVer: 1, + UpgradeLayoutVer: 2, + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateBusy, + Objects: 42, + Records: 21, + }, + TierStats: []*daos.StorageUsageStats{ + { + Total: 2, + Free: 1, + }, + { + Total: 2, + Free: 1, + }, + }, + }, + expPrintStr: fmt.Sprintf(` +Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded +Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. +Pool space info: +- Target(VOS) count:1 +- Storage tier 0 (SCM): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +- Storage tier 1 (NVMe): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +Rebuild busy, 42 objs, 21 recs +`, poolUUID.String()), + }, + "normal response; enabled ranks": { + pi: &daos.PoolInfo{ + State: daos.PoolServiceStateDegraded, + UUID: poolUUID, + TotalTargets: 2, + DisabledTargets: 1, + ActiveTargets: 1, + ServiceLeader: 42, + Version: 100, + PoolLayoutVer: 1, + UpgradeLayoutVer: 2, + EnabledRanks: ranklist.MustCreateRankSet("[0,1,2]"), + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateBusy, + Objects: 42, + Records: 21, + }, + TierStats: []*daos.StorageUsageStats{ + { + Total: 2, + Free: 1, + }, + { + Total: 2, + Free: 1, + }, + }, + }, + expPrintStr: fmt.Sprintf(` +Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded +Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. +Pool space info: +- Enabled ranks: 0-2 +- Target(VOS) count:1 +- Storage tier 0 (SCM): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +- Storage tier 1 (NVMe): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +Rebuild busy, 42 objs, 21 recs +`, poolUUID.String()), + }, + "normal response; disabled ranks": { + pi: &daos.PoolInfo{ + State: daos.PoolServiceStateDegraded, + UUID: poolUUID, + TotalTargets: 2, + DisabledTargets: 1, + ActiveTargets: 1, + ServiceLeader: 42, + Version: 100, + PoolLayoutVer: 1, + UpgradeLayoutVer: 2, + DisabledRanks: ranklist.MustCreateRankSet("[0,1,3]"), + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateBusy, + Objects: 42, + Records: 21, + }, + TierStats: []*daos.StorageUsageStats{ + { + Total: 2, + Free: 1, + }, + { + Total: 2, + Free: 1, + }, + }, + }, + expPrintStr: fmt.Sprintf(` +Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded +Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. +Pool space info: +- Disabled ranks: 0-1,3 +- Target(VOS) count:1 +- Storage tier 0 (SCM): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +- Storage tier 1 (NVMe): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +Rebuild busy, 42 objs, 21 recs +`, poolUUID.String()), + }, + "unknown/invalid rebuild state response": { + pi: &daos.PoolInfo{ + State: daos.PoolServiceStateDegraded, + UUID: poolUUID, + TotalTargets: 2, + DisabledTargets: 1, + ActiveTargets: 1, + ServiceLeader: 42, + Version: 100, + PoolLayoutVer: 1, + UpgradeLayoutVer: 2, + DisabledRanks: ranklist.MustCreateRankSet("[0,1,3]"), + Rebuild: &daos.PoolRebuildStatus{ + State: 42, + Objects: 42, + Records: 21, + }, + TierStats: []*daos.StorageUsageStats{ + { + Total: 2, + Free: 1, + }, + { + Total: 2, + Free: 1, + }, + }, + }, + expPrintStr: fmt.Sprintf(` +Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded +Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. +Pool space info: +- Disabled ranks: 0-1,3 +- Target(VOS) count:1 +- Storage tier 0 (SCM): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +- Storage tier 1 (NVMe): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +Rebuild unknown, 42 objs, 21 recs +`, poolUUID.String()), + }, + "rebuild failed": { + pi: &daos.PoolInfo{ + State: daos.PoolServiceStateDegraded, + UUID: poolUUID, + TotalTargets: 2, + DisabledTargets: 1, + ActiveTargets: 1, + ServiceLeader: 42, + Version: 100, + PoolLayoutVer: 1, + UpgradeLayoutVer: 2, + Rebuild: &daos.PoolRebuildStatus{ + Status: 2, + State: daos.PoolRebuildStateBusy, + Objects: 42, + Records: 21, + }, + TierStats: []*daos.StorageUsageStats{ + { + Total: 2, + Free: 1, + }, + { + Total: 2, + Free: 1, + }, + }, + }, + expPrintStr: fmt.Sprintf(` +Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded +Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. +Pool space info: +- Target(VOS) count:1 +- Storage tier 0 (SCM): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +- Storage tier 1 (NVMe): + Total size: 2 B + Free: 1 B, min:0 B, max:0 B, mean:0 B +Rebuild failed, status=2 +`, poolUUID.String()), + }, + } { + t.Run(name, func(t *testing.T) { + var bld strings.Builder + if err := PrintPoolInfo(tc.pi, &bld); err != nil { + t.Fatal(err) + } + + if diff := cmp.Diff(strings.TrimLeft(tc.expPrintStr, "\n"), bld.String()); diff != "" { + t.Fatalf("unexpected format string (-want, +got):\n%s\n", diff) + } + }) + } +} + +func TestPretty_PrintPoolQueryTarget(t *testing.T) { + for name, tc := range map[string]struct { + pqti *daos.PoolQueryTargetInfo + expErr error + expPrintStr string + }{ + "nil info": { + expErr: errors.New("nil"), + }, + "valid: single target (unknown, down_out)": { + pqti: &daos.PoolQueryTargetInfo{ + Type: 0, + State: daos.PoolTargetStateDownOut, + Space: []*daos.StorageUsageStats{ + { + Total: 6000000000, + Free: 5000000000, + }, + { + Total: 100000000000, + Free: 90000000000, + }, + }, + }, + expPrintStr: ` +Target: type unknown, state down_out +- Storage tier 0 (SCM): + Total size: 6.0 GB + Free: 5.0 GB +- Storage tier 1 (NVMe): + Total size: 100 GB + Free: 90 GB +`, + }, + "valid: single target (unknown, down)": { + pqti: &daos.PoolQueryTargetInfo{ + Type: 0, + State: daos.PoolTargetStateDown, + Space: []*daos.StorageUsageStats{ + { + Total: 6000000000, + Free: 5000000000, + }, + { + Total: 100000000000, + Free: 90000000000, + }, + }, + }, + expPrintStr: ` +Target: type unknown, state down +- Storage tier 0 (SCM): + Total size: 6.0 GB + Free: 5.0 GB +- Storage tier 1 (NVMe): + Total size: 100 GB + Free: 90 GB +`, + }, + "valid: single target (unknown, up)": { + pqti: &daos.PoolQueryTargetInfo{ + Type: 0, + State: daos.PoolTargetStateUp, + Space: []*daos.StorageUsageStats{ + { + Total: 6000000000, + Free: 5000000000, + }, + { + Total: 100000000000, + Free: 90000000000, + }, + }, + }, + expPrintStr: ` +Target: type unknown, state up +- Storage tier 0 (SCM): + Total size: 6.0 GB + Free: 5.0 GB +- Storage tier 1 (NVMe): + Total size: 100 GB + Free: 90 GB +`, + }, + "valid: single target (unknown, up_in)": { + pqti: &daos.PoolQueryTargetInfo{ + Type: 0, + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ + { + Total: 6000000000, + Free: 5000000000, + }, + { + Total: 100000000000, + Free: 90000000000, + }, + }, + }, + expPrintStr: ` +Target: type unknown, state up_in +- Storage tier 0 (SCM): + Total size: 6.0 GB + Free: 5.0 GB +- Storage tier 1 (NVMe): + Total size: 100 GB + Free: 90 GB +`, + }, + "valid: single target (unknown, new)": { + pqti: &daos.PoolQueryTargetInfo{ + Type: 0, + State: daos.PoolTargetStateNew, + Space: []*daos.StorageUsageStats{ + { + Total: 6000000000, + Free: 5000000000, + }, + { + Total: 100000000000, + Free: 90000000000, + }, + }, + }, + expPrintStr: ` +Target: type unknown, state new +- Storage tier 0 (SCM): + Total size: 6.0 GB + Free: 5.0 GB +- Storage tier 1 (NVMe): + Total size: 100 GB + Free: 90 GB +`, + }, + "valid: single target (unknown, drain)": { + pqti: &daos.PoolQueryTargetInfo{ + Type: 0, + State: daos.PoolTargetStateDrain, + Space: []*daos.StorageUsageStats{ + { + Total: 6000000000, + Free: 5000000000, + }, + { + Total: 100000000000, + Free: 90000000000, + }, + }, + }, + expPrintStr: ` +Target: type unknown, state drain +- Storage tier 0 (SCM): + Total size: 6.0 GB + Free: 5.0 GB +- Storage tier 1 (NVMe): + Total size: 100 GB + Free: 90 GB +`, + }, + } { + t.Run(name, func(t *testing.T) { + var bld strings.Builder + gotErr := PrintPoolQueryTargetInfo(tc.pqti, &bld) + test.CmpErr(t, tc.expErr, gotErr) + if tc.expErr != nil { + return + } + + if diff := cmp.Diff(strings.TrimLeft(tc.expPrintStr, "\n"), bld.String()); diff != "" { + t.Fatalf("unexpected format string (-want, +got):\n%s\n", diff) + } + }) + } +} diff --git a/src/control/cmd/dmg/pool.go b/src/control/cmd/dmg/pool.go index 32bdfdc6723..d327751fe97 100644 --- a/src/control/cmd/dmg/pool.go +++ b/src/control/cmd/dmg/pool.go @@ -21,6 +21,7 @@ import ( "github.com/daos-stack/daos/src/control/common" "github.com/daos-stack/daos/src/control/common/cmdutil" "github.com/daos-stack/daos/src/control/lib/control" + "github.com/daos-stack/daos/src/control/lib/daos" "github.com/daos-stack/daos/src/control/lib/ranklist" "github.com/daos-stack/daos/src/control/lib/ui" "github.com/daos-stack/daos/src/control/logging" @@ -408,16 +409,21 @@ func (cmd *PoolListCmd) Execute(_ []string) (errOut error) { NoQuery: cmd.NoQuery, } - initialResp, err := control.ListPools(cmd.MustLogCtx(), cmd.ctlInvoker, req) + resp, err := control.ListPools(cmd.MustLogCtx(), cmd.ctlInvoker, req) if err != nil { return err // control api returned an error, disregard response } // If rebuild-only pools requested, list the pools which has been rebuild only // and not in idle state, otherwise list all the pools. - resp := new(control.ListPoolsResp) - if err := updateListPoolsResponse(resp, initialResp, cmd.RebuildOnly); err != nil { - return err + if cmd.RebuildOnly { + filtered := resp.Pools[:0] // reuse backing array + for _, p := range resp.Pools { + if p.Rebuild != nil && p.Rebuild.State != daos.PoolRebuildStateIdle { + filtered = append(filtered, p) + } + } + resp.Pools = filtered } if cmd.JSONOutputEnabled() { @@ -438,17 +444,6 @@ func (cmd *PoolListCmd) Execute(_ []string) (errOut error) { return resp.Errors() } -// Update the pool list, which has been rebuild and not in idle state. -func updateListPoolsResponse(finalResp *control.ListPoolsResp, resp *control.ListPoolsResp, rebuildOnly bool) error { - for _, pool := range resp.Pools { - if !rebuildOnly || pool.RebuildState != "idle" { - finalResp.Pools = append(finalResp.Pools, pool) - } - } - - return nil -} - type PoolID struct { ui.LabelOrUUIDFlag } diff --git a/src/control/cmd/dmg/pool_test.go b/src/control/cmd/dmg/pool_test.go index eda0492511b..adc6158de19 100644 --- a/src/control/cmd/dmg/pool_test.go +++ b/src/control/cmd/dmg/pool_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2023 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -27,7 +27,6 @@ import ( "github.com/daos-stack/daos/src/control/lib/daos" "github.com/daos-stack/daos/src/control/lib/ranklist" "github.com/daos-stack/daos/src/control/logging" - "github.com/daos-stack/daos/src/control/system" ) func Test_Dmg_PoolTierRatioFlag(t *testing.T) { @@ -1135,7 +1134,7 @@ func TestDmg_PoolListCmd_Errors(t *testing.T) { { Uuid: test.MockUUID(1), SvcReps: []uint32{1, 3, 5, 8}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), }, }, }, diff --git a/src/control/cmd/dmg/pretty/pool.go b/src/control/cmd/dmg/pretty/pool.go index 35667e8909b..f2bff92a7d8 100644 --- a/src/control/cmd/dmg/pretty/pool.go +++ b/src/control/cmd/dmg/pretty/pool.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2023 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -13,6 +13,7 @@ import ( "github.com/dustin/go-humanize" "github.com/pkg/errors" + pretty "github.com/daos-stack/daos/src/control/cmd/daos/pretty" "github.com/daos-stack/daos/src/control/lib/control" "github.com/daos-stack/daos/src/control/lib/daos" "github.com/daos-stack/daos/src/control/lib/ranklist" @@ -23,9 +24,9 @@ const msgNoPools = "No pools in system" func getTierNameText(tierIdx int) string { switch tierIdx { - case int(control.StorageMediaTypeScm): + case int(daos.StorageMediaTypeScm): return fmt.Sprintf("- Storage tier %d (SCM):", tierIdx) - case int(control.StorageMediaTypeNvme): + case int(daos.StorageMediaTypeNvme): return fmt.Sprintf("- Storage tier %d (NVMe):", tierIdx) default: return fmt.Sprintf("- Storage tier %d (unknown):", tierIdx) @@ -35,46 +36,7 @@ func getTierNameText(tierIdx int) string { // PrintPoolQueryResponse generates a human-readable representation of the supplied // PoolQueryResp struct and writes it to the supplied io.Writer. func PrintPoolQueryResponse(pqr *control.PoolQueryResp, out io.Writer, opts ...PrintConfigOption) error { - if pqr == nil { - return errors.Errorf("nil %T", pqr) - } - w := txtfmt.NewErrWriter(out) - - // Maintain output compatibility with the `daos pool query` output. - fmt.Fprintf(w, "Pool %s, ntarget=%d, disabled=%d, leader=%d, version=%d, state=%s\n", - pqr.UUID, pqr.TotalTargets, pqr.DisabledTargets, pqr.Leader, pqr.Version, pqr.State) - - if pqr.PoolLayoutVer != pqr.UpgradeLayoutVer { - fmt.Fprintf(w, "Pool layout out of date (%d < %d) -- see `dmg pool upgrade` for details.\n", - pqr.PoolLayoutVer, pqr.UpgradeLayoutVer) - } - fmt.Fprintln(w, "Pool space info:") - if pqr.EnabledRanks != nil { - fmt.Fprintf(w, "- Enabled ranks: %s\n", pqr.EnabledRanks) - } - if pqr.DisabledRanks != nil { - fmt.Fprintf(w, "- Disabled ranks: %s\n", pqr.DisabledRanks) - } - fmt.Fprintf(w, "- Target(VOS) count:%d\n", pqr.ActiveTargets) - if pqr.TierStats != nil { - for tierIdx, tierStats := range pqr.TierStats { - fmt.Fprintln(w, getTierNameText(tierIdx)) - fmt.Fprintf(w, " Total size: %s\n", humanize.Bytes(tierStats.Total)) - fmt.Fprintf(w, " Free: %s, min:%s, max:%s, mean:%s\n", - humanize.Bytes(tierStats.Free), humanize.Bytes(tierStats.Min), - humanize.Bytes(tierStats.Max), humanize.Bytes(tierStats.Mean)) - } - } - if pqr.Rebuild != nil { - if pqr.Rebuild.Status == 0 { - fmt.Fprintf(w, "Rebuild %s, %d objs, %d recs\n", - pqr.Rebuild.State, pqr.Rebuild.Objects, pqr.Rebuild.Records) - } else { - fmt.Fprintf(w, "Rebuild failed, rc=%d, status=%d\n", pqr.Status, pqr.Rebuild.Status) - } - } - - return w.Err + return pretty.PrintPoolInfo(&pqr.PoolInfo, out) } // PrintPoolQueryTargetResponse generates a human-readable representation of the supplied @@ -83,21 +45,14 @@ func PrintPoolQueryTargetResponse(pqtr *control.PoolQueryTargetResp, out io.Writ if pqtr == nil { return errors.Errorf("nil %T", pqtr) } - w := txtfmt.NewErrWriter(out) - - // Maintain output compatibility with the `daos pool query-targets` output. - for infosIdx := range pqtr.Infos { - fmt.Fprintf(w, "Target: type %s, state %s\n", pqtr.Infos[infosIdx].Type, pqtr.Infos[infosIdx].State) - if pqtr.Infos[infosIdx].Space != nil { - for tierIdx, tierUsage := range pqtr.Infos[infosIdx].Space { - fmt.Fprintln(w, getTierNameText(tierIdx)) - fmt.Fprintf(w, " Total size: %s\n", humanize.Bytes(tierUsage.Total)) - fmt.Fprintf(w, " Free: %s\n", humanize.Bytes(tierUsage.Free)) - } + + for _, info := range pqtr.Infos { + if err := pretty.PrintPoolQueryTargetInfo(info, out); err != nil { + return err } } - return w.Err + return nil } // PrintTierRatio generates a human-readable representation of the supplied @@ -159,20 +114,21 @@ func PrintPoolCreateResponse(pcr *control.PoolCreateResp, out io.Writer, opts .. return err } -func poolListCreateRow(pool *control.Pool, upgrade bool) txtfmt.TableRow { +func poolListCreateRow(pool *daos.PoolInfo, upgrade bool) txtfmt.TableRow { // display size of the largest non-empty tier var size uint64 - for ti := len(pool.Usage) - 1; ti >= 0; ti-- { - if pool.Usage[ti].Size != 0 { - size = pool.Usage[ti].Size + poolUsage := pool.Usage() + for ti := len(poolUsage) - 1; ti >= 0; ti-- { + if poolUsage[ti].Size != 0 { + size = poolUsage[ti].Size break } } // display usage of the most used tier var used int - for ti := 0; ti < len(pool.Usage); ti++ { - t := pool.Usage[ti] + for ti := 0; ti < len(poolUsage); ti++ { + t := poolUsage[ti] u := float64(t.Size-t.Free) / float64(t.Size) if int(u*100) > used { @@ -182,19 +138,19 @@ func poolListCreateRow(pool *control.Pool, upgrade bool) txtfmt.TableRow { // display imbalance of the most imbalanced tier var imbalance uint32 - for ti := 0; ti < len(pool.Usage); ti++ { - if pool.Usage[ti].Imbalance > imbalance { - imbalance = pool.Usage[ti].Imbalance + for ti := 0; ti < len(poolUsage); ti++ { + if poolUsage[ti].Imbalance > imbalance { + imbalance = poolUsage[ti].Imbalance } } row := txtfmt.TableRow{ - "Pool": pool.GetName(), - "Size": fmt.Sprintf("%s", humanize.Bytes(size)), - "State": pool.State, + "Pool": pool.Name(), + "Size": humanize.Bytes(size), + "State": pool.State.String(), "Used": fmt.Sprintf("%d%%", used), "Imbalance": fmt.Sprintf("%d%%", imbalance), - "Disabled": fmt.Sprintf("%d/%d", pool.TargetsDisabled, pool.TargetsTotal), + "Disabled": fmt.Sprintf("%d/%d", pool.DisabledTargets, pool.TotalTargets), } if upgrade { @@ -216,7 +172,7 @@ func printListPoolsResp(out io.Writer, resp *control.ListPoolsResp) error { } upgrade := false for _, pool := range resp.Pools { - if pool.HasErrors() { + if resp.PoolQueryError(pool.UUID) != nil { continue } if pool.PoolLayoutVer != pool.UpgradeLayoutVer { @@ -232,7 +188,7 @@ func printListPoolsResp(out io.Writer, resp *control.ListPoolsResp) error { var table []txtfmt.TableRow for _, pool := range resp.Pools { - if pool.HasErrors() { + if resp.PoolQueryError(pool.UUID) != nil { continue } table = append(table, poolListCreateRow(pool, upgrade)) @@ -243,7 +199,7 @@ func printListPoolsResp(out io.Writer, resp *control.ListPoolsResp) error { return nil } -func addVerboseTierUsage(row txtfmt.TableRow, usage *control.PoolTierUsage) txtfmt.TableRow { +func addVerboseTierUsage(row txtfmt.TableRow, usage *daos.PoolTierUsage) txtfmt.TableRow { row[usage.TierName+" Size"] = humanize.Bytes(usage.Size) row[usage.TierName+" Used"] = humanize.Bytes(usage.Size - usage.Free) row[usage.TierName+" Imbalance"] = fmt.Sprintf("%d%%", usage.Imbalance) @@ -251,7 +207,7 @@ func addVerboseTierUsage(row txtfmt.TableRow, usage *control.PoolTierUsage) txtf return row } -func poolListCreateRowVerbose(pool *control.Pool) txtfmt.TableRow { +func poolListCreateRowVerbose(pool *daos.PoolInfo) txtfmt.TableRow { label := pool.Label if label == "" { label = "-" @@ -270,15 +226,15 @@ func poolListCreateRowVerbose(pool *control.Pool) txtfmt.TableRow { row := txtfmt.TableRow{ "Label": label, - "UUID": pool.UUID, - "State": pool.State, + "UUID": pool.UUID.String(), + "State": pool.State.String(), "SvcReps": svcReps, - "Disabled": fmt.Sprintf("%d/%d", pool.TargetsDisabled, pool.TargetsTotal), + "Disabled": fmt.Sprintf("%d/%d", pool.DisabledTargets, pool.TotalTargets), "UpgradeNeeded?": upgrade, - "Rebuild State": pool.RebuildState, + "Rebuild State": pool.RebuildState(), } - for _, tu := range pool.Usage { + for _, tu := range pool.Usage() { row = addVerboseTierUsage(row, tu) } @@ -292,7 +248,7 @@ func printListPoolsRespVerbose(noQuery bool, out io.Writer, resp *control.ListPo } titles := []string{"Label", "UUID", "State", "SvcReps"} - for _, t := range resp.Pools[0].Usage { + for _, t := range resp.Pools[0].Usage() { titles = append(titles, t.TierName+" Size", t.TierName+" Used", @@ -308,7 +264,7 @@ func printListPoolsRespVerbose(noQuery bool, out io.Writer, resp *control.ListPo var table []txtfmt.TableRow for _, pool := range resp.Pools { - if pool.HasErrors() { + if resp.PoolQueryError(pool.UUID) != nil { continue } table = append(table, poolListCreateRowVerbose(pool)) diff --git a/src/control/cmd/dmg/pretty/pool_test.go b/src/control/cmd/dmg/pretty/pool_test.go index 1a28ec85f74..e61870cef1c 100644 --- a/src/control/cmd/dmg/pretty/pool_test.go +++ b/src/control/cmd/dmg/pretty/pool_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2023 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -14,264 +14,14 @@ import ( "github.com/dustin/go-humanize" "github.com/google/go-cmp/cmp" + "github.com/google/uuid" "github.com/daos-stack/daos/src/control/common/test" "github.com/daos-stack/daos/src/control/lib/control" + "github.com/daos-stack/daos/src/control/lib/daos" "github.com/daos-stack/daos/src/control/lib/ranklist" - "github.com/daos-stack/daos/src/control/system" ) -func TestPretty_PrintPoolQueryResp(t *testing.T) { - backtickStr := "`" + "dmg pool upgrade" + "`" - for name, tc := range map[string]struct { - pqr *control.PoolQueryResp - expPrintStr string - }{ - "empty response": { - pqr: &control.PoolQueryResp{}, - expPrintStr: ` -Pool , ntarget=0, disabled=0, leader=0, version=0, state=Unknown -Pool space info: -- Target(VOS) count:0 -`, - }, - "normal response": { - pqr: &control.PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: control.PoolInfo{ - TotalTargets: 2, - DisabledTargets: 1, - ActiveTargets: 1, - Leader: 42, - Version: 100, - PoolLayoutVer: 1, - UpgradeLayoutVer: 2, - Rebuild: &control.PoolRebuildStatus{ - State: control.PoolRebuildStateBusy, - Objects: 42, - Records: 21, - }, - TierStats: []*control.StorageUsageStats{ - { - Total: 2, - Free: 1, - }, - { - Total: 2, - Free: 1, - }, - }, - }, - }, - expPrintStr: fmt.Sprintf(` -Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded -Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. -Pool space info: -- Target(VOS) count:1 -- Storage tier 0 (SCM): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -- Storage tier 1 (NVMe): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -Rebuild busy, 42 objs, 21 recs -`, test.MockUUID()), - }, - "normal response; enabled ranks": { - pqr: &control.PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: control.PoolInfo{ - TotalTargets: 2, - DisabledTargets: 1, - ActiveTargets: 1, - Leader: 42, - Version: 100, - PoolLayoutVer: 1, - UpgradeLayoutVer: 2, - EnabledRanks: ranklist.MustCreateRankSet("[0,1,2]"), - Rebuild: &control.PoolRebuildStatus{ - State: control.PoolRebuildStateBusy, - Objects: 42, - Records: 21, - }, - TierStats: []*control.StorageUsageStats{ - { - Total: 2, - Free: 1, - }, - { - Total: 2, - Free: 1, - }, - }, - }, - }, - expPrintStr: fmt.Sprintf(` -Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded -Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. -Pool space info: -- Enabled ranks: 0-2 -- Target(VOS) count:1 -- Storage tier 0 (SCM): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -- Storage tier 1 (NVMe): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -Rebuild busy, 42 objs, 21 recs -`, test.MockUUID()), - }, - "normal response; disabled ranks": { - pqr: &control.PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: control.PoolInfo{ - TotalTargets: 2, - DisabledTargets: 1, - ActiveTargets: 1, - Leader: 42, - Version: 100, - PoolLayoutVer: 1, - UpgradeLayoutVer: 2, - DisabledRanks: ranklist.MustCreateRankSet("[0,1,3]"), - Rebuild: &control.PoolRebuildStatus{ - State: control.PoolRebuildStateBusy, - Objects: 42, - Records: 21, - }, - TierStats: []*control.StorageUsageStats{ - { - Total: 2, - Free: 1, - }, - { - Total: 2, - Free: 1, - }, - }, - }, - }, - expPrintStr: fmt.Sprintf(` -Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded -Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. -Pool space info: -- Disabled ranks: 0-1,3 -- Target(VOS) count:1 -- Storage tier 0 (SCM): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -- Storage tier 1 (NVMe): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -Rebuild busy, 42 objs, 21 recs -`, test.MockUUID()), - }, - "unknown/invalid rebuild state response": { - pqr: &control.PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: control.PoolInfo{ - TotalTargets: 2, - DisabledTargets: 1, - ActiveTargets: 1, - Leader: 42, - Version: 100, - PoolLayoutVer: 1, - UpgradeLayoutVer: 2, - DisabledRanks: ranklist.MustCreateRankSet("[0,1,3]"), - Rebuild: &control.PoolRebuildStatus{ - State: 42, - Objects: 42, - Records: 21, - }, - TierStats: []*control.StorageUsageStats{ - { - Total: 2, - Free: 1, - }, - { - Total: 2, - Free: 1, - }, - }, - }, - }, - expPrintStr: fmt.Sprintf(` -Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded -Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. -Pool space info: -- Disabled ranks: 0-1,3 -- Target(VOS) count:1 -- Storage tier 0 (SCM): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -- Storage tier 1 (NVMe): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -Rebuild unknown, 42 objs, 21 recs -`, test.MockUUID()), - }, - "rebuild failed": { - pqr: &control.PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: control.PoolInfo{ - TotalTargets: 2, - DisabledTargets: 1, - ActiveTargets: 1, - Leader: 42, - Version: 100, - PoolLayoutVer: 1, - UpgradeLayoutVer: 2, - Rebuild: &control.PoolRebuildStatus{ - Status: 2, - State: control.PoolRebuildStateBusy, - Objects: 42, - Records: 21, - }, - TierStats: []*control.StorageUsageStats{ - { - Total: 2, - Free: 1, - }, - { - Total: 2, - Free: 1, - }, - }, - }, - }, - expPrintStr: fmt.Sprintf(` -Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=Degraded -Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. -Pool space info: -- Target(VOS) count:1 -- Storage tier 0 (SCM): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -- Storage tier 1 (NVMe): - Total size: 2 B - Free: 1 B, min:0 B, max:0 B, mean:0 B -Rebuild failed, rc=0, status=2 -`, test.MockUUID()), - }, - } { - t.Run(name, func(t *testing.T) { - var bld strings.Builder - tc.pqr.UpdateState() - if err := PrintPoolQueryResponse(tc.pqr, &bld); err != nil { - t.Fatal(err) - } - - if diff := cmp.Diff(strings.TrimLeft(tc.expPrintStr, "\n"), bld.String()); diff != "" { - t.Fatalf("unexpected format string (-want, +got):\n%s\n", diff) - } - }) - } -} - func TestPretty_PrintPoolQueryTargetResp(t *testing.T) { for name, tc := range map[string]struct { pqtr *control.PoolQueryTargetResp @@ -287,194 +37,14 @@ func TestPretty_PrintPoolQueryTargetResp(t *testing.T) { }, expPrintStr: "\n", }, - "valid: single target (unknown, down_out)": { - pqtr: &control.PoolQueryTargetResp{ - Status: 0, - Infos: []*control.PoolQueryTargetInfo{ - { - Type: 0, - State: control.PoolTargetStateDownOut, - Space: []*control.StorageTargetUsage{ - { - Total: 6000000000, - Free: 5000000000, - }, - { - Total: 100000000000, - Free: 90000000000, - }, - }, - }, - }, - }, - expPrintStr: ` -Target: type unknown, state down_out -- Storage tier 0 (SCM): - Total size: 6.0 GB - Free: 5.0 GB -- Storage tier 1 (NVMe): - Total size: 100 GB - Free: 90 GB -`, - }, - "valid: single target (unknown, down)": { - pqtr: &control.PoolQueryTargetResp{ - Status: 0, - Infos: []*control.PoolQueryTargetInfo{ - { - Type: 0, - State: control.PoolTargetStateDown, - Space: []*control.StorageTargetUsage{ - { - Total: 6000000000, - Free: 5000000000, - }, - { - Total: 100000000000, - Free: 90000000000, - }, - }, - }, - }, - }, - expPrintStr: ` -Target: type unknown, state down -- Storage tier 0 (SCM): - Total size: 6.0 GB - Free: 5.0 GB -- Storage tier 1 (NVMe): - Total size: 100 GB - Free: 90 GB -`, - }, - "valid: single target (unknown, up)": { - pqtr: &control.PoolQueryTargetResp{ - Status: 0, - Infos: []*control.PoolQueryTargetInfo{ - { - Type: 0, - State: control.PoolTargetStateUp, - Space: []*control.StorageTargetUsage{ - { - Total: 6000000000, - Free: 5000000000, - }, - { - Total: 100000000000, - Free: 90000000000, - }, - }, - }, - }, - }, - expPrintStr: ` -Target: type unknown, state up -- Storage tier 0 (SCM): - Total size: 6.0 GB - Free: 5.0 GB -- Storage tier 1 (NVMe): - Total size: 100 GB - Free: 90 GB -`, - }, - "valid: single target (unknown, up_in)": { - pqtr: &control.PoolQueryTargetResp{ - Status: 0, - Infos: []*control.PoolQueryTargetInfo{ - { - Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ - { - Total: 6000000000, - Free: 5000000000, - }, - { - Total: 100000000000, - Free: 90000000000, - }, - }, - }, - }, - }, - expPrintStr: ` -Target: type unknown, state up_in -- Storage tier 0 (SCM): - Total size: 6.0 GB - Free: 5.0 GB -- Storage tier 1 (NVMe): - Total size: 100 GB - Free: 90 GB -`, - }, - "valid: single target (unknown, new)": { - pqtr: &control.PoolQueryTargetResp{ - Status: 0, - Infos: []*control.PoolQueryTargetInfo{ - { - Type: 0, - State: control.PoolTargetStateNew, - Space: []*control.StorageTargetUsage{ - { - Total: 6000000000, - Free: 5000000000, - }, - { - Total: 100000000000, - Free: 90000000000, - }, - }, - }, - }, - }, - expPrintStr: ` -Target: type unknown, state new -- Storage tier 0 (SCM): - Total size: 6.0 GB - Free: 5.0 GB -- Storage tier 1 (NVMe): - Total size: 100 GB - Free: 90 GB -`, - }, - "valid: single target (unknown, drain)": { - pqtr: &control.PoolQueryTargetResp{ - Status: 0, - Infos: []*control.PoolQueryTargetInfo{ - { - Type: 0, - State: control.PoolTargetStateDrain, - Space: []*control.StorageTargetUsage{ - { - Total: 6000000000, - Free: 5000000000, - }, - { - Total: 100000000000, - Free: 90000000000, - }, - }, - }, - }, - }, - expPrintStr: ` -Target: type unknown, state drain -- Storage tier 0 (SCM): - Total size: 6.0 GB - Free: 5.0 GB -- Storage tier 1 (NVMe): - Total size: 100 GB - Free: 90 GB -`, - }, "valid: multiple target (mixed statuses exclude 2 targets in progress)": { pqtr: &control.PoolQueryTargetResp{ Status: 0, - Infos: []*control.PoolQueryTargetInfo{ + Infos: []*daos.PoolQueryTargetInfo{ { Type: 0, - State: control.PoolTargetStateDown, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateDown, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -487,8 +57,8 @@ Target: type unknown, state drain }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -501,8 +71,8 @@ Target: type unknown, state drain }, { Type: 0, - State: control.PoolTargetStateDownOut, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateDownOut, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -515,8 +85,8 @@ Target: type unknown, state drain }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -563,11 +133,11 @@ Target: type unknown, state up_in "invalid target state": { pqtr: &control.PoolQueryTargetResp{ Status: 0, - Infos: []*control.PoolQueryTargetInfo{ + Infos: []*daos.PoolQueryTargetInfo{ { Type: 0, State: 42, - Space: []*control.StorageTargetUsage{ + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -580,8 +150,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -594,8 +164,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateDownOut, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateDownOut, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -608,8 +178,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -656,11 +226,11 @@ Target: type unknown, state up_in "invalid target type": { pqtr: &control.PoolQueryTargetResp{ Status: 0, - Infos: []*control.PoolQueryTargetInfo{ + Infos: []*daos.PoolQueryTargetInfo{ { Type: 42, - State: control.PoolTargetStateDown, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateDown, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -673,8 +243,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -687,8 +257,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateDownOut, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateDownOut, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -701,8 +271,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -749,11 +319,11 @@ Target: type unknown, state up_in "three tiers; third tier unknown StorageMediaType": { pqtr: &control.PoolQueryTargetResp{ Status: 0, - Infos: []*control.PoolQueryTargetInfo{ + Infos: []*daos.PoolQueryTargetInfo{ { Type: 0, - State: control.PoolTargetStateDown, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateDown, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -770,8 +340,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -788,8 +358,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateDownOut, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateDownOut, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -806,8 +376,8 @@ Target: type unknown, state up_in }, { Type: 0, - State: control.PoolTargetStateUpIn, - Space: []*control.StorageTargetUsage{ + State: daos.PoolTargetStateUpIn, + Space: []*daos.StorageUsageStats{ { Total: 6000000000, Free: 5000000000, @@ -919,7 +489,7 @@ Pool created with 5.66%%,94.34%% storage tier ratio Storage tier 0 (SCM) : 2.4 GB (600 MB / rank) Storage tier 1 (NVMe): 40 GB (10 GB / rank) -`, test.MockUUID()), +`, test.MockPoolUUID()), }, "no nvme": { pcr: &control.PoolCreateResp{ @@ -940,7 +510,7 @@ Pool created with 100.00%% storage tier ratio Total Size : 2.4 GB Storage tier 0 (SCM) : 2.4 GB (600 MB / rank) -`, test.MockUUID()), +`, test.MockPoolUUID()), }, } { t.Run(name, func(t *testing.T) { @@ -959,18 +529,20 @@ Pool created with 100.00%% storage tier ratio } func TestPretty_PrintListPoolsResponse(t *testing.T) { - exampleUsage := []*control.PoolTierUsage{ + exampleTierStats := []*daos.StorageUsageStats{ { - TierName: "SCM", - Size: 100 * humanize.GByte, + MediaType: daos.StorageMediaTypeScm, + Total: 100 * humanize.GByte, Free: 20 * humanize.GByte, - Imbalance: 12, + Min: 5 * humanize.GByte, + Max: 6 * humanize.GByte, }, { - TierName: "NVME", - Size: 6 * humanize.TByte, + MediaType: daos.StorageMediaTypeNvme, + Total: 6 * humanize.TByte, Free: 1 * humanize.TByte, - Imbalance: 1, + Min: 20 * humanize.GByte, + Max: 50 * humanize.GByte, }, } @@ -987,11 +559,11 @@ func TestPretty_PrintListPoolsResponse(t *testing.T) { }, "one pool; no usage": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady, }, }, }, @@ -1004,10 +576,10 @@ Pool Size State Used Imbalance Disabled }, "one pool; no uuid": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, + TierStats: exampleTierStats, }, }, }, @@ -1015,23 +587,25 @@ Pool Size State Used Imbalance Disabled }, "two pools; diff num tiers": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, PoolLayoutVer: 1, UpgradeLayoutVer: 2, }, { - UUID: test.MockUUID(2), + UUID: test.MockPoolUUID(2), Label: "one", ServiceReplicas: []ranklist.Rank{3, 4, 5}, - Usage: exampleUsage[1:], - TargetsTotal: 64, - TargetsDisabled: 8, + TierStats: exampleTierStats[1:], + TotalTargets: 64, + ActiveTargets: 56, + DisabledTargets: 8, PoolLayoutVer: 2, UpgradeLayoutVer: 2, }, @@ -1041,25 +615,27 @@ Pool Size State Used Imbalance Disabled }, "two pools; only one labeled": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, - State: system.PoolServiceStateReady.String(), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 2, }, { Label: "two", - UUID: test.MockUUID(2), + UUID: test.MockPoolUUID(2), ServiceReplicas: []ranklist.Rank{3, 4, 5}, - Usage: exampleUsage, - TargetsTotal: 64, - TargetsDisabled: 8, - State: system.PoolServiceStateReady.String(), + TierStats: exampleTierStats, + TotalTargets: 64, + ActiveTargets: 56, + DisabledTargets: 8, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 2, }, @@ -1068,36 +644,38 @@ Pool Size State Used Imbalance Disabled expPrintStr: ` Pool Size State Used Imbalance Disabled UpgradeNeeded? ---- ---- ----- ---- --------- -------- -------------- -00000001 6.0 TB Ready 83% 12% 0/16 1->2 -two 6.0 TB Ready 83% 12% 8/64 1->2 +00000001 6.0 TB Ready 83% 16% 0/16 1->2 +two 6.0 TB Ready 83% 56% 8/64 1->2 `, }, "two pools; one SCM only": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { Label: "one", - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, - State: system.PoolServiceStateReady.String(), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 2, }, { Label: "two", - UUID: test.MockUUID(2), + UUID: test.MockPoolUUID(2), ServiceReplicas: []ranklist.Rank{3, 4, 5}, - Usage: []*control.PoolTierUsage{ - exampleUsage[0], - {TierName: "NVME"}, - }, - TargetsTotal: 64, - TargetsDisabled: 8, - State: system.PoolServiceStateReady.String(), + TierStats: []*daos.StorageUsageStats{ + exampleTierStats[0], + {MediaType: daos.StorageMediaTypeNvme}, + }, + TotalTargets: 64, + ActiveTargets: 56, + DisabledTargets: 8, + State: daos.PoolServiceStateReady, PoolLayoutVer: 2, UpgradeLayoutVer: 2, }, @@ -1106,30 +684,35 @@ two 6.0 TB Ready 83% 12% 8/64 1->2 expPrintStr: ` Pool Size State Used Imbalance Disabled UpgradeNeeded? ---- ---- ----- ---- --------- -------- -------------- -one 6.0 TB Ready 83% 12% 0/16 1->2 -two 100 GB Ready 80% 12% 8/64 None +one 6.0 TB Ready 83% 16% 0/16 1->2 +two 100 GB Ready 80% 56% 8/64 None `, }, "two pools; one failed query": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { Label: "one", - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, - State: system.PoolServiceStateReady.String(), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 2, }, { Label: "two", - UUID: test.MockUUID(2), + UUID: test.MockPoolUUID(2), ServiceReplicas: []ranklist.Rank{3, 4, 5}, - QueryErrorMsg: "stats unavailable", + }, + }, + QueryErrors: map[uuid.UUID]*control.PoolQueryErr{ + test.MockPoolUUID(2): { + Error: errors.New("stats unavailable"), }, }, }, @@ -1138,46 +721,53 @@ Query on pool "two" unsuccessful, error: "stats unavailable" Pool Size State Used Imbalance Disabled UpgradeNeeded? ---- ---- ----- ---- --------- -------- -------------- -one 6.0 TB Ready 83% 12% 0/16 1->2 +one 6.0 TB Ready 83% 16% 0/16 1->2 `, }, "three pools; one failed query; one query bad status": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { Label: "one", - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, - State: system.PoolServiceStateReady.String(), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 1, }, { - UUID: test.MockUUID(2), + UUID: test.MockPoolUUID(2), ServiceReplicas: []ranklist.Rank{3, 4, 5}, - QueryErrorMsg: "stats unavailable", }, { Label: "three", - UUID: test.MockUUID(3), + UUID: test.MockPoolUUID(3), ServiceReplicas: []ranklist.Rank{3, 4, 5}, - QueryStatusMsg: "DER_UNINIT", + }, + }, + QueryErrors: map[uuid.UUID]*control.PoolQueryErr{ + test.MockPoolUUID(2): { + Error: errors.New("stats unavailable"), + }, + test.MockPoolUUID(3): { + Status: daos.NotInit, }, }, }, - expPrintStr: ` + expPrintStr: fmt.Sprintf(` Query on pool "00000002" unsuccessful, error: "stats unavailable" -Query on pool "three" unsuccessful, status: "DER_UNINIT" +Query on pool "three" unsuccessful, status: %q Pool Size State Used Imbalance Disabled ---- ---- ----- ---- --------- -------- -one 6.0 TB Ready 83% 12% 0/16 +one 6.0 TB Ready 83%% 16%% 0/16 -`, +`, daos.NotInit), }, "verbose, empty response": { resp: &control.ListPoolsResp{}, @@ -1186,16 +776,19 @@ one 6.0 TB Ready 83% 12% 0/16 }, "verbose; zero svc replicas": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ - { - UUID: test.MockUUID(1), - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, - State: system.PoolServiceStateReady.String(), + Pools: []*daos.PoolInfo{ + { + UUID: test.MockPoolUUID(1), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 2, - RebuildState: "idle", + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateIdle, + }, }, }, }, @@ -1203,19 +796,20 @@ one 6.0 TB Ready 83% 12% 0/16 expPrintStr: ` Label UUID State SvcReps SCM Size SCM Used SCM Imbalance NVME Size NVME Used NVME Imbalance Disabled UpgradeNeeded? Rebuild State ----- ---- ----- ------- -------- -------- ------------- --------- --------- -------------- -------- -------------- ------------- -- 00000001-0001-0001-0001-000000000001 Ready N/A 100 GB 80 GB 12% 6.0 TB 5.0 TB 1% 0/16 1->2 idle +- 00000001-0001-0001-0001-000000000001 Ready N/A 100 GB 80 GB 16% 6.0 TB 5.0 TB 8% 0/16 1->2 idle `, }, "verbose; zero svc replicas with no query": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ - { - UUID: test.MockUUID(1), - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, - State: system.PoolServiceStateReady.String(), + Pools: []*daos.PoolInfo{ + { + UUID: test.MockPoolUUID(1), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 2, }, @@ -1226,36 +820,42 @@ Label UUID State SvcReps SCM Size SCM Used SCM I expPrintStr: ` Label UUID State SvcReps SCM Size SCM Used SCM Imbalance NVME Size NVME Used NVME Imbalance Disabled UpgradeNeeded? ----- ---- ----- ------- -------- -------- ------------- --------- --------- -------------- -------- -------------- -- 00000001-0001-0001-0001-000000000001 Ready N/A 100 GB 80 GB 12% 6.0 TB 5.0 TB 1% 0/16 1->2 +- 00000001-0001-0001-0001-000000000001 Ready N/A 100 GB 80 GB 16% 6.0 TB 5.0 TB 8% 0/16 1->2 `, }, "verbose; two pools; one destroying": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { Label: "one", - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 0, - State: system.PoolServiceStateReady.String(), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 16, + DisabledTargets: 0, + State: daos.PoolServiceStateReady, PoolLayoutVer: 1, UpgradeLayoutVer: 2, - RebuildState: "idle", + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateIdle, + }, }, { Label: "two", - UUID: test.MockUUID(2), + UUID: test.MockPoolUUID(2), ServiceReplicas: []ranklist.Rank{3, 4, 5}, - Usage: exampleUsage, - TargetsTotal: 64, - TargetsDisabled: 8, - State: system.PoolServiceStateDestroying.String(), + TierStats: exampleTierStats, + TotalTargets: 64, + ActiveTargets: 56, + DisabledTargets: 8, + State: daos.PoolServiceStateDestroying, PoolLayoutVer: 2, UpgradeLayoutVer: 2, - RebuildState: "done", + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateDone, + }, }, }, }, @@ -1263,25 +863,28 @@ Label UUID State SvcReps SCM Size SCM Used SCM I expPrintStr: ` Label UUID State SvcReps SCM Size SCM Used SCM Imbalance NVME Size NVME Used NVME Imbalance Disabled UpgradeNeeded? Rebuild State ----- ---- ----- ------- -------- -------- ------------- --------- --------- -------------- -------- -------------- ------------- -one 00000001-0001-0001-0001-000000000001 Ready [0-2] 100 GB 80 GB 12% 6.0 TB 5.0 TB 1% 0/16 1->2 idle -two 00000002-0002-0002-0002-000000000002 Destroying [3-5] 100 GB 80 GB 12% 6.0 TB 5.0 TB 1% 8/64 None done +one 00000001-0001-0001-0001-000000000001 Ready [0-2] 100 GB 80 GB 16% 6.0 TB 5.0 TB 8% 0/16 1->2 idle +two 00000002-0002-0002-0002-000000000002 Destroying [3-5] 100 GB 80 GB 56% 6.0 TB 5.0 TB 27% 8/64 None done `, }, "verbose; one pools; rebuild state busy": { resp: &control.ListPoolsResp{ - Pools: []*control.Pool{ + Pools: []*daos.PoolInfo{ { Label: "one", - UUID: test.MockUUID(1), + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{0, 1, 2}, - Usage: exampleUsage, - TargetsTotal: 16, - TargetsDisabled: 8, - State: system.PoolServiceStateDegraded.String(), + TierStats: exampleTierStats, + TotalTargets: 16, + ActiveTargets: 8, + DisabledTargets: 8, + State: daos.PoolServiceStateDegraded, PoolLayoutVer: 1, UpgradeLayoutVer: 2, - RebuildState: "busy", + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateBusy, + }, }, }, }, @@ -1289,7 +892,7 @@ two 00000002-0002-0002-0002-000000000002 Destroying [3-5] 100 GB 80 GB expPrintStr: ` Label UUID State SvcReps SCM Size SCM Used SCM Imbalance NVME Size NVME Used NVME Imbalance Disabled UpgradeNeeded? Rebuild State ----- ---- ----- ------- -------- -------- ------------- --------- --------- -------------- -------- -------------- ------------- -one 00000001-0001-0001-0001-000000000001 Degraded [0-2] 100 GB 80 GB 12% 6.0 TB 5.0 TB 1% 8/16 1->2 busy +one 00000001-0001-0001-0001-000000000001 Degraded [0-2] 100 GB 80 GB 8% 6.0 TB 5.0 TB 4% 8/16 1->2 busy `, }, diff --git a/src/control/common/proto/mgmt/pool.pb.go b/src/control/common/proto/mgmt/pool.pb.go index c67499066c3..e8bcd401238 100644 --- a/src/control/common/proto/mgmt/pool.pb.go +++ b/src/control/common/proto/mgmt/pool.pb.go @@ -6,8 +6,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.11.4 +// protoc-gen-go v1.31.0 +// protoc v3.5.0 // source: mgmt/pool.proto package mgmt @@ -1840,13 +1840,15 @@ type PoolQueryResp struct { Rebuild *PoolRebuildStatus `protobuf:"bytes,7,opt,name=rebuild,proto3" json:"rebuild,omitempty"` // pool rebuild status TierStats []*StorageUsageStats `protobuf:"bytes,8,rep,name=tier_stats,json=tierStats,proto3" json:"tier_stats,omitempty"` // storage tiers usage stats Version uint32 `protobuf:"varint,10,opt,name=version,proto3" json:"version,omitempty"` // latest pool map version - Leader uint32 `protobuf:"varint,11,opt,name=leader,proto3" json:"leader,omitempty"` // current raft leader + Leader uint32 `protobuf:"varint,11,opt,name=leader,proto3" json:"leader,omitempty"` // current raft leader (2.4) EnabledRanks string `protobuf:"bytes,12,opt,name=enabled_ranks,json=enabledRanks,proto3" json:"enabled_ranks,omitempty"` // optional set of ranks enabled DisabledRanks string `protobuf:"bytes,13,opt,name=disabled_ranks,json=disabledRanks,proto3" json:"disabled_ranks,omitempty"` // optional set of ranks disabled TotalEngines uint32 `protobuf:"varint,14,opt,name=total_engines,json=totalEngines,proto3" json:"total_engines,omitempty"` // total engines in pool PoolLayoutVer uint32 `protobuf:"varint,15,opt,name=pool_layout_ver,json=poolLayoutVer,proto3" json:"pool_layout_ver,omitempty"` // current pool global version UpgradeLayoutVer uint32 `protobuf:"varint,16,opt,name=upgrade_layout_ver,json=upgradeLayoutVer,proto3" json:"upgrade_layout_ver,omitempty"` // latest pool global version to upgrade State PoolServiceState `protobuf:"varint,17,opt,name=state,proto3,enum=mgmt.PoolServiceState" json:"state,omitempty"` // pool state + SvcLdr uint32 `protobuf:"varint,18,opt,name=svc_ldr,json=svcLdr,proto3" json:"svc_ldr,omitempty"` // current raft leader (2.6+) + SvcReps []uint32 `protobuf:"varint,19,rep,packed,name=svc_reps,json=svcReps,proto3" json:"svc_reps,omitempty"` // service replica ranks } func (x *PoolQueryResp) Reset() { @@ -1993,6 +1995,20 @@ func (x *PoolQueryResp) GetState() PoolServiceState { return PoolServiceState_Creating } +func (x *PoolQueryResp) GetSvcLdr() uint32 { + if x != nil { + return x.SvcLdr + } + return 0 +} + +func (x *PoolQueryResp) GetSvcReps() []uint32 { + if x != nil { + return x.SvcReps + } + return nil +} + type PoolProperty struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3020,7 +3036,7 @@ var file_mgmt_pool_proto_rawDesc = []byte{ 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x25, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x44, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e, - 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x55, 0x53, 0x59, 0x10, 0x02, 0x22, 0xed, 0x04, + 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x55, 0x53, 0x59, 0x10, 0x02, 0x22, 0xa1, 0x05, 0x0a, 0x0d, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, @@ -3058,103 +3074,107 @@ var file_mgmt_pool_proto_rawDesc = []byte{ 0x61, 0x64, 0x65, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x56, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, - 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x63, 0x0a, - 0x0c, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x16, 0x0a, - 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x76, 0x61, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x76, 0x61, 0x6c, 0x12, - 0x18, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, - 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x50, 0x72, - 0x6f, 0x70, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x67, - 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, - 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, - 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x29, 0x0a, 0x0f, 0x50, 0x6f, 0x6f, 0x6c, - 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, 0x47, 0x65, 0x74, 0x50, - 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x79, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, - 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x5d, 0x0a, 0x0f, 0x50, 0x6f, 0x6f, - 0x6c, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, - 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x0a, 0x70, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, - 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x79, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x76, + 0x63, 0x5f, 0x6c, 0x64, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x76, 0x63, + 0x4c, 0x64, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x76, 0x63, 0x5f, 0x72, 0x65, 0x70, 0x73, 0x18, + 0x13, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x73, 0x76, 0x63, 0x52, 0x65, 0x70, 0x73, 0x4a, 0x04, + 0x08, 0x09, 0x10, 0x0a, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, + 0x73, 0x22, 0x63, 0x0a, 0x0c, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, + 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, + 0x76, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x42, 0x07, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, 0x53, + 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x79, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0d, 0x52, 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x29, 0x0a, 0x0f, + 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, - 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x29, 0x0a, 0x0f, 0x50, 0x6f, 0x6f, - 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x12, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e, - 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0d, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, - 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x75, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x6d, 0x65, 0x64, 0x69, - 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, - 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x64, 0x69, 0x61, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x22, - 0xda, 0x02, 0x0a, 0x13, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, - 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x25, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, - 0x0a, 0x05, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x3b, - 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x48, 0x44, 0x44, - 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x53, 0x44, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x50, - 0x4d, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x56, 0x4d, 0x10, 0x04, 0x22, 0x5f, 0x0a, 0x0b, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, - 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, - 0x08, 0x44, 0x4f, 0x57, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, - 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x03, 0x12, 0x09, 0x0a, - 0x05, 0x55, 0x50, 0x5f, 0x49, 0x4e, 0x10, 0x04, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, - 0x05, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x52, 0x41, 0x49, 0x4e, 0x10, 0x06, 0x22, 0x5e, 0x0a, 0x13, - 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x69, - 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x67, 0x6d, - 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x2a, 0x25, 0x0a, 0x10, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x07, 0x0a, 0x03, 0x53, 0x43, 0x4d, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x56, 0x4d, - 0x45, 0x10, 0x01, 0x2a, 0x56, 0x0a, 0x10, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6e, 0x67, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x10, 0x01, - 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x02, - 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x65, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x10, 0x03, 0x12, 0x0b, - 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x04, 0x42, 0x3a, 0x5a, 0x38, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2d, 0x73, - 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x6d, 0x67, 0x6d, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x0a, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x5d, 0x0a, + 0x0f, 0x50, 0x6f, 0x6f, 0x6c, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, + 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x0e, + 0x50, 0x6f, 0x6f, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, + 0x0a, 0x03, 0x73, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x73, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x29, 0x0a, + 0x0f, 0x50, 0x6f, 0x6f, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x12, 0x50, 0x6f, 0x6f, + 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x10, 0x0a, 0x03, 0x73, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, + 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x76, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0d, 0x52, 0x08, 0x73, 0x76, 0x63, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x75, 0x0a, 0x12, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x65, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, 0x12, 0x35, 0x0a, 0x0a, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x16, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, + 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, + 0x79, 0x70, 0x65, 0x22, 0xda, 0x02, 0x0a, 0x13, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x6d, 0x67, 0x6d, 0x74, + 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x22, 0x3b, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, + 0x03, 0x48, 0x44, 0x44, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x53, 0x44, 0x10, 0x02, 0x12, + 0x06, 0x0a, 0x02, 0x50, 0x4d, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x56, 0x4d, 0x10, 0x04, 0x22, + 0x5f, 0x0a, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x11, + 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x4f, 0x57, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x01, 0x12, + 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, + 0x03, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x50, 0x5f, 0x49, 0x4e, 0x10, 0x04, 0x12, 0x07, 0x0a, 0x03, + 0x4e, 0x45, 0x57, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x52, 0x41, 0x49, 0x4e, 0x10, 0x06, + 0x22, 0x5e, 0x0a, 0x13, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2f, 0x0a, 0x05, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x6e, 0x66, 0x6f, 0x73, + 0x2a, 0x25, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x64, 0x69, 0x61, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x43, 0x4d, 0x10, 0x00, 0x12, 0x08, 0x0a, + 0x04, 0x4e, 0x56, 0x4d, 0x45, 0x10, 0x01, 0x2a, 0x56, 0x0a, 0x10, 0x50, 0x6f, 0x6f, 0x6c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x61, + 0x64, 0x79, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x69, + 0x6e, 0x67, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x65, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, + 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x04, 0x42, + 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, + 0x6f, 0x73, 0x2d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x72, + 0x63, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x67, 0x6d, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/src/control/lib/control/pool.go b/src/control/lib/control/pool.go index 99fd72c0bb8..ec446da27e2 100644 --- a/src/control/lib/control/pool.go +++ b/src/control/lib/control/pool.go @@ -12,7 +12,6 @@ import ( "fmt" "math" "sort" - "strconv" "strings" "time" @@ -448,49 +447,10 @@ type ( IncludeDisabledRanks bool } - // StorageUsageStats represents DAOS storage usage statistics. - StorageUsageStats struct { - Total uint64 `json:"total"` - Free uint64 `json:"free"` - Min uint64 `json:"min"` - Max uint64 `json:"max"` - Mean uint64 `json:"mean"` - MediaType StorageMediaType `json:"media_type"` - } - - // PoolRebuildState indicates the current state of the pool rebuild process. - PoolRebuildState int32 - - // PoolRebuildStatus contains detailed information about the pool rebuild process. - PoolRebuildStatus struct { - Status int32 `json:"status"` - State PoolRebuildState `json:"state"` - Objects uint64 `json:"objects"` - Records uint64 `json:"records"` - } - - // PoolInfo contains information about the pool. - PoolInfo struct { - TotalTargets uint32 `json:"total_targets"` - ActiveTargets uint32 `json:"active_targets"` - TotalEngines uint32 `json:"total_engines"` - DisabledTargets uint32 `json:"disabled_targets"` - Version uint32 `json:"version"` - Leader uint32 `json:"leader"` - Rebuild *PoolRebuildStatus `json:"rebuild"` - TierStats []*StorageUsageStats `json:"tier_stats"` - EnabledRanks *ranklist.RankSet `json:"-"` - DisabledRanks *ranklist.RankSet `json:"-"` - PoolLayoutVer uint32 `json:"pool_layout_ver"` - UpgradeLayoutVer uint32 `json:"upgrade_layout_ver"` - } - // PoolQueryResp contains the pool query response. PoolQueryResp struct { - Status int32 `json:"status"` - State system.PoolServiceState `json:"state"` - UUID string `json:"uuid"` - PoolInfo + Status int32 `json:"status"` + daos.PoolInfo } // PoolQueryTargetReq contains parameters for a pool query target request @@ -501,51 +461,29 @@ type ( Targets []uint32 } - StorageMediaType int32 - - // StorageTargetUsage represents DAOS target storage usage - StorageTargetUsage struct { - Total uint64 `json:"total"` - Free uint64 `json:"free"` - MediaType StorageMediaType `json:"media_type"` - } - - PoolQueryTargetType int32 - PoolQueryTargetState int32 - - // PoolQueryTargetInfo contains information about a single target - PoolQueryTargetInfo struct { - Type PoolQueryTargetType `json:"target_type"` - State PoolQueryTargetState `json:"target_state"` - Space []*StorageTargetUsage - } - // PoolQueryTargetResp contains a pool query target response PoolQueryTargetResp struct { Status int32 `json:"status"` - Infos []*PoolQueryTargetInfo + Infos []*daos.PoolQueryTargetInfo } ) -const ( - // StorageMediaTypeScm indicates that the media is storage class (persistent) memory - StorageMediaTypeScm StorageMediaType = iota - // StorageMediaTypeNvme indicates that the media is NVMe SSD - StorageMediaTypeNvme -) - func (pqr *PoolQueryResp) MarshalJSON() ([]byte, error) { if pqr == nil { return []byte("null"), nil } - type Alias PoolQueryResp + piJSON, err := json.Marshal(&pqr.PoolInfo) + if err != nil { + return nil, err + } + aux := &struct { EnabledRanks *[]ranklist.Rank `json:"enabled_ranks"` DisabledRanks *[]ranklist.Rank `json:"disabled_ranks"` - *Alias + Status int32 `json:"status"` }{ - Alias: (*Alias)(pqr), + Status: pqr.Status, } if pqr.EnabledRanks != nil { @@ -558,7 +496,15 @@ func (pqr *PoolQueryResp) MarshalJSON() ([]byte, error) { aux.DisabledRanks = &ranks } - return json.Marshal(&aux) + auxJSON, err := json.Marshal(&aux) + if err != nil { + return nil, err + } + + // Kinda gross, but needed to merge the embedded struct's MarshalJSON + // output with this one's. + piJSON[0] = ',' + return append(auxJSON[:len(auxJSON)-1], piJSON...), nil } func unmarshallRankSet(ranks string) (*ranklist.RankSet, error) { @@ -601,55 +547,16 @@ func (pqr *PoolQueryResp) UnmarshalJSON(data []byte) error { return nil } -const ( - // PoolRebuildStateIdle indicates that the rebuild process is idle. - PoolRebuildStateIdle PoolRebuildState = iota - // PoolRebuildStateDone indicates that the rebuild process has completed. - PoolRebuildStateDone - // PoolRebuildStateBusy indicates that the rebuild process is in progress. - PoolRebuildStateBusy -) - -func (prs PoolRebuildState) String() string { - prss, ok := mgmtpb.PoolRebuildStatus_State_name[int32(prs)] - if !ok { - return "unknown" - } - return strings.ToLower(prss) -} - -func (prs PoolRebuildState) MarshalJSON() ([]byte, error) { - stateStr, ok := mgmtpb.PoolRebuildStatus_State_name[int32(prs)] - if !ok { - return nil, errors.Errorf("invalid rebuild state %d", prs) - } - return []byte(`"` + strings.ToLower(stateStr) + `"`), nil -} - -func (prs *PoolRebuildState) UnmarshalJSON(data []byte) error { - stateStr := strings.ToUpper(string(data)) - state, ok := mgmtpb.PoolRebuildStatus_State_value[stateStr] - if !ok { - // Try converting the string to an int32, to handle the - // conversion from protobuf message using convert.Types(). - si, err := strconv.ParseInt(stateStr, 0, 32) - if err != nil { - return errors.Errorf("invalid rebuild state %q", stateStr) - } - - if _, ok = mgmtpb.PoolRebuildStatus_State_name[int32(si)]; !ok { - return errors.Errorf("invalid rebuild state %q", stateStr) - } - state = int32(si) - } - *prs = PoolRebuildState(state) - - return nil -} - // PoolQuery performs a pool query operation for the specified pool ID on a // DAOS Management Server instance. func PoolQuery(ctx context.Context, rpcClient UnaryInvoker, req *PoolQueryReq) (*PoolQueryResp, error) { + return poolQueryInt(ctx, rpcClient, req, nil) +} + +// poolQueryInt is the internal implementation of PoolQuery that +// allows the caller to supply an optional pointer to the response +// that will be filled out with the query details. +func poolQueryInt(ctx context.Context, rpcClient UnaryInvoker, req *PoolQueryReq, resp *PoolQueryResp) (*PoolQueryResp, error) { pbReq := &mgmtpb.PoolQueryReq{ Sys: req.getSystem(rpcClient), Id: req.ID, @@ -666,35 +573,36 @@ func PoolQuery(ctx context.Context, rpcClient UnaryInvoker, req *PoolQueryReq) ( return nil, err } - pqr := new(PoolQueryResp) - err = convertMSResponse(ur, pqr) - if err != nil { + if resp == nil { + resp = new(PoolQueryResp) + } + if err := convertMSResponse(ur, resp); err != nil { return nil, err } - err = pqr.UpdateState() + err = resp.UpdateState() if err != nil { return nil, err } - return pqr, err + return resp, err } // UpdateState update the pool state. func (pqr *PoolQueryResp) UpdateState() error { // Update the state as Ready if DAOS return code is 0. if pqr.Status == 0 { - pqr.State = system.PoolServiceStateReady + pqr.State = daos.PoolServiceStateReady } // Pool state is unknown, if TotalTargets is 0. if pqr.TotalTargets == 0 { - pqr.State = system.PoolServiceStateUnknown + pqr.State = daos.PoolServiceStateUnknown } // Update the Pool state as Degraded, if initial state is Ready and any target is disabled - if pqr.State == system.PoolServiceStateReady && pqr.DisabledTargets > 0 { - pqr.State = system.PoolServiceStateDegraded + if pqr.State == daos.PoolServiceStateReady && pqr.DisabledTargets > 0 { + pqr.State = daos.PoolServiceStateDegraded } return nil @@ -742,85 +650,21 @@ func PoolQueryTargets(ctx context.Context, rpcClient UnaryInvoker, req *PoolQuer return pqtr, nil } -func (smt StorageMediaType) MarshalJSON() ([]byte, error) { - typeStr, ok := mgmtpb.StorageMediaType_name[int32(smt)] - if !ok { - return nil, errors.Errorf("invalid storage media type %d", smt) - } - return []byte(`"` + strings.ToLower(typeStr) + `"`), nil -} - -func (smt StorageMediaType) String() string { - smts, ok := mgmtpb.StorageMediaType_name[int32(smt)] - if !ok { - return "unknown" - } - return strings.ToLower(smts) -} - -func (pqtt PoolQueryTargetType) MarshalJSON() ([]byte, error) { - typeStr, ok := mgmtpb.PoolQueryTargetInfo_TargetType_name[int32(pqtt)] - if !ok { - return nil, errors.Errorf("invalid target type %d", pqtt) - } - return []byte(`"` + strings.ToLower(typeStr) + `"`), nil -} - -func (ptt PoolQueryTargetType) String() string { - ptts, ok := mgmtpb.PoolQueryTargetInfo_TargetType_name[int32(ptt)] - if !ok { - return "invalid" - } - return strings.ToLower(ptts) -} - -const ( - PoolTargetStateUnknown PoolQueryTargetState = iota - // PoolTargetStateDownOut indicates the target is not available - PoolTargetStateDownOut - // PoolTargetStateDown indicates the target is not available, may need rebuild - PoolTargetStateDown - // PoolTargetStateUp indicates the target is up - PoolTargetStateUp - // PoolTargetStateUpIn indicates the target is up and running - PoolTargetStateUpIn - // PoolTargetStateNew indicates the target is in an intermediate state (pool map change) - PoolTargetStateNew - // PoolTargetStateDrain indicates the target is being drained - PoolTargetStateDrain -) - -func (pqts PoolQueryTargetState) MarshalJSON() ([]byte, error) { - stateStr, ok := mgmtpb.PoolQueryTargetInfo_TargetState_name[int32(pqts)] - if !ok { - return nil, errors.Errorf("invalid target state %d", pqts) - } - return []byte(`"` + strings.ToLower(stateStr) + `"`), nil -} - -func (pts PoolQueryTargetState) String() string { - ptss, ok := mgmtpb.PoolQueryTargetInfo_TargetState_name[int32(pts)] - if !ok { - return "invalid" - } - return strings.ToLower(ptss) -} - // For using the pretty printer that dmg uses for this target info. -func convertPoolTargetInfo(pbInfo *mgmtpb.PoolQueryTargetInfo) (*PoolQueryTargetInfo, error) { - pqti := new(PoolQueryTargetInfo) - pqti.Type = PoolQueryTargetType(pbInfo.Type) - pqti.State = PoolQueryTargetState(pbInfo.State) - pqti.Space = []*StorageTargetUsage{ +func convertPoolTargetInfo(pbInfo *mgmtpb.PoolQueryTargetInfo) (*daos.PoolQueryTargetInfo, error) { + pqti := new(daos.PoolQueryTargetInfo) + pqti.Type = daos.PoolQueryTargetType(pbInfo.Type) + pqti.State = daos.PoolQueryTargetState(pbInfo.State) + pqti.Space = []*daos.StorageUsageStats{ { - Total: uint64(pbInfo.Space[StorageMediaTypeScm].Total), - Free: uint64(pbInfo.Space[StorageMediaTypeScm].Free), - MediaType: StorageMediaTypeScm, + Total: uint64(pbInfo.Space[daos.StorageMediaTypeScm].Total), + Free: uint64(pbInfo.Space[daos.StorageMediaTypeScm].Free), + MediaType: daos.StorageMediaTypeScm, }, { - Total: uint64(pbInfo.Space[StorageMediaTypeNvme].Total), - Free: uint64(pbInfo.Space[StorageMediaTypeNvme].Free), - MediaType: StorageMediaTypeNvme, + Total: uint64(pbInfo.Space[daos.StorageMediaTypeNvme].Total), + Free: uint64(pbInfo.Space[daos.StorageMediaTypeNvme].Free), + MediaType: daos.StorageMediaTypeNvme, }, } @@ -1092,95 +936,6 @@ func PoolReintegrate(ctx context.Context, rpcClient UnaryInvoker, req *PoolReint return errors.Wrap(ur.getMSError(), "pool reintegrate failed") } -type ( - // PoolTierUsage describes usage of a single pool storage tier. - PoolTierUsage struct { - // TierName identifies a pool's storage tier. - TierName string `json:"tier_name"` - // Size is the total number of bytes in the pool tier. - Size uint64 `json:"size"` - // Free is the number of free bytes in the pool tier. - Free uint64 `json:"free"` - // Imbalance is the percentage imbalance of pool tier usage - // across all the targets. - Imbalance uint32 `json:"imbalance"` - } - - // Pool contains a representation of a DAOS Storage Pool including usage - // statistics. - Pool struct { - // UUID uniquely identifies a pool within the system. - UUID string `json:"uuid"` - // Label is an optional human-friendly identifier for a pool. - Label string `json:"label,omitempty"` - // ServiceLeader is the current pool service leader. - ServiceLeader uint32 `json:"svc_ldr"` - // ServiceReplicas is the list of ranks on which this pool's - // service replicas are running. - ServiceReplicas []ranklist.Rank `json:"svc_reps"` - // State is the current state of the pool. - State string `json:"state"` - - // TargetsTotal is the total number of targets in pool. - TargetsTotal uint32 `json:"targets_total"` - // TargetsDisabled is the number of inactive targets in pool. - TargetsDisabled uint32 `json:"targets_disabled"` - - // UpgradeLayoutVer is latest pool layout version to be upgraded. - UpgradeLayoutVer uint32 `json:"upgrade_layout_ver"` - // PoolLayoutVer is current pool layout version. - PoolLayoutVer uint32 `json:"pool_layout_ver"` - - // QueryErrorMsg reports an RPC error returned from a query. - QueryErrorMsg string `json:"query_error_msg"` - // QueryStatusMsg reports any DAOS error returned from a query - // operation converted into human readable message. - QueryStatusMsg string `json:"query_status_msg"` - - // Usage contains pool usage statistics for each storage tier. - Usage []*PoolTierUsage `json:"usage"` - - // PoolRebuildStatus contains detailed information about the pool rebuild process. - RebuildState string `json:"rebuild_state"` - } -) - -func (p *Pool) setUsage(pqr *PoolQueryResp) { - for idx, tu := range pqr.TierStats { - spread := tu.Max - tu.Min - imbalance := float64(spread) / (float64(tu.Total) / float64(pqr.ActiveTargets)) - - tn := "NVMe" - if idx == 0 { - tn = "SCM" - } - - p.Usage = append(p.Usage, - &PoolTierUsage{ - TierName: tn, - Size: tu.Total, - Free: tu.Free, - Imbalance: uint32(imbalance * 100), - }, - ) - } -} - -// HasErrors indicates whether a pool query operation failed on this pool. -func (p *Pool) HasErrors() bool { - return p.QueryErrorMsg != "" || p.QueryStatusMsg != "" -} - -// GetPool retrieves effective name for pool from either label or UUID. -func (p *Pool) GetName() string { - name := p.Label - if name == "" { - // use short version of uuid if no label - name = strings.Split(p.UUID, "-")[0] - } - return name -} - // ListPoolsReq contains the inputs for the list pools command. type ListPoolsReq struct { unaryRequest @@ -1188,11 +943,32 @@ type ListPoolsReq struct { NoQuery bool } +// PoolQueryErr contains the error if a pool query failed. +type PoolQueryErr struct { + Error error + Status daos.Status +} + // ListPoolsResp contains the status of the request and, if successful, the list // of pools in the system. type ListPoolsResp struct { - Status int32 `json:"status"` - Pools []*Pool `json:"pools"` + Status int32 `json:"status"` + Pools []*daos.PoolInfo `json:"pools"` + QueryErrors map[uuid.UUID]*PoolQueryErr `json:"-"` // NB: Exported because of tests in other packages. +} + +// PoolQueryError returns the error if PoolQuery failed for the given pool. +func (lpr *ListPoolsResp) PoolQueryError(poolUUID uuid.UUID) error { + qe, found := lpr.QueryErrors[poolUUID] + if !found { + return nil + } + + if qe.Status != daos.Success { + return qe.Status + } + + return qe.Error } // Validate returns error if response contents are unexpected, string of @@ -1202,27 +978,31 @@ func (lpr *ListPoolsResp) Validate() (string, error) { out := new(strings.Builder) for i, p := range lpr.Pools { - if p.UUID == "" { + if p.UUID == uuid.Nil { return "", errors.Errorf("pool with index %d has no uuid", i) } - if p.QueryErrorMsg != "" { - fmt.Fprintf(out, "Query on pool %q unsuccessful, error: %q\n", - p.GetName(), p.QueryErrorMsg) - continue // no usage stats expected - } - if p.QueryStatusMsg != "" { - fmt.Fprintf(out, "Query on pool %q unsuccessful, status: %q\n", - p.GetName(), p.QueryStatusMsg) - continue // no usage stats expected + if qe, found := lpr.QueryErrors[p.UUID]; found { + if qe.Error != nil { + fmt.Fprintf(out, "Query on pool %q unsuccessful, error: %q\n", + p.Name(), qe.Error) + continue // no usage stats expected + } + if qe.Status != daos.Success { + fmt.Fprintf(out, "Query on pool %q unsuccessful, status: %q\n", + p.Name(), qe.Status) + continue // no usage stats expected + } } - if len(p.Usage) == 0 { + + poolUsage := p.Usage() + if len(poolUsage) == 0 { continue // no usage stats in response } - if numTiers != 0 && len(p.Usage) != numTiers { + if numTiers != 0 && len(poolUsage) != numTiers { return "", errors.Errorf("pool %s has %d storage tiers, want %d", - p.UUID, len(p.Usage), numTiers) + p.UUID, len(poolUsage), numTiers) } - numTiers = len(p.Usage) + numTiers = len(poolUsage) } return out.String(), nil @@ -1240,6 +1020,12 @@ func (lpr *ListPoolsResp) Errors() error { return nil } +func newListPoolsResp() *ListPoolsResp { + return &ListPoolsResp{ + QueryErrors: make(map[uuid.UUID]*PoolQueryErr), + } +} + // ListPools fetches the list of all pools and their service replicas from the // system. func ListPools(ctx context.Context, rpcClient UnaryInvoker, req *ListPoolsReq) (*ListPoolsResp, error) { @@ -1254,7 +1040,7 @@ func ListPools(ctx context.Context, rpcClient UnaryInvoker, req *ListPoolsReq) ( return nil, err } - resp := new(ListPoolsResp) + resp := newListPoolsResp() if err := convertMSResponse(ur, resp); err != nil { return nil, err } @@ -1264,39 +1050,28 @@ func ListPools(ctx context.Context, rpcClient UnaryInvoker, req *ListPoolsReq) ( } // issue query request and populate usage statistics for each pool - for _, p := range resp.Pools { - if p.State != system.PoolServiceStateReady.String() { + for i, p := range resp.Pools { + if p.State != daos.PoolServiceStateReady { rpcClient.Debugf("Skipping query of pool in state: %s", p.State) continue } rpcClient.Debugf("Fetching details for discovered pool: %v", p) - resp, err := PoolQuery(ctx, rpcClient, &PoolQueryReq{ID: p.UUID}) + pqr := &PoolQueryResp{PoolInfo: *p} + _, err := poolQueryInt(ctx, rpcClient, &PoolQueryReq{ID: p.UUID.String()}, pqr) if err != nil { - p.QueryErrorMsg = err.Error() - if p.QueryErrorMsg == "" { - p.QueryErrorMsg = "unknown error" - } + resp.QueryErrors[p.UUID] = &PoolQueryErr{Error: err} continue } - if resp.Status != 0 { - p.QueryStatusMsg = daos.Status(resp.Status).Error() - if p.QueryStatusMsg == "" { - p.QueryStatusMsg = "unknown error" - } + if pqr.Status != 0 { + resp.QueryErrors[p.UUID] = &PoolQueryErr{Status: daos.Status(pqr.Status)} continue } - if p.UUID != resp.UUID { + if p.UUID != pqr.UUID { return nil, errors.New("pool query response uuid does not match request") - } - p.State = resp.State.String() - p.TargetsTotal = resp.TotalTargets - p.TargetsDisabled = resp.DisabledTargets - p.PoolLayoutVer = resp.PoolLayoutVer - p.UpgradeLayoutVer = resp.UpgradeLayoutVer - p.setUsage(resp) - p.RebuildState = resp.Rebuild.State.String() + } + resp.Pools[i] = &pqr.PoolInfo } sort.Slice(resp.Pools, func(i int, j int) bool { diff --git a/src/control/lib/control/pool_test.go b/src/control/lib/control/pool_test.go index 20370cf7f51..35838fd7032 100644 --- a/src/control/lib/control/pool_test.go +++ b/src/control/lib/control/pool_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2023 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -17,6 +17,7 @@ import ( "github.com/dustin/go-humanize" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/google/uuid" "github.com/pkg/errors" "github.com/daos-stack/daos/src/control/common/proto/convert" @@ -721,6 +722,8 @@ func TestControl_PoolCreate(t *testing.T) { } func TestControl_UpdateState(t *testing.T) { + poolUUID := test.MockPoolUUID() + for name, tc := range map[string]struct { pqr *PoolQueryResp expState string @@ -728,47 +731,47 @@ func TestControl_UpdateState(t *testing.T) { "Pool state as Ready": { pqr: &PoolQueryResp{ Status: 0, - UUID: "foo", - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 1, DisabledTargets: 0, }, }, - expState: system.PoolServiceStateReady.String(), + expState: daos.PoolServiceStateReady.String(), }, "Pool state as Degraded": { pqr: &PoolQueryResp{ Status: 0, - UUID: "foo", - State: system.PoolServiceStateReady, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 1, DisabledTargets: 4, + State: daos.PoolServiceStateReady, }, }, - expState: system.PoolServiceStateDegraded.String(), + expState: daos.PoolServiceStateDegraded.String(), }, "Pool state as Unknown": { pqr: &PoolQueryResp{ Status: 0, - UUID: "foo", - State: system.PoolServiceStateReady, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 0, + State: daos.PoolServiceStateReady, }, }, - expState: system.PoolServiceStateUnknown.String(), + expState: daos.PoolServiceStateUnknown.String(), }, "Pool state as Default": { pqr: &PoolQueryResp{ Status: 0, - UUID: "foo", - State: system.PoolServiceStateUnknown, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 1, + State: daos.PoolServiceStateUnknown, }, }, - expState: system.PoolServiceStateReady.String(), + expState: daos.PoolServiceStateReady.String(), }, } { t.Run(name, func(t *testing.T) { @@ -781,7 +784,9 @@ func TestControl_UpdateState(t *testing.T) { } } -func TestControl_PoolQueryResp_MarshallJSON(t *testing.T) { +func TestControl_PoolQueryResp_MarshalJSON(t *testing.T) { + poolUUID := test.MockPoolUUID() + for name, tc := range map[string]struct { pqr *PoolQueryResp exp string @@ -792,40 +797,42 @@ func TestControl_PoolQueryResp_MarshallJSON(t *testing.T) { "null rankset": { pqr: &PoolQueryResp{ Status: 0, - UUID: "foo", - State: system.PoolServiceStateReady, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + State: daos.PoolServiceStateReady, + UUID: poolUUID, TotalTargets: 1, ActiveTargets: 2, TotalEngines: 3, DisabledTargets: 4, Version: 5, - Leader: 6, + ServiceLeader: 6, + ServiceReplicas: []ranklist.Rank{0, 1, 2}, PoolLayoutVer: 7, UpgradeLayoutVer: 8, }, }, - exp: `{"enabled_ranks":null,"disabled_ranks":null,"status":0,"state":"Ready","uuid":"foo","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"leader":6,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, + exp: `{"enabled_ranks":null,"disabled_ranks":null,"status":0,"state":"Ready","uuid":"` + poolUUID.String() + `","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"svc_ldr":6,"svc_reps":[0,1,2],"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, }, "valid rankset": { pqr: &PoolQueryResp{ Status: 0, - UUID: "foo", - State: system.PoolServiceStateReady, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + State: daos.PoolServiceStateReady, + UUID: poolUUID, TotalTargets: 1, ActiveTargets: 2, TotalEngines: 3, DisabledTargets: 4, Version: 5, - Leader: 6, + ServiceLeader: 6, + ServiceReplicas: []ranklist.Rank{0, 1, 2}, EnabledRanks: ranklist.MustCreateRankSet("[0-3,5]"), DisabledRanks: &ranklist.RankSet{}, PoolLayoutVer: 7, UpgradeLayoutVer: 8, }, }, - exp: `{"enabled_ranks":[0,1,2,3,5],"disabled_ranks":[],"status":0,"state":"Ready","uuid":"foo","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"leader":6,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, + exp: `{"enabled_ranks":[0,1,2,3,5],"disabled_ranks":[],"status":0,"state":"Ready","uuid":"` + poolUUID.String() + `","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"svc_ldr":6,"svc_reps":[0,1,2],"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, }, } { t.Run(name, func(t *testing.T) { @@ -841,41 +848,43 @@ func TestControl_PoolQueryResp_MarshallJSON(t *testing.T) { } } -func TestControl_PoolQueryResp_UnmarshallJSON(t *testing.T) { +func TestControl_PoolQueryResp_UnmarshalJSON(t *testing.T) { + poolUUID := test.MockPoolUUID() + for name, tc := range map[string]struct { data string expResp PoolQueryResp expErr error }{ "null rankset": { - data: `{"enabled_ranks":null,"disabled_ranks":null,"status":0,"uuid":"foo","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"leader":6,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, + data: `{"enabled_ranks":null,"disabled_ranks":null,"status":0,"uuid":"` + poolUUID.String() + `","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"svc_ldr":6,"svc_reps":null,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, expResp: PoolQueryResp{ Status: 0, - UUID: "foo", - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 1, ActiveTargets: 2, TotalEngines: 3, DisabledTargets: 4, Version: 5, - Leader: 6, + ServiceLeader: 6, PoolLayoutVer: 7, UpgradeLayoutVer: 8, }, }, }, "valid rankset": { - data: `{"enabled_ranks":"[0,1-3,5]","disabled_ranks":"[]","status":0,"uuid":"foo","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"leader":6,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, + data: `{"enabled_ranks":"[0,1-3,5]","disabled_ranks":"[]","status":0,"uuid":"` + poolUUID.String() + `","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"svc_ldr":6,"svc_reps":null,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, expResp: PoolQueryResp{ Status: 0, - UUID: "foo", - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 1, ActiveTargets: 2, TotalEngines: 3, DisabledTargets: 4, Version: 5, - Leader: 6, + ServiceLeader: 6, EnabledRanks: ranklist.MustCreateRankSet("[0-3,5]"), DisabledRanks: &ranklist.RankSet{}, PoolLayoutVer: 7, @@ -888,7 +897,7 @@ func TestControl_PoolQueryResp_UnmarshallJSON(t *testing.T) { expErr: errors.New("invalid character"), }, "invalid rankset": { - data: `{"enabled_ranks":"a cow goes quack","disabled_ranks":null,"status":0,"uuid":"foo","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"leader":6,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, + data: `{"enabled_ranks":"a cow goes quack","disabled_ranks":null,"status":0,"uuid":"` + poolUUID.String() + `","total_targets":1,"active_targets":2,"total_engines":3,"disabled_targets":4,"version":5,"leader":6,"svc_reps":null,"rebuild":null,"tier_stats":null,"pool_layout_ver":7,"upgrade_layout_ver":8}`, expErr: errors.New("unexpected alphabetic character(s)"), }, } { @@ -908,6 +917,8 @@ func TestControl_PoolQueryResp_UnmarshallJSON(t *testing.T) { } func TestControl_PoolQuery(t *testing.T) { + poolUUID := test.MockPoolUUID() + for name, tc := range map[string]struct { mic *MockInvokerConfig req *PoolQueryReq @@ -930,7 +941,7 @@ func TestControl_PoolQuery(t *testing.T) { mic: &MockInvokerConfig{ UnaryResponse: MockMSResponse("host1", nil, &mgmtpb.PoolQueryResp{ - Uuid: test.MockUUID(), + Uuid: poolUUID.String(), TotalTargets: 42, ActiveTargets: 16, DisabledTargets: 17, @@ -949,7 +960,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: mgmtpb.StorageMediaType(StorageMediaTypeScm), + MediaType: mgmtpb.StorageMediaType(daos.StorageMediaTypeScm), }, { Total: 123456, @@ -957,34 +968,34 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: mgmtpb.StorageMediaType(StorageMediaTypeNvme), + MediaType: mgmtpb.StorageMediaType(daos.StorageMediaTypeNvme), }, }, }, ), }, expResp: &PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 42, ActiveTargets: 16, DisabledTargets: 17, PoolLayoutVer: 1, UpgradeLayoutVer: 2, - Rebuild: &PoolRebuildStatus{ - State: PoolRebuildStateBusy, + State: daos.PoolServiceStateDegraded, + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateBusy, Objects: 1, Records: 2, }, - TierStats: []*StorageUsageStats{ + TierStats: []*daos.StorageUsageStats{ { Total: 123456, Free: 0, Min: 1, Max: 2, Mean: 3, - MediaType: StorageMediaTypeScm, + MediaType: daos.StorageMediaTypeScm, }, { Total: 123456, @@ -992,7 +1003,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: StorageMediaTypeNvme, + MediaType: daos.StorageMediaTypeNvme, }, }, }, @@ -1002,7 +1013,7 @@ func TestControl_PoolQuery(t *testing.T) { mic: &MockInvokerConfig{ UnaryResponse: MockMSResponse("host1", nil, &mgmtpb.PoolQueryResp{ - Uuid: test.MockUUID(), + Uuid: poolUUID.String(), TotalTargets: 42, ActiveTargets: 16, DisabledTargets: 17, @@ -1021,7 +1032,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: mgmtpb.StorageMediaType(StorageMediaTypeScm), + MediaType: mgmtpb.StorageMediaType(daos.StorageMediaTypeScm), }, { Total: 123456, @@ -1029,7 +1040,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: mgmtpb.StorageMediaType(StorageMediaTypeNvme), + MediaType: mgmtpb.StorageMediaType(daos.StorageMediaTypeNvme), }, }, EnabledRanks: "[0,1,2,3,5]", @@ -1037,27 +1048,27 @@ func TestControl_PoolQuery(t *testing.T) { ), }, expResp: &PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 42, ActiveTargets: 16, DisabledTargets: 17, PoolLayoutVer: 1, UpgradeLayoutVer: 2, - Rebuild: &PoolRebuildStatus{ - State: PoolRebuildStateBusy, + State: daos.PoolServiceStateDegraded, + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateBusy, Objects: 1, Records: 2, }, - TierStats: []*StorageUsageStats{ + TierStats: []*daos.StorageUsageStats{ { Total: 123456, Free: 0, Min: 1, Max: 2, Mean: 3, - MediaType: StorageMediaTypeScm, + MediaType: daos.StorageMediaTypeScm, }, { Total: 123456, @@ -1065,7 +1076,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: StorageMediaTypeNvme, + MediaType: daos.StorageMediaTypeNvme, }, }, EnabledRanks: ranklist.MustCreateRankSet("[0-3,5]"), @@ -1076,7 +1087,7 @@ func TestControl_PoolQuery(t *testing.T) { mic: &MockInvokerConfig{ UnaryResponse: MockMSResponse("host1", nil, &mgmtpb.PoolQueryResp{ - Uuid: test.MockUUID(), + Uuid: poolUUID.String(), TotalTargets: 42, ActiveTargets: 16, DisabledTargets: 17, @@ -1095,7 +1106,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: mgmtpb.StorageMediaType(StorageMediaTypeScm), + MediaType: mgmtpb.StorageMediaType(daos.StorageMediaTypeScm), }, { Total: 123456, @@ -1103,7 +1114,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: mgmtpb.StorageMediaType(StorageMediaTypeNvme), + MediaType: mgmtpb.StorageMediaType(daos.StorageMediaTypeNvme), }, }, DisabledRanks: "[]", @@ -1111,27 +1122,27 @@ func TestControl_PoolQuery(t *testing.T) { ), }, expResp: &PoolQueryResp{ - UUID: test.MockUUID(), - State: system.PoolServiceStateDegraded, - PoolInfo: PoolInfo{ + PoolInfo: daos.PoolInfo{ + UUID: poolUUID, TotalTargets: 42, ActiveTargets: 16, DisabledTargets: 17, PoolLayoutVer: 1, UpgradeLayoutVer: 2, - Rebuild: &PoolRebuildStatus{ - State: PoolRebuildStateBusy, + State: daos.PoolServiceStateDegraded, + Rebuild: &daos.PoolRebuildStatus{ + State: daos.PoolRebuildStateBusy, Objects: 1, Records: 2, }, - TierStats: []*StorageUsageStats{ + TierStats: []*daos.StorageUsageStats{ { Total: 123456, Free: 0, Min: 1, Max: 2, Mean: 3, - MediaType: StorageMediaTypeScm, + MediaType: daos.StorageMediaTypeScm, }, { Total: 123456, @@ -1139,7 +1150,7 @@ func TestControl_PoolQuery(t *testing.T) { Min: 1, Max: 2, Mean: 3, - MediaType: StorageMediaTypeNvme, + MediaType: daos.StorageMediaTypeNvme, }, }, DisabledRanks: &ranklist.RankSet{}, @@ -1661,107 +1672,24 @@ func TestControl_PoolGetPropResp_MarshalJSON(t *testing.T) { } } -func TestControl_Pool_setUsage(t *testing.T) { - for name, tc := range map[string]struct { - status int32 - scmStats *StorageUsageStats - nvmeStats *StorageUsageStats - totalTargets uint32 - activeTargets uint32 - expPool *Pool - expErr error - }{ - "successful query": { - scmStats: &StorageUsageStats{ - Total: humanize.GByte * 30, - Free: humanize.GByte * 15, - Min: humanize.GByte * 1.6, - Max: humanize.GByte * 2, - }, - nvmeStats: &StorageUsageStats{ - Total: humanize.GByte * 500, - Free: humanize.GByte * 250, - Min: humanize.GByte * 29.5, - Max: humanize.GByte * 36, - }, - totalTargets: 8, - activeTargets: 8, - expPool: &Pool{ - Usage: []*PoolTierUsage{ - { - TierName: "SCM", - Size: humanize.GByte * 30, - Free: humanize.GByte * 15, - Imbalance: 10, - }, - { - TierName: "NVMe", - Size: humanize.GByte * 500, - Free: humanize.GByte * 250, - Imbalance: 10, - }, - }, - }, - }, - "disabled targets": { - scmStats: &StorageUsageStats{ - Total: humanize.GByte * 30, - Free: humanize.GByte * 15, - Min: humanize.GByte * 1.6, - Max: humanize.GByte * 2, - }, - nvmeStats: &StorageUsageStats{ - Total: humanize.GByte * 500, - Free: humanize.GByte * 250, - Min: humanize.GByte * 29.5, - Max: humanize.GByte * 36, - }, - totalTargets: 8, - activeTargets: 4, - expPool: &Pool{ - Usage: []*PoolTierUsage{ - { - TierName: "SCM", - Size: humanize.GByte * 30, - Free: humanize.GByte * 15, - Imbalance: 5, - }, - { - TierName: "NVMe", - Size: humanize.GByte * 500, - Free: humanize.GByte * 250, - Imbalance: 5, - }, - }, - }, - }, - } { - t.Run(name, func(t *testing.T) { - resp := &PoolQueryResp{Status: tc.status} - resp.TierStats = append(resp.TierStats, tc.scmStats, tc.nvmeStats) - resp.TotalTargets = tc.totalTargets - resp.ActiveTargets = tc.activeTargets - resp.DisabledTargets = tc.activeTargets - - pool := new(Pool) - pool.setUsage(resp) - - if diff := cmp.Diff(tc.expPool, pool); diff != "" { - t.Fatalf("Unexpected response (-want, +got):\n%s\n", diff) - } - }) - } -} - func TestControl_ListPools(t *testing.T) { queryResp := func(i int32) *mgmtpb.PoolQueryResp { + total := uint32(42) + disabled := uint32(0) + rebuildState := mgmtpb.PoolRebuildStatus_IDLE + if i%2 == 0 { + disabled = total - 16 + rebuildState = mgmtpb.PoolRebuildStatus_BUSY + } + active := uint32(total - disabled) + return &mgmtpb.PoolQueryResp{ Uuid: test.MockUUID(i), - TotalTargets: 42, - ActiveTargets: 16, - DisabledTargets: 17, + TotalTargets: total, + ActiveTargets: active, + DisabledTargets: disabled, Rebuild: &mgmtpb.PoolRebuildStatus{ - State: mgmtpb.PoolRebuildStatus_BUSY, + State: rebuildState, Objects: 1, Records: 2, }, @@ -1782,18 +1710,31 @@ func TestControl_ListPools(t *testing.T) { }, } } - expUsage := []*PoolTierUsage{ + expRebuildStatus := func(i uint32) *daos.PoolRebuildStatus { + rebuildState := daos.PoolRebuildStateIdle + if i%2 == 0 { + rebuildState = daos.PoolRebuildStateBusy + } + return &daos.PoolRebuildStatus{ + State: rebuildState, + Objects: 1, + Records: 2, + } + } + expTierStats := []*daos.StorageUsageStats{ { - TierName: "SCM", - Size: 123456, - Free: 0, - Imbalance: 12, + Total: 123456, + Free: 0, + Min: 1000, + Max: 2000, + Mean: 1500, }, { - TierName: "NVMe", - Size: 1234567, - Free: 600000, - Imbalance: 1, + Total: 1234567, + Free: 600000, + Min: 1000, + Max: 2000, + Mean: 15000, }, } @@ -1823,7 +1764,9 @@ func TestControl_ListPools(t *testing.T) { }, ), }, - expResp: &ListPoolsResp{}, + expResp: &ListPoolsResp{ + QueryErrors: make(map[uuid.UUID]*PoolQueryErr), + }, }, "one pool": { mic: &MockInvokerConfig{ @@ -1833,7 +1776,7 @@ func TestControl_ListPools(t *testing.T) { { Uuid: test.MockUUID(1), SvcReps: []uint32{1, 3, 5, 8}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), }, }, }), @@ -1841,17 +1784,18 @@ func TestControl_ListPools(t *testing.T) { }, }, expResp: &ListPoolsResp{ - Pools: []*Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + State: daos.PoolServiceStateReady, + UUID: test.MockPoolUUID(1), + TotalTargets: 42, + ActiveTargets: 42, ServiceReplicas: []ranklist.Rank{1, 3, 5, 8}, - TargetsTotal: 42, - TargetsDisabled: 17, - Usage: expUsage, - State: system.PoolServiceStateDegraded.String(), - RebuildState: "busy", + Rebuild: expRebuildStatus(1), + TierStats: expTierStats, }, }, + QueryErrors: make(map[uuid.UUID]*PoolQueryErr), }, }, "one pool; uuid mismatch in query response": { @@ -1862,7 +1806,7 @@ func TestControl_ListPools(t *testing.T) { { Uuid: test.MockUUID(1), SvcReps: []uint32{1, 3, 5, 8}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), }, }, }), @@ -1879,12 +1823,12 @@ func TestControl_ListPools(t *testing.T) { { Uuid: test.MockUUID(1), SvcReps: []uint32{1, 3, 5, 8}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), }, { Uuid: test.MockUUID(2), SvcReps: []uint32{1, 2, 3}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), }, }, }), @@ -1893,26 +1837,28 @@ func TestControl_ListPools(t *testing.T) { }, }, expResp: &ListPoolsResp{ - Pools: []*Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + State: daos.PoolServiceStateReady, + UUID: test.MockPoolUUID(1), + TotalTargets: 42, + ActiveTargets: 42, ServiceReplicas: []ranklist.Rank{1, 3, 5, 8}, - TargetsTotal: 42, - TargetsDisabled: 17, - Usage: expUsage, - State: system.PoolServiceStateDegraded.String(), - RebuildState: "busy", + Rebuild: expRebuildStatus(1), + TierStats: expTierStats, }, { - UUID: test.MockUUID(2), + State: daos.PoolServiceStateDegraded, + UUID: test.MockPoolUUID(2), + TotalTargets: 42, + ActiveTargets: 16, + DisabledTargets: 26, ServiceReplicas: []ranklist.Rank{1, 2, 3}, - TargetsTotal: 42, - TargetsDisabled: 17, - Usage: expUsage, - State: system.PoolServiceStateDegraded.String(), - RebuildState: "busy", + Rebuild: expRebuildStatus(2), + TierStats: expTierStats, }, }, + QueryErrors: make(map[uuid.UUID]*PoolQueryErr), }, }, "two pools; one query has error": { @@ -1923,13 +1869,13 @@ func TestControl_ListPools(t *testing.T) { { Uuid: test.MockUUID(1), SvcReps: []uint32{1, 3, 5, 8}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), RebuildState: "busy", }, { Uuid: test.MockUUID(2), SvcReps: []uint32{1, 2, 3}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), RebuildState: "busy", }, }, @@ -1939,22 +1885,26 @@ func TestControl_ListPools(t *testing.T) { }, }, expResp: &ListPoolsResp{ - Pools: []*Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + State: daos.PoolServiceStateReady, + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{1, 3, 5, 8}, - QueryErrorMsg: "remote failed", - State: system.PoolServiceStateReady.String(), - RebuildState: "busy", }, { - UUID: test.MockUUID(2), + State: daos.PoolServiceStateDegraded, + UUID: test.MockPoolUUID(2), + TotalTargets: 42, + ActiveTargets: 16, + DisabledTargets: 26, ServiceReplicas: []ranklist.Rank{1, 2, 3}, - TargetsTotal: 42, - TargetsDisabled: 17, - Usage: expUsage, - State: system.PoolServiceStateDegraded.String(), - RebuildState: "busy", + Rebuild: expRebuildStatus(2), + TierStats: expTierStats, + }, + }, + QueryErrors: map[uuid.UUID]*PoolQueryErr{ + test.MockPoolUUID(1): { + Error: errors.New("remote failed"), }, }, }, @@ -1967,13 +1917,13 @@ func TestControl_ListPools(t *testing.T) { { Uuid: test.MockUUID(1), SvcReps: []uint32{1, 3, 5, 8}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), RebuildState: "busy", }, { Uuid: test.MockUUID(2), SvcReps: []uint32{1, 2, 3}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), RebuildState: "busy", }, }, @@ -1985,22 +1935,26 @@ func TestControl_ListPools(t *testing.T) { }, }, expResp: &ListPoolsResp{ - Pools: []*Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + State: daos.PoolServiceStateReady, + UUID: test.MockPoolUUID(1), ServiceReplicas: []ranklist.Rank{1, 3, 5, 8}, - QueryStatusMsg: "DER_UNINIT(-1015): Device or resource not initialized", - State: system.PoolServiceStateReady.String(), - RebuildState: "busy", }, { - UUID: test.MockUUID(2), + State: daos.PoolServiceStateDegraded, + UUID: test.MockPoolUUID(2), + TotalTargets: 42, + ActiveTargets: 16, + DisabledTargets: 26, ServiceReplicas: []ranklist.Rank{1, 2, 3}, - TargetsTotal: 42, - TargetsDisabled: 17, - Usage: expUsage, - State: system.PoolServiceStateDegraded.String(), - RebuildState: "busy", + Rebuild: expRebuildStatus(2), + TierStats: expTierStats, + }, + }, + QueryErrors: map[uuid.UUID]*PoolQueryErr{ + test.MockPoolUUID(1): { + Status: daos.NotInit, }, }, }, @@ -2013,12 +1967,12 @@ func TestControl_ListPools(t *testing.T) { { Uuid: test.MockUUID(1), SvcReps: []uint32{1, 3, 5, 8}, - State: system.PoolServiceStateReady.String(), + State: daos.PoolServiceStateReady.String(), }, { Uuid: test.MockUUID(2), SvcReps: []uint32{1, 2, 3}, - State: system.PoolServiceStateDestroying.String(), + State: daos.PoolServiceStateDestroying.String(), RebuildState: "busy", }, }, @@ -2028,23 +1982,23 @@ func TestControl_ListPools(t *testing.T) { }, }, expResp: &ListPoolsResp{ - Pools: []*Pool{ + Pools: []*daos.PoolInfo{ { - UUID: test.MockUUID(1), + State: daos.PoolServiceStateReady, + UUID: test.MockPoolUUID(1), + TotalTargets: 42, + ActiveTargets: 42, ServiceReplicas: []ranklist.Rank{1, 3, 5, 8}, - TargetsTotal: 42, - TargetsDisabled: 17, - Usage: expUsage, - State: system.PoolServiceStateDegraded.String(), - RebuildState: "busy", + Rebuild: expRebuildStatus(1), + TierStats: expTierStats, }, { - UUID: test.MockUUID(2), + State: daos.PoolServiceStateDestroying, + UUID: test.MockPoolUUID(2), ServiceReplicas: []ranklist.Rank{1, 2, 3}, - State: system.PoolServiceStateDestroying.String(), - RebuildState: "busy", }, }, + QueryErrors: make(map[uuid.UUID]*PoolQueryErr), }, }, } { @@ -2070,7 +2024,10 @@ func TestControl_ListPools(t *testing.T) { return } - if diff := cmp.Diff(tc.expResp, gotResp); diff != "" { + cmpOpts := []cmp.Option{ + cmp.Comparer(test.CmpErrBool), + } + if diff := cmp.Diff(tc.expResp, gotResp, cmpOpts...); diff != "" { t.Fatalf("unexpected response (-want, +got):\n%s\n", diff) } }) diff --git a/src/control/lib/daos/pool.go b/src/control/lib/daos/pool.go new file mode 100644 index 00000000000..a0ce38acda3 --- /dev/null +++ b/src/control/lib/daos/pool.go @@ -0,0 +1,296 @@ +// +// (C) Copyright 2020-2024 Intel Corporation. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +package daos + +import ( + "encoding/json" + "strconv" + "strings" + + "github.com/google/uuid" + "github.com/pkg/errors" + + mgmtpb "github.com/daos-stack/daos/src/control/common/proto/mgmt" + "github.com/daos-stack/daos/src/control/lib/ranklist" +) + +type ( + // PoolTierUsage describes usage of a single pool storage tier in + // a simpler format. + PoolTierUsage struct { + // TierName identifies a pool's storage tier. + TierName string `json:"tier_name"` + // Size is the total number of bytes in the pool tier. + Size uint64 `json:"size"` + // Free is the number of free bytes in the pool tier. + Free uint64 `json:"free"` + // Imbalance is the percentage imbalance of pool tier usage + // across all the targets. + Imbalance uint32 `json:"imbalance"` + } + + // StorageUsageStats represents raw DAOS storage usage statistics. + StorageUsageStats struct { + Total uint64 `json:"total"` + Free uint64 `json:"free"` + Min uint64 `json:"min"` + Max uint64 `json:"max"` + Mean uint64 `json:"mean"` + MediaType StorageMediaType `json:"media_type"` + } + + // PoolRebuildStatus contains detailed information about the pool rebuild process. + PoolRebuildStatus struct { + Status int32 `json:"status"` + State PoolRebuildState `json:"state"` + Objects uint64 `json:"objects"` + Records uint64 `json:"records"` + } + + // PoolInfo contains information about the pool. + PoolInfo struct { + State PoolServiceState `json:"state"` + UUID uuid.UUID `json:"uuid"` + Label string `json:"label,omitempty"` + TotalTargets uint32 `json:"total_targets"` + ActiveTargets uint32 `json:"active_targets"` + TotalEngines uint32 `json:"total_engines"` + DisabledTargets uint32 `json:"disabled_targets"` + Version uint32 `json:"version"` + ServiceLeader uint32 `json:"svc_ldr"` + ServiceReplicas []ranklist.Rank `json:"svc_reps,omitempty"` + Rebuild *PoolRebuildStatus `json:"rebuild"` + TierStats []*StorageUsageStats `json:"tier_stats"` + EnabledRanks *ranklist.RankSet `json:"-"` + DisabledRanks *ranklist.RankSet `json:"-"` + PoolLayoutVer uint32 `json:"pool_layout_ver"` + UpgradeLayoutVer uint32 `json:"upgrade_layout_ver"` + } + + PoolQueryTargetType int32 + PoolQueryTargetState int32 + + // PoolQueryTargetInfo contains information about a single target + PoolQueryTargetInfo struct { + Type PoolQueryTargetType `json:"target_type"` + State PoolQueryTargetState `json:"target_state"` + Space []*StorageUsageStats `json:"space"` + } + + // StorageTargetUsage represents DAOS target storage usage + StorageTargetUsage struct { + Total uint64 `json:"total"` + Free uint64 `json:"free"` + MediaType StorageMediaType `json:"media_type"` + } +) + +func (srs *StorageUsageStats) calcImbalance(targCount uint32) uint32 { + spread := srs.Max - srs.Min + return uint32((float64(spread) / (float64(srs.Total) / float64(targCount))) * 100) +} + +func (pi *PoolInfo) MarshalJSON() ([]byte, error) { + type Alias PoolInfo + + return json.Marshal(&struct { + *Alias + Usage []*PoolTierUsage `json:"usage,omitempty"` + }{ + Alias: (*Alias)(pi), + Usage: pi.Usage(), + }) +} + +// Usage returns a slice of PoolTierUsage objects describing the pool's storage +// usage in a simpler format. +func (pi *PoolInfo) Usage() []*PoolTierUsage { + var tiers []*PoolTierUsage + for _, tier := range pi.TierStats { + tiers = append(tiers, &PoolTierUsage{ + TierName: strings.ToUpper(tier.MediaType.String()), + Size: tier.Total, + Free: tier.Free, + Imbalance: tier.calcImbalance(pi.ActiveTargets), + }) + } + return tiers +} + +// RebuildState returns a string representation of the pool rebuild state. +func (pi *PoolInfo) RebuildState() string { + if pi.Rebuild == nil { + return "Unknown" + } + return pi.Rebuild.State.String() +} + +// Name retrieves effective name for pool from either label or UUID. +func (pi *PoolInfo) Name() string { + name := pi.Label + if name == "" { + // use short version of uuid if no label + name = strings.Split(pi.UUID.String(), "-")[0] + } + return name +} + +// PoolServiceState is used to represent the state of the pool service +type PoolServiceState uint + +const ( + // PoolServiceStateCreating indicates that the pool service is being created + PoolServiceStateCreating = PoolServiceState(mgmtpb.PoolServiceState_Creating) + // PoolServiceStateReady indicates that the pool service is ready to be used + PoolServiceStateReady = PoolServiceState(mgmtpb.PoolServiceState_Ready) + // PoolServiceStateDestroying indicates that the pool service is being destroyed + PoolServiceStateDestroying = PoolServiceState(mgmtpb.PoolServiceState_Destroying) + // PoolServiceStateDegraded indicates that the pool service is in a degraded state + PoolServiceStateDegraded = PoolServiceState(mgmtpb.PoolServiceState_Degraded) + // PoolServiceStateUnknown indicates that the pool service state is unknown + PoolServiceStateUnknown = PoolServiceState(mgmtpb.PoolServiceState_Unknown) +) + +func (pss PoolServiceState) String() string { + psss, ok := mgmtpb.PoolServiceState_name[int32(pss)] + if !ok { + return "invalid" + } + return psss +} + +func (pss PoolServiceState) MarshalJSON() ([]byte, error) { + return []byte(`"` + pss.String() + `"`), nil +} + +func unmarshalStrVal(inStr string, name2Vals map[string]int32, val2Names map[int32]string) (int32, error) { + intVal, found := name2Vals[inStr] + if found { + return intVal, nil + } + // Try converting the string to an int32, to handle the + // conversion from protobuf message using convert.Types(). + val, err := strconv.ParseInt(inStr, 0, 32) + if err != nil { + return 0, errors.Errorf("non-numeric string value %q", inStr) + } + + if _, ok := val2Names[int32(val)]; !ok { + return 0, errors.Errorf("unable to resolve string to value %q", inStr) + } + return int32(val), nil +} + +func (pss *PoolServiceState) UnmarshalJSON(data []byte) error { + stateStr := strings.Trim(string(data), "\"") + + state, err := unmarshalStrVal(stateStr, mgmtpb.PoolServiceState_value, mgmtpb.PoolServiceState_name) + if err != nil { + return errors.Wrap(err, "failed to unmarshal PoolServiceState") + } + *pss = PoolServiceState(state) + + return nil +} + +// StorageMediaType indicates the type of storage. +type StorageMediaType int32 + +const ( + // StorageMediaTypeScm indicates that the media is storage class (persistent) memory + StorageMediaTypeScm = StorageMediaType(mgmtpb.StorageMediaType_SCM) + // StorageMediaTypeNvme indicates that the media is NVMe SSD + StorageMediaTypeNvme = StorageMediaType(mgmtpb.StorageMediaType_NVME) +) + +func (smt StorageMediaType) String() string { + smts, ok := mgmtpb.StorageMediaType_name[int32(smt)] + if !ok { + return "unknown" + } + return strings.ToLower(smts) +} + +func (smt StorageMediaType) MarshalJSON() ([]byte, error) { + return []byte(`"` + smt.String() + `"`), nil +} + +// PoolRebuildState indicates the current state of the pool rebuild process. +type PoolRebuildState int32 + +const ( + // PoolRebuildStateIdle indicates that the rebuild process is idle. + PoolRebuildStateIdle = PoolRebuildState(mgmtpb.PoolRebuildStatus_IDLE) + // PoolRebuildStateDone indicates that the rebuild process has completed. + PoolRebuildStateDone = PoolRebuildState(mgmtpb.PoolRebuildStatus_DONE) + // PoolRebuildStateBusy indicates that the rebuild process is in progress. + PoolRebuildStateBusy = PoolRebuildState(mgmtpb.PoolRebuildStatus_BUSY) +) + +func (prs PoolRebuildState) String() string { + prss, ok := mgmtpb.PoolRebuildStatus_State_name[int32(prs)] + if !ok { + return "unknown" + } + return strings.ToLower(prss) +} + +func (prs PoolRebuildState) MarshalJSON() ([]byte, error) { + return []byte(`"` + prs.String() + `"`), nil +} + +func (prs *PoolRebuildState) UnmarshalJSON(data []byte) error { + stateStr := strings.ToUpper(string(data)) + + state, err := unmarshalStrVal(stateStr, mgmtpb.PoolRebuildStatus_State_value, mgmtpb.PoolRebuildStatus_State_name) + if err != nil { + return errors.Wrap(err, "failed to unmarshal PoolRebuildState") + } + *prs = PoolRebuildState(state) + + return nil +} + +func (ptt PoolQueryTargetType) String() string { + ptts, ok := mgmtpb.PoolQueryTargetInfo_TargetType_name[int32(ptt)] + if !ok { + return "invalid" + } + return strings.ToLower(ptts) +} + +func (pqtt PoolQueryTargetType) MarshalJSON() ([]byte, error) { + return []byte(`"` + pqtt.String() + `"`), nil +} + +const ( + PoolTargetStateUnknown = PoolQueryTargetState(mgmtpb.PoolQueryTargetInfo_STATE_UNKNOWN) + // PoolTargetStateDownOut indicates the target is not available + PoolTargetStateDownOut = PoolQueryTargetState(mgmtpb.PoolQueryTargetInfo_DOWN_OUT) + // PoolTargetStateDown indicates the target is not available, may need rebuild + PoolTargetStateDown = PoolQueryTargetState(mgmtpb.PoolQueryTargetInfo_DOWN) + // PoolTargetStateUp indicates the target is up + PoolTargetStateUp = PoolQueryTargetState(mgmtpb.PoolQueryTargetInfo_UP) + // PoolTargetStateUpIn indicates the target is up and running + PoolTargetStateUpIn = PoolQueryTargetState(mgmtpb.PoolQueryTargetInfo_UP_IN) + // PoolTargetStateNew indicates the target is in an intermediate state (pool map change) + PoolTargetStateNew = PoolQueryTargetState(mgmtpb.PoolQueryTargetInfo_NEW) + // PoolTargetStateDrain indicates the target is being drained + PoolTargetStateDrain = PoolQueryTargetState(mgmtpb.PoolQueryTargetInfo_DRAIN) +) + +func (pqts PoolQueryTargetState) String() string { + pqtss, ok := mgmtpb.PoolQueryTargetInfo_TargetState_name[int32(pqts)] + if !ok { + return "invalid" + } + return strings.ToLower(pqtss) +} + +func (pqts PoolQueryTargetState) MarshalJSON() ([]byte, error) { + return []byte(`"` + pqts.String() + `"`), nil +} diff --git a/src/control/lib/daos/pool_test.go b/src/control/lib/daos/pool_test.go new file mode 100644 index 00000000000..5e57f6b56e4 --- /dev/null +++ b/src/control/lib/daos/pool_test.go @@ -0,0 +1,104 @@ +// +// (C) Copyright 2020-2024 Intel Corporation. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +package daos + +import ( + "testing" + + "github.com/dustin/go-humanize" + "github.com/google/go-cmp/cmp" +) + +func TestDaos_PoolInfo_Usage(t *testing.T) { + for name, tc := range map[string]struct { + status int32 + scmStats *StorageUsageStats + nvmeStats *StorageUsageStats + totalTargets uint32 + activeTargets uint32 + expUsage []*PoolTierUsage + expErr error + }{ + "successful query": { + scmStats: &StorageUsageStats{ + MediaType: MediaTypeScm, + Total: humanize.GByte * 30, + Free: humanize.GByte * 15, + Min: humanize.GByte * 1.6, + Max: humanize.GByte * 2, + }, + nvmeStats: &StorageUsageStats{ + MediaType: StorageMediaTypeNvme, + Total: humanize.GByte * 500, + Free: humanize.GByte * 250, + Min: humanize.GByte * 29.5, + Max: humanize.GByte * 36, + }, + totalTargets: 8, + activeTargets: 8, + expUsage: []*PoolTierUsage{ + { + TierName: "SCM", + Size: humanize.GByte * 30, + Free: humanize.GByte * 15, + Imbalance: 10, + }, + { + TierName: "NVME", + Size: humanize.GByte * 500, + Free: humanize.GByte * 250, + Imbalance: 10, + }, + }, + }, + "disabled targets": { + scmStats: &StorageUsageStats{ + MediaType: MediaTypeScm, + Total: humanize.GByte * 30, + Free: humanize.GByte * 15, + Min: humanize.GByte * 1.6, + Max: humanize.GByte * 2, + }, + nvmeStats: &StorageUsageStats{ + MediaType: MediaTypeNvme, + Total: humanize.GByte * 500, + Free: humanize.GByte * 250, + Min: humanize.GByte * 29.5, + Max: humanize.GByte * 36, + }, + totalTargets: 8, + activeTargets: 4, + expUsage: []*PoolTierUsage{ + { + TierName: "SCM", + Size: humanize.GByte * 30, + Free: humanize.GByte * 15, + Imbalance: 5, + }, + { + TierName: "NVME", + Size: humanize.GByte * 500, + Free: humanize.GByte * 250, + Imbalance: 5, + }, + }, + }, + } { + t.Run(name, func(t *testing.T) { + pool := &PoolInfo{ + TotalTargets: tc.totalTargets, + ActiveTargets: tc.activeTargets, + DisabledTargets: tc.activeTargets, + TierStats: append([]*StorageUsageStats{}, tc.scmStats, tc.nvmeStats), + } + + if diff := cmp.Diff(tc.expUsage, pool.Usage()); diff != "" { + t.Fatalf("Unexpected response (-want, +got):\n%s\n", diff) + } + }) + } +} diff --git a/src/control/server/mgmt_pool.go b/src/control/server/mgmt_pool.go index 7cdc04bd1a4..8f3f35756cc 100644 --- a/src/control/server/mgmt_pool.go +++ b/src/control/server/mgmt_pool.go @@ -299,7 +299,7 @@ func (svc *mgmtSvc) poolCreate(parent context.Context, req *mgmtpb.PoolCreateReq return nil, errors.Wrap(err, "query on already-created pool failed") } - resp.SvcLdr = qr.Leader + resp.SvcLdr = qr.SvcLdr resp.SvcReps = ranklist.RanksToUint32(ps.Replicas) resp.TgtRanks = ranklist.RanksToUint32(ps.Storage.CreationRanks()) resp.TierBytes = ps.Storage.PerRankTierStorage @@ -939,6 +939,9 @@ func (svc *mgmtSvc) PoolQuery(ctx context.Context, req *mgmtpb.PoolQueryReq) (*m return nil, errors.Wrap(err, "unmarshal PoolQuery response") } + // Preserve compatibility with pre-2.6 callers. + resp.Leader = resp.SvcLdr + return resp, nil } diff --git a/src/control/server/mgmt_pool_test.go b/src/control/server/mgmt_pool_test.go index d7d255cbf49..a3584f1829b 100644 --- a/src/control/server/mgmt_pool_test.go +++ b/src/control/server/mgmt_pool_test.go @@ -117,7 +117,7 @@ func TestServer_MgmtSvc_PoolCreateAlreadyExists(t *testing.T) { "ready": { state: system.PoolServiceStateReady, queryResp: &mgmtpb.PoolQueryResp{ - Leader: 1, + SvcLdr: 1, }, expResp: &mgmtpb.PoolCreateResp{ SvcLdr: 1, @@ -2066,6 +2066,25 @@ func TestServer_MgmtSvc_PoolQuery(t *testing.T) { Uuid: mockUUID, }, }, + "successful query (includes pre-2.6 Leader field)": { + req: &mgmtpb.PoolQueryReq{ + Id: mockUUID, + }, + setupMockDrpc: func(svc *mgmtSvc, err error) { + resp := &mgmtpb.PoolQueryResp{ + State: mgmtpb.PoolServiceState_Ready, + Uuid: mockUUID, + SvcLdr: 42, + } + setupMockDrpcClient(svc, resp, nil) + }, + expResp: &mgmtpb.PoolQueryResp{ + State: mgmtpb.PoolServiceState_Ready, + Uuid: mockUUID, + SvcLdr: 42, + Leader: 42, + }, + }, } { t.Run(name, func(t *testing.T) { buf.Reset() diff --git a/src/control/system/pool.go b/src/control/system/pool.go index f029f0628da..9720e792557 100644 --- a/src/control/system/pool.go +++ b/src/control/system/pool.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2022-2023 Intel Corporation. +// (C) Copyright 2022-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -8,61 +8,57 @@ package system import ( "fmt" - "strconv" - "strings" "sync" "time" "github.com/dustin/go-humanize" "github.com/google/uuid" - "github.com/pkg/errors" - mgmtpb "github.com/daos-stack/daos/src/control/common/proto/mgmt" - . "github.com/daos-stack/daos/src/control/lib/ranklist" -) - -const ( - // PoolServiceStateCreating indicates that the pool service is being created - PoolServiceStateCreating PoolServiceState = iota - // PoolServiceStateReady indicates that the pool service is ready to be used - PoolServiceStateReady - // PoolServiceStateDestroying indicates that the pool service is being destroyed - PoolServiceStateDestroying - // PoolServiceStateDegraded indicates that the pool service is being Degraded - PoolServiceStateDegraded - // PoolServiceStateUnknown indicates that the pool service is Unknown state - PoolServiceStateUnknown + "github.com/daos-stack/daos/src/control/lib/daos" + "github.com/daos-stack/daos/src/control/lib/ranklist" ) type ( - // PoolServiceState is used to represent the state of the pool service - PoolServiceState uint - // PoolServiceStorage holds information about the pool storage. PoolServiceStorage struct { sync.Mutex - CreationRankStr string // string rankset set at creation - creationRanks *RankSet // used to reconstitute the rankset - CurrentRankStr string // string rankset representing current ranks - currentRanks *RankSet // used to reconstitute the rankset - PerRankTierStorage []uint64 // storage allocated to each tier on a rank + CreationRankStr string // string rankset set at creation + creationRanks *ranklist.RankSet // used to reconstitute the rankset + CurrentRankStr string // string rankset representing current ranks + currentRanks *ranklist.RankSet // used to reconstitute the rankset + PerRankTierStorage []uint64 // storage allocated to each tier on a rank } + // PoolServiceState is a local type alias for daos.PoolServiceState. + // NB: We use this to insulate the system DB from any incompatible + // changes made to the daos.PoolServiceState type. + PoolServiceState daos.PoolServiceState + // PoolService represents a pool service created to manage metadata // for a DAOS Pool. PoolService struct { PoolUUID uuid.UUID PoolLabel string State PoolServiceState - Replicas []Rank + Replicas []ranklist.Rank Storage *PoolServiceStorage LastUpdate time.Time } ) +const ( + PoolServiceStateCreating = PoolServiceState(daos.PoolServiceStateCreating) + PoolServiceStateReady = PoolServiceState(daos.PoolServiceStateReady) + PoolServiceStateDestroying = PoolServiceState(daos.PoolServiceStateDestroying) +) + +func (pss PoolServiceState) String() string { + return daos.PoolServiceState(pss).String() +} + // NewPoolService returns a properly-initialized *PoolService. -func NewPoolService(uuid uuid.UUID, tierStorage []uint64, ranks []Rank) *PoolService { - rs := RankSetFromRanks(ranks) +func NewPoolService(uuid uuid.UUID, tierStorage []uint64, ranks []ranklist.Rank) *PoolService { + rs := ranklist.RankSetFromRanks(ranks) return &PoolService{ PoolUUID: uuid, State: PoolServiceStateCreating, @@ -76,13 +72,13 @@ func NewPoolService(uuid uuid.UUID, tierStorage []uint64, ranks []Rank) *PoolSer // CreationRanks returns the set of target ranks associated // with the pool's creation. -func (pss *PoolServiceStorage) CreationRanks() []Rank { +func (pss *PoolServiceStorage) CreationRanks() []ranklist.Rank { pss.Lock() defer pss.Unlock() if pss.creationRanks == nil { var err error - pss.creationRanks, err = CreateRankSet(pss.CreationRankStr) + pss.creationRanks, err = ranklist.CreateRankSet(pss.CreationRankStr) if err != nil { return nil } @@ -92,13 +88,13 @@ func (pss *PoolServiceStorage) CreationRanks() []Rank { // CurrentRanks returns the set of target ranks associated // with the pool's current. -func (pss *PoolServiceStorage) CurrentRanks() []Rank { +func (pss *PoolServiceStorage) CurrentRanks() []ranklist.Rank { pss.Lock() defer pss.Unlock() if pss.currentRanks == nil { var err error - pss.currentRanks, err = CreateRankSet(pss.CurrentRankStr) + pss.currentRanks, err = ranklist.CreateRankSet(pss.CurrentRankStr) if err != nil { return nil } @@ -138,43 +134,3 @@ func (pss *PoolServiceStorage) String() string { humanize.Bytes(pss.TotalSCM()), humanize.Bytes(pss.TotalNVMe())) } - -func (pss PoolServiceState) String() string { - return [...]string{ - "Creating", - "Ready", - "Destroying", - "Degraded", - "Unknown", - }[pss] -} - -func (pss PoolServiceState) MarshalJSON() ([]byte, error) { - stateStr, ok := mgmtpb.PoolServiceState_name[int32(pss)] - if !ok { - return nil, errors.Errorf("invalid Pool Service state %d", pss) - } - return []byte(`"` + stateStr + `"`), nil -} - -func (pss *PoolServiceState) UnmarshalJSON(data []byte) error { - stateStr := strings.Trim(string(data), "\"") - - state, ok := mgmtpb.PoolServiceState_value[stateStr] - if !ok { - // Try converting the string to an int32, to handle the - // conversion from protobuf message using convert.Types(). - si, err := strconv.ParseInt(stateStr, 0, 32) - if err != nil { - return errors.Errorf("invalid Pool Service state number parse %q", stateStr) - } - - if _, ok = mgmtpb.PoolServiceState_name[int32(si)]; !ok { - return errors.Errorf("invalid Pool Service state name lookup %q", stateStr) - } - state = int32(si) - } - *pss = PoolServiceState(state) - - return nil -} diff --git a/src/control/system/raft/database_test.go b/src/control/system/raft/database_test.go index 0712986840e..9035db01aaf 100644 --- a/src/control/system/raft/database_test.go +++ b/src/control/system/raft/database_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2023 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -272,7 +272,7 @@ func TestSystem_Database_SnapshotRestore(t *testing.T) { ps := &PoolService{ PoolUUID: uuid.New(), PoolLabel: fmt.Sprintf("pool%04d", i), - State: PoolServiceStateReady, + State: system.PoolServiceStateReady, Replicas: <-replicas, Storage: &PoolServiceStorage{ CreationRankStr: fmt.Sprintf("[0-%d]", maxRanks), @@ -735,7 +735,7 @@ func TestSystem_Database_OnEvent(t *testing.T) { { PoolUUID: puuid, PoolLabel: "pool0001", - State: PoolServiceStateReady, + State: system.PoolServiceStateReady, Replicas: []Rank{1, 2, 3, 4, 5}, LastUpdate: time.Now(), }, @@ -746,7 +746,7 @@ func TestSystem_Database_OnEvent(t *testing.T) { { PoolUUID: puuid, PoolLabel: "pool0001", - State: PoolServiceStateReady, + State: system.PoolServiceStateReady, Replicas: []Rank{1, 2, 3, 4, 5}, LastUpdate: time.Now(), }, @@ -757,7 +757,7 @@ func TestSystem_Database_OnEvent(t *testing.T) { { PoolUUID: puuid, PoolLabel: "pool0001", - State: PoolServiceStateReady, + State: system.PoolServiceStateReady, Replicas: []Rank{1, 2, 3, 4, 5}, LastUpdate: time.Now(), }, @@ -768,7 +768,7 @@ func TestSystem_Database_OnEvent(t *testing.T) { { PoolUUID: puuid, PoolLabel: "pool0001", - State: PoolServiceStateReady, + State: system.PoolServiceStateReady, Replicas: []Rank{2, 3, 5, 6, 7}, LastUpdate: time.Now(), }, @@ -824,21 +824,21 @@ func TestSystemDatabase_PoolServiceList(t *testing.T) { ready := &PoolService{ PoolUUID: uuid.New(), PoolLabel: "pool0001", - State: PoolServiceStateReady, + State: system.PoolServiceStateReady, Replicas: []Rank{1, 2, 3, 4, 5}, LastUpdate: time.Now(), } creating := &PoolService{ PoolUUID: uuid.New(), PoolLabel: "pool0002", - State: PoolServiceStateCreating, + State: system.PoolServiceStateCreating, Replicas: []Rank{1, 2, 3, 4, 5}, LastUpdate: time.Now(), } destroying := &PoolService{ PoolUUID: uuid.New(), PoolLabel: "pool0003", - State: PoolServiceStateDestroying, + State: system.PoolServiceStateDestroying, Replicas: []Rank{1, 2, 3, 4, 5}, LastUpdate: time.Now(), } diff --git a/src/control/system/raft/raft_recovery_test.go b/src/control/system/raft/raft_recovery_test.go index 9d818fbfbc0..211291c26ce 100644 --- a/src/control/system/raft/raft_recovery_test.go +++ b/src/control/system/raft/raft_recovery_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2022 Intel Corporation. +// (C) Copyright 2022-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -26,7 +26,7 @@ import ( "github.com/daos-stack/daos/src/control/common/test" . "github.com/daos-stack/daos/src/control/lib/ranklist" "github.com/daos-stack/daos/src/control/logging" - . "github.com/daos-stack/daos/src/control/system" + "github.com/daos-stack/daos/src/control/system" ) var regenRaftFixtures = flag.Bool("regen-raft-fixtures", false, "regenerate raft test files") @@ -102,12 +102,12 @@ func Test_Raft_RegenerateFixtures(t *testing.T) { t.Log("adding ranks") nextAddr := ctrlAddrGen(ctx, net.IPv4(127, 0, 0, 1), 4) for i := 0; i < maxRanks; i++ { - m := &Member{ + m := &system.Member{ Rank: NilRank, UUID: uuid.New(), Addr: <-nextAddr, - State: MemberStateJoined, - FaultDomain: MustCreateFaultDomainFromString("/my/test/domain"), + State: system.MemberStateJoined, + FaultDomain: system.MustCreateFaultDomainFromString("/my/test/domain"), } if err := db.AddMember(m); err != nil { @@ -120,12 +120,12 @@ func Test_Raft_RegenerateFixtures(t *testing.T) { t.Log("adding pools") replicas := replicaGen(ctx, maxRanks, 3) for i := 0; i < maxPools; i++ { - ps := &PoolService{ + ps := &system.PoolService{ PoolUUID: uuid.New(), PoolLabel: fmt.Sprintf("pool%04d", i), - State: PoolServiceStateReady, + State: system.PoolServiceStateReady, Replicas: <-replicas, - Storage: &PoolServiceStorage{ + Storage: &system.PoolServiceStorage{ CreationRankStr: fmt.Sprintf("[0-%d]", maxRanks), CurrentRankStr: fmt.Sprintf("[0-%d]", maxRanks), PerRankTierStorage: []uint64{1, 2}, diff --git a/src/control/system/raft/testdata/raft_recovery/daos_system.db b/src/control/system/raft/testdata/raft_recovery/daos_system.db index 7f097491608..1202c95bbf1 100644 Binary files a/src/control/system/raft/testdata/raft_recovery/daos_system.db and b/src/control/system/raft/testdata/raft_recovery/daos_system.db differ diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1710888709486/meta.json b/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1710888709486/meta.json deleted file mode 100644 index 0deb71db6b4..00000000000 --- a/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1710888709486/meta.json +++ /dev/null @@ -1 +0,0 @@ -{"Version":1,"ID":"2-20-1710888709486","Index":20,"Term":2,"Peers":"ka8xMjcuMC4wLjE6MTAwMDE=","Configuration":{"Servers":[{"Suffrage":0,"ID":"127.0.0.1:10001","Address":"127.0.0.1:10001"}]},"ConfigurationIndex":1,"Size":4469,"CRC":"iy4czkUrmmQ="} diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1710888709486/state.bin b/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1710888709486/state.bin deleted file mode 100644 index 0f7c06c2753..00000000000 --- a/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1710888709486/state.bin +++ /dev/null @@ -1 +0,0 @@ -{"Version":8,"NextRank":9,"MapVersion":8,"Members":{"Ranks":{"1":"d50800c9-2104-4ba5-996c-55bcf7a48292","2":"692e11da-0e05-4fd6-be95-84ce57f7a553","3":"85dbe95d-fe54-418c-a547-cddb4af352d8","4":"cc537a2a-5566-42f7-a151-69b414d99425","5":"e267adb5-d205-4c15-b0c8-4e3e75200d48","6":"367ce851-5fc1-4649-a40a-a5d7b097191c","7":"e7c73998-5f99-4dbe-9661-c53139ffe413","8":"16f9d2f3-97e4-4c02-bb63-eac9bc6af509"},"Uuids":{"16f9d2f3-97e4-4c02-bb63-eac9bc6af509":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":8,"incarnation":0,"uuid":"16f9d2f3-97e4-4c02-bb63-eac9bc6af509","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.902982689Z"},"367ce851-5fc1-4649-a40a-a5d7b097191c":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":6,"incarnation":0,"uuid":"367ce851-5fc1-4649-a40a-a5d7b097191c","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.897949913Z"},"692e11da-0e05-4fd6-be95-84ce57f7a553":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":2,"incarnation":0,"uuid":"692e11da-0e05-4fd6-be95-84ce57f7a553","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.886795929Z"},"85dbe95d-fe54-418c-a547-cddb4af352d8":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":3,"incarnation":0,"uuid":"85dbe95d-fe54-418c-a547-cddb4af352d8","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.889541042Z"},"cc537a2a-5566-42f7-a151-69b414d99425":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":4,"incarnation":0,"uuid":"cc537a2a-5566-42f7-a151-69b414d99425","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.891880278Z"},"d50800c9-2104-4ba5-996c-55bcf7a48292":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":1,"incarnation":0,"uuid":"d50800c9-2104-4ba5-996c-55bcf7a48292","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.883262135Z"},"e267adb5-d205-4c15-b0c8-4e3e75200d48":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":5,"incarnation":0,"uuid":"e267adb5-d205-4c15-b0c8-4e3e75200d48","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.895441851Z"},"e7c73998-5f99-4dbe-9661-c53139ffe413":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":7,"incarnation":0,"uuid":"e7c73998-5f99-4dbe-9661-c53139ffe413","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.900455403Z"}},"Addrs":{"127.0.0.1:10001":["d50800c9-2104-4ba5-996c-55bcf7a48292","692e11da-0e05-4fd6-be95-84ce57f7a553","85dbe95d-fe54-418c-a547-cddb4af352d8","cc537a2a-5566-42f7-a151-69b414d99425"],"127.0.0.2:10001":["e267adb5-d205-4c15-b0c8-4e3e75200d48","367ce851-5fc1-4649-a40a-a5d7b097191c","e7c73998-5f99-4dbe-9661-c53139ffe413","16f9d2f3-97e4-4c02-bb63-eac9bc6af509"]},"FaultDomains":{"Domain":{"Domains":null},"ID":1,"Children":[{"Domain":{"Domains":["my"]},"ID":2,"Children":[{"Domain":{"Domains":["my","test"]},"ID":3,"Children":[{"Domain":{"Domains":["my","test","domain"]},"ID":4,"Children":[{"Domain":{"Domains":["my","test","domain","rank1"]},"ID":5,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank2"]},"ID":6,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank3"]},"ID":7,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank4"]},"ID":8,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank5"]},"ID":9,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank6"]},"ID":10,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank7"]},"ID":11,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank8"]},"ID":12,"Children":[]}]}]}]}]}},"Pools":{"Ranks":{},"Uuids":{},"Labels":{}},"Checker":{"Findings":{}},"System":{"Attributes":{}},"SchemaVersion":0} \ No newline at end of file diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1713295643181/meta.json b/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1713295643181/meta.json new file mode 100644 index 00000000000..0e6cd99acd1 --- /dev/null +++ b/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1713295643181/meta.json @@ -0,0 +1,19 @@ +{ + "Version": 1, + "ID": "2-20-1713295643181", + "Index": 20, + "Term": 2, + "Peers": "ka8xMjcuMC4wLjE6MTAwMDE=", + "Configuration": { + "Servers": [ + { + "Suffrage": 0, + "ID": "127.0.0.1:10001", + "Address": "127.0.0.1:10001" + } + ] + }, + "ConfigurationIndex": 1, + "Size": 4468, + "CRC": "OHak8IEKGyo=" +} diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1713295643181/state.bin b/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1713295643181/state.bin new file mode 100644 index 00000000000..d8a492ac030 --- /dev/null +++ b/src/control/system/raft/testdata/raft_recovery/snapshots/2-20-1713295643181/state.bin @@ -0,0 +1 @@ +{"Version":8,"NextRank":9,"MapVersion":8,"Members":{"Ranks":{"1":"0e08f30e-86a2-47e4-b236-ee1be66086eb","2":"103a4f24-6730-4c07-bc13-1b34c5141b9b","3":"1778f74e-66d0-4496-ba03-7e62ea0d4463","4":"5bc9a6d6-6d7a-49ef-9764-20260f2d9023","5":"2c6bccc4-372b-4b52-9e54-7cfd458e0dae","6":"f5352001-c34f-41c2-a6c0-60dbd6cd4b8f","7":"a283a6e9-c7db-42c6-90ee-8c8636cbeb75","8":"3389e4c9-3724-4093-99e6-5f2c7e813421"},"Uuids":{"0e08f30e-86a2-47e4-b236-ee1be66086eb":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":1,"incarnation":0,"uuid":"0e08f30e-86a2-47e4-b236-ee1be66086eb","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.786131637Z"},"103a4f24-6730-4c07-bc13-1b34c5141b9b":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":2,"incarnation":0,"uuid":"103a4f24-6730-4c07-bc13-1b34c5141b9b","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.790721912Z"},"1778f74e-66d0-4496-ba03-7e62ea0d4463":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":3,"incarnation":0,"uuid":"1778f74e-66d0-4496-ba03-7e62ea0d4463","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.795768326Z"},"2c6bccc4-372b-4b52-9e54-7cfd458e0dae":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":5,"incarnation":0,"uuid":"2c6bccc4-372b-4b52-9e54-7cfd458e0dae","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.800693891Z"},"3389e4c9-3724-4093-99e6-5f2c7e813421":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":8,"incarnation":0,"uuid":"3389e4c9-3724-4093-99e6-5f2c7e813421","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.81085826Z"},"5bc9a6d6-6d7a-49ef-9764-20260f2d9023":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":4,"incarnation":0,"uuid":"5bc9a6d6-6d7a-49ef-9764-20260f2d9023","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.798204514Z"},"a283a6e9-c7db-42c6-90ee-8c8636cbeb75":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":7,"incarnation":0,"uuid":"a283a6e9-c7db-42c6-90ee-8c8636cbeb75","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.805965755Z"},"f5352001-c34f-41c2-a6c0-60dbd6cd4b8f":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":6,"incarnation":0,"uuid":"f5352001-c34f-41c2-a6c0-60dbd6cd4b8f","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.803162578Z"}},"Addrs":{"127.0.0.1:10001":["0e08f30e-86a2-47e4-b236-ee1be66086eb","103a4f24-6730-4c07-bc13-1b34c5141b9b","1778f74e-66d0-4496-ba03-7e62ea0d4463","5bc9a6d6-6d7a-49ef-9764-20260f2d9023"],"127.0.0.2:10001":["2c6bccc4-372b-4b52-9e54-7cfd458e0dae","f5352001-c34f-41c2-a6c0-60dbd6cd4b8f","a283a6e9-c7db-42c6-90ee-8c8636cbeb75","3389e4c9-3724-4093-99e6-5f2c7e813421"]},"FaultDomains":{"Domain":{"Domains":null},"ID":1,"Children":[{"Domain":{"Domains":["my"]},"ID":2,"Children":[{"Domain":{"Domains":["my","test"]},"ID":3,"Children":[{"Domain":{"Domains":["my","test","domain"]},"ID":4,"Children":[{"Domain":{"Domains":["my","test","domain","rank1"]},"ID":5,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank2"]},"ID":6,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank3"]},"ID":7,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank4"]},"ID":8,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank5"]},"ID":9,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank6"]},"ID":10,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank7"]},"ID":11,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank8"]},"ID":12,"Children":[]}]}]}]}]}},"Pools":{"Ranks":{},"Uuids":{},"Labels":{}},"Checker":{"Findings":{}},"System":{"Attributes":{}},"SchemaVersion":0} \ No newline at end of file diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1710888711237/meta.json b/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1710888711237/meta.json deleted file mode 100644 index dd094666212..00000000000 --- a/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1710888711237/meta.json +++ /dev/null @@ -1 +0,0 @@ -{"Version":1,"ID":"2-44-1710888711237","Index":44,"Term":2,"Peers":"ka8xMjcuMC4wLjE6MTAwMDE=","Configuration":{"Servers":[{"Suffrage":0,"ID":"127.0.0.1:10001","Address":"127.0.0.1:10001"}]},"ConfigurationIndex":1,"Size":7466,"CRC":"5AdDOZ0IrcY="} diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1710888711237/state.bin b/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1710888711237/state.bin deleted file mode 100644 index e4290729cfa..00000000000 --- a/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1710888711237/state.bin +++ /dev/null @@ -1 +0,0 @@ -{"Version":16,"NextRank":9,"MapVersion":8,"Members":{"Ranks":{"1":"d50800c9-2104-4ba5-996c-55bcf7a48292","2":"692e11da-0e05-4fd6-be95-84ce57f7a553","3":"85dbe95d-fe54-418c-a547-cddb4af352d8","4":"cc537a2a-5566-42f7-a151-69b414d99425","5":"e267adb5-d205-4c15-b0c8-4e3e75200d48","6":"367ce851-5fc1-4649-a40a-a5d7b097191c","7":"e7c73998-5f99-4dbe-9661-c53139ffe413","8":"16f9d2f3-97e4-4c02-bb63-eac9bc6af509"},"Uuids":{"16f9d2f3-97e4-4c02-bb63-eac9bc6af509":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":8,"incarnation":0,"uuid":"16f9d2f3-97e4-4c02-bb63-eac9bc6af509","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.902982689Z"},"367ce851-5fc1-4649-a40a-a5d7b097191c":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":6,"incarnation":0,"uuid":"367ce851-5fc1-4649-a40a-a5d7b097191c","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.897949913Z"},"692e11da-0e05-4fd6-be95-84ce57f7a553":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":2,"incarnation":0,"uuid":"692e11da-0e05-4fd6-be95-84ce57f7a553","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.886795929Z"},"85dbe95d-fe54-418c-a547-cddb4af352d8":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":3,"incarnation":0,"uuid":"85dbe95d-fe54-418c-a547-cddb4af352d8","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.889541042Z"},"cc537a2a-5566-42f7-a151-69b414d99425":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":4,"incarnation":0,"uuid":"cc537a2a-5566-42f7-a151-69b414d99425","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.891880278Z"},"d50800c9-2104-4ba5-996c-55bcf7a48292":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":1,"incarnation":0,"uuid":"d50800c9-2104-4ba5-996c-55bcf7a48292","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.883262135Z"},"e267adb5-d205-4c15-b0c8-4e3e75200d48":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":5,"incarnation":0,"uuid":"e267adb5-d205-4c15-b0c8-4e3e75200d48","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.895441851Z"},"e7c73998-5f99-4dbe-9661-c53139ffe413":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":7,"incarnation":0,"uuid":"e7c73998-5f99-4dbe-9661-c53139ffe413","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-03-19T22:51:47.900455403Z"}},"Addrs":{"127.0.0.1:10001":["d50800c9-2104-4ba5-996c-55bcf7a48292","692e11da-0e05-4fd6-be95-84ce57f7a553","85dbe95d-fe54-418c-a547-cddb4af352d8","cc537a2a-5566-42f7-a151-69b414d99425"],"127.0.0.2:10001":["e267adb5-d205-4c15-b0c8-4e3e75200d48","367ce851-5fc1-4649-a40a-a5d7b097191c","e7c73998-5f99-4dbe-9661-c53139ffe413","16f9d2f3-97e4-4c02-bb63-eac9bc6af509"]},"FaultDomains":{"Domain":{"Domains":null},"ID":1,"Children":[{"Domain":{"Domains":["my"]},"ID":2,"Children":[{"Domain":{"Domains":["my","test"]},"ID":3,"Children":[{"Domain":{"Domains":["my","test","domain"]},"ID":4,"Children":[{"Domain":{"Domains":["my","test","domain","rank1"]},"ID":5,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank2"]},"ID":6,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank3"]},"ID":7,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank4"]},"ID":8,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank5"]},"ID":9,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank6"]},"ID":10,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank7"]},"ID":11,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank8"]},"ID":12,"Children":[]}]}]}]}]}},"Pools":{"Ranks":{"0":["3e04eb11-d9da-4913-8ad9-43ee43a252d5","c869c3a6-2a70-4543-89c0-da47dfb92303","7099e240-9d34-42ef-a762-25f525d328ee"],"1":["ab7db85b-57e5-4dc4-b604-4b5458020c6a","7099e240-9d34-42ef-a762-25f525d328ee"],"3":["c869c3a6-2a70-4543-89c0-da47dfb92303"],"4":["687b65a7-19d6-40ef-9cf7-12a45ae17270"],"6":["687b65a7-19d6-40ef-9cf7-12a45ae17270"]},"Uuids":{"15b67f96-f674-4f0b-8ee0-c9ff542de129":{"PoolUUID":"15b67f96-f674-4f0b-8ee0-c9ff542de129","PoolLabel":"pool0007","State":"Ready","Replicas":null,"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.952013491Z"},"1aaa8dde-b471-48de-b7d2-ca18939ec6aa":{"PoolUUID":"1aaa8dde-b471-48de-b7d2-ca18939ec6aa","PoolLabel":"pool0005","State":"Ready","Replicas":null,"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.943263063Z"},"3e04eb11-d9da-4913-8ad9-43ee43a252d5":{"PoolUUID":"3e04eb11-d9da-4913-8ad9-43ee43a252d5","PoolLabel":"pool0001","State":"Ready","Replicas":[0],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.927044641Z"},"687b65a7-19d6-40ef-9cf7-12a45ae17270":{"PoolUUID":"687b65a7-19d6-40ef-9cf7-12a45ae17270","PoolLabel":"pool0002","State":"Ready","Replicas":[4,6],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.931310931Z"},"7099e240-9d34-42ef-a762-25f525d328ee":{"PoolUUID":"7099e240-9d34-42ef-a762-25f525d328ee","PoolLabel":"pool0006","State":"Ready","Replicas":[0,1],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.947681515Z"},"ab7db85b-57e5-4dc4-b604-4b5458020c6a":{"PoolUUID":"ab7db85b-57e5-4dc4-b604-4b5458020c6a","PoolLabel":"pool0003","State":"Ready","Replicas":[1],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.934622936Z"},"c869c3a6-2a70-4543-89c0-da47dfb92303":{"PoolUUID":"c869c3a6-2a70-4543-89c0-da47dfb92303","PoolLabel":"pool0004","State":"Ready","Replicas":[3,0],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.938971457Z"},"df8a3571-8851-414e-b4e3-518c4feed10f":{"PoolUUID":"df8a3571-8851-414e-b4e3-518c4feed10f","PoolLabel":"pool0000","State":"Ready","Replicas":null,"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-03-19T22:51:49.922749044Z"}},"Labels":{"pool0000":"df8a3571-8851-414e-b4e3-518c4feed10f","pool0001":"3e04eb11-d9da-4913-8ad9-43ee43a252d5","pool0002":"687b65a7-19d6-40ef-9cf7-12a45ae17270","pool0003":"ab7db85b-57e5-4dc4-b604-4b5458020c6a","pool0004":"c869c3a6-2a70-4543-89c0-da47dfb92303","pool0005":"1aaa8dde-b471-48de-b7d2-ca18939ec6aa","pool0006":"7099e240-9d34-42ef-a762-25f525d328ee","pool0007":"15b67f96-f674-4f0b-8ee0-c9ff542de129"}},"Checker":{"Findings":{}},"System":{"Attributes":{}},"SchemaVersion":0} \ No newline at end of file diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1713295644569/meta.json b/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1713295644569/meta.json new file mode 100644 index 00000000000..8e67ecb5654 --- /dev/null +++ b/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1713295644569/meta.json @@ -0,0 +1,19 @@ +{ + "Version": 1, + "ID": "2-44-1713295644569", + "Index": 44, + "Term": 2, + "Peers": "ka8xMjcuMC4wLjE6MTAwMDE=", + "Configuration": { + "Servers": [ + { + "Suffrage": 0, + "ID": "127.0.0.1:10001", + "Address": "127.0.0.1:10001" + } + ] + }, + "ConfigurationIndex": 1, + "Size": 7328, + "CRC": "4vwX3T5frD4=" +} diff --git a/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1713295644569/state.bin b/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1713295644569/state.bin new file mode 100644 index 00000000000..d21378b8f19 --- /dev/null +++ b/src/control/system/raft/testdata/raft_recovery/snapshots/2-44-1713295644569/state.bin @@ -0,0 +1 @@ +{"Version":16,"NextRank":9,"MapVersion":8,"Members":{"Ranks":{"1":"0e08f30e-86a2-47e4-b236-ee1be66086eb","2":"103a4f24-6730-4c07-bc13-1b34c5141b9b","3":"1778f74e-66d0-4496-ba03-7e62ea0d4463","4":"5bc9a6d6-6d7a-49ef-9764-20260f2d9023","5":"2c6bccc4-372b-4b52-9e54-7cfd458e0dae","6":"f5352001-c34f-41c2-a6c0-60dbd6cd4b8f","7":"a283a6e9-c7db-42c6-90ee-8c8636cbeb75","8":"3389e4c9-3724-4093-99e6-5f2c7e813421"},"Uuids":{"0e08f30e-86a2-47e4-b236-ee1be66086eb":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":1,"incarnation":0,"uuid":"0e08f30e-86a2-47e4-b236-ee1be66086eb","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.786131637Z"},"103a4f24-6730-4c07-bc13-1b34c5141b9b":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":2,"incarnation":0,"uuid":"103a4f24-6730-4c07-bc13-1b34c5141b9b","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.790721912Z"},"1778f74e-66d0-4496-ba03-7e62ea0d4463":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":3,"incarnation":0,"uuid":"1778f74e-66d0-4496-ba03-7e62ea0d4463","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.795768326Z"},"2c6bccc4-372b-4b52-9e54-7cfd458e0dae":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":5,"incarnation":0,"uuid":"2c6bccc4-372b-4b52-9e54-7cfd458e0dae","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.800693891Z"},"3389e4c9-3724-4093-99e6-5f2c7e813421":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":8,"incarnation":0,"uuid":"3389e4c9-3724-4093-99e6-5f2c7e813421","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.81085826Z"},"5bc9a6d6-6d7a-49ef-9764-20260f2d9023":{"addr":"127.0.0.1:10001","state":"joined","fault_domain":"/my/test/domain","rank":4,"incarnation":0,"uuid":"5bc9a6d6-6d7a-49ef-9764-20260f2d9023","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.798204514Z"},"a283a6e9-c7db-42c6-90ee-8c8636cbeb75":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":7,"incarnation":0,"uuid":"a283a6e9-c7db-42c6-90ee-8c8636cbeb75","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.805965755Z"},"f5352001-c34f-41c2-a6c0-60dbd6cd4b8f":{"addr":"127.0.0.2:10001","state":"joined","fault_domain":"/my/test/domain","rank":6,"incarnation":0,"uuid":"f5352001-c34f-41c2-a6c0-60dbd6cd4b8f","fabric_uri":"","secondary_fabric_uris":null,"fabric_contexts":0,"secondary_fabric_contexts":null,"info":"","last_update":"2024-04-16T19:27:21.803162578Z"}},"Addrs":{"127.0.0.1:10001":["0e08f30e-86a2-47e4-b236-ee1be66086eb","103a4f24-6730-4c07-bc13-1b34c5141b9b","1778f74e-66d0-4496-ba03-7e62ea0d4463","5bc9a6d6-6d7a-49ef-9764-20260f2d9023"],"127.0.0.2:10001":["2c6bccc4-372b-4b52-9e54-7cfd458e0dae","f5352001-c34f-41c2-a6c0-60dbd6cd4b8f","a283a6e9-c7db-42c6-90ee-8c8636cbeb75","3389e4c9-3724-4093-99e6-5f2c7e813421"]},"FaultDomains":{"Domain":{"Domains":null},"ID":1,"Children":[{"Domain":{"Domains":["my"]},"ID":2,"Children":[{"Domain":{"Domains":["my","test"]},"ID":3,"Children":[{"Domain":{"Domains":["my","test","domain"]},"ID":4,"Children":[{"Domain":{"Domains":["my","test","domain","rank1"]},"ID":5,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank2"]},"ID":6,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank3"]},"ID":7,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank4"]},"ID":8,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank5"]},"ID":9,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank6"]},"ID":10,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank7"]},"ID":11,"Children":[]},{"Domain":{"Domains":["my","test","domain","rank8"]},"ID":12,"Children":[]}]}]}]}]}},"Pools":{"Ranks":{"1":["7b9f4c04-a32b-47b4-983b-679a9e34c7e3","5e81b4c3-ab13-487c-9718-7f55288e0870"],"2":["7328d39e-3c30-406f-b71c-465f13a3e72c"],"5":["7b9f4c04-a32b-47b4-983b-679a9e34c7e3","00449e23-2ddf-49cb-b677-eedf0a3fe574"],"7":["7328d39e-3c30-406f-b71c-465f13a3e72c"]},"Uuids":{"00449e23-2ddf-49cb-b677-eedf0a3fe574":{"PoolUUID":"00449e23-2ddf-49cb-b677-eedf0a3fe574","PoolLabel":"pool0003","State":1,"Replicas":[5],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.84261755Z"},"22a4c7d4-06a1-42bb-ab6d-96226d420580":{"PoolUUID":"22a4c7d4-06a1-42bb-ab6d-96226d420580","PoolLabel":"pool0005","State":1,"Replicas":null,"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.85192468Z"},"37aadd3b-38d6-4c88-be04-d101d7de5ac7":{"PoolUUID":"37aadd3b-38d6-4c88-be04-d101d7de5ac7","PoolLabel":"pool0006","State":1,"Replicas":null,"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.855883806Z"},"3c319416-b73a-41ad-bdf2-e6fd7a38a08d":{"PoolUUID":"3c319416-b73a-41ad-bdf2-e6fd7a38a08d","PoolLabel":"pool0001","State":1,"Replicas":null,"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.83287002Z"},"5e81b4c3-ab13-487c-9718-7f55288e0870":{"PoolUUID":"5e81b4c3-ab13-487c-9718-7f55288e0870","PoolLabel":"pool0007","State":1,"Replicas":[1],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.86177197Z"},"7328d39e-3c30-406f-b71c-465f13a3e72c":{"PoolUUID":"7328d39e-3c30-406f-b71c-465f13a3e72c","PoolLabel":"pool0004","State":1,"Replicas":[2,7],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.846600145Z"},"7b9f4c04-a32b-47b4-983b-679a9e34c7e3":{"PoolUUID":"7b9f4c04-a32b-47b4-983b-679a9e34c7e3","PoolLabel":"pool0000","State":1,"Replicas":[5,1],"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.817530746Z"},"b9a029a2-b0b6-430b-8af6-b828035137fd":{"PoolUUID":"b9a029a2-b0b6-430b-8af6-b828035137fd","PoolLabel":"pool0002","State":1,"Replicas":null,"Storage":{"CreationRankStr":"[0-8]","CurrentRankStr":"[0-8]","PerRankTierStorage":[1,2]},"LastUpdate":"2024-04-16T19:27:23.838448404Z"}},"Labels":{"pool0000":"7b9f4c04-a32b-47b4-983b-679a9e34c7e3","pool0001":"3c319416-b73a-41ad-bdf2-e6fd7a38a08d","pool0002":"b9a029a2-b0b6-430b-8af6-b828035137fd","pool0003":"00449e23-2ddf-49cb-b677-eedf0a3fe574","pool0004":"7328d39e-3c30-406f-b71c-465f13a3e72c","pool0005":"22a4c7d4-06a1-42bb-ab6d-96226d420580","pool0006":"37aadd3b-38d6-4c88-be04-d101d7de5ac7","pool0007":"5e81b4c3-ab13-487c-9718-7f55288e0870"}},"Checker":{"Findings":{}},"System":{"Attributes":{}},"SchemaVersion":0} \ No newline at end of file diff --git a/src/mgmt/pool.pb-c.c b/src/mgmt/pool.pb-c.c index b82b28e59d8..84b773ceac3 100644 --- a/src/mgmt/pool.pb-c.c +++ b/src/mgmt/pool.pb-c.c @@ -1504,176 +1504,84 @@ void mgmt__pool_query_target_resp__free_unpacked assert(message->base.descriptor == &mgmt__pool_query_target_resp__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor mgmt__pool_create_req__field_descriptors[14] = -{ - { - "uuid", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, uuid), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "sys", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "user", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, user), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "usergroup", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, usergroup), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "acl", - 5, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_STRING, - offsetof(Mgmt__PoolCreateReq, n_acl), - offsetof(Mgmt__PoolCreateReq, acl), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "properties", - 6, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Mgmt__PoolCreateReq, n_properties), - offsetof(Mgmt__PoolCreateReq, properties), - &mgmt__pool_property__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "faultDomains", - 7, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolCreateReq, n_faultdomains), - offsetof(Mgmt__PoolCreateReq, faultdomains), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "numsvcreps", - 8, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, numsvcreps), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "totalbytes", - 9, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, totalbytes), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tierratio", - 10, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_DOUBLE, - offsetof(Mgmt__PoolCreateReq, n_tierratio), - offsetof(Mgmt__PoolCreateReq, tierratio), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "numranks", - 11, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, numranks), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ranks", - 12, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolCreateReq, n_ranks), - offsetof(Mgmt__PoolCreateReq, ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tierbytes", - 13, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT64, - offsetof(Mgmt__PoolCreateReq, n_tierbytes), - offsetof(Mgmt__PoolCreateReq, tierbytes), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "meta_blob_size", - 14, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateReq, meta_blob_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_create_req__field_descriptors[14] = { + { + "uuid", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, uuid), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "sys", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "user", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, user), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "usergroup", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, usergroup), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "acl", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_STRING, + offsetof(Mgmt__PoolCreateReq, n_acl), offsetof(Mgmt__PoolCreateReq, acl), NULL, + &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "properties", 6, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Mgmt__PoolCreateReq, n_properties), offsetof(Mgmt__PoolCreateReq, properties), + &mgmt__pool_property__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "faultDomains", 7, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolCreateReq, n_faultdomains), offsetof(Mgmt__PoolCreateReq, faultdomains), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "numsvcreps", 8, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, numsvcreps), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "totalbytes", 9, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, totalbytes), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tierratio", 10, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_DOUBLE, + offsetof(Mgmt__PoolCreateReq, n_tierratio), offsetof(Mgmt__PoolCreateReq, tierratio), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "numranks", 11, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, numranks), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "ranks", 12, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolCreateReq, n_ranks), offsetof(Mgmt__PoolCreateReq, ranks), NULL, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tierbytes", 13, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT64, + offsetof(Mgmt__PoolCreateReq, n_tierbytes), offsetof(Mgmt__PoolCreateReq, tierbytes), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "meta_blob_size", 14, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateReq, meta_blob_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_create_req__field_indices_by_name[] = { 4, /* field[4] = acl */ @@ -1711,80 +1619,41 @@ const ProtobufCMessageDescriptor mgmt__pool_create_req__descriptor = (ProtobufCMessageInit) mgmt__pool_create_req__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_create_resp__field_descriptors[6] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ldr", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateResp, svc_ldr), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_reps", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolCreateResp, n_svc_reps), - offsetof(Mgmt__PoolCreateResp, svc_reps), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tgt_ranks", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolCreateResp, n_tgt_ranks), - offsetof(Mgmt__PoolCreateResp, tgt_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tier_bytes", - 5, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT64, - offsetof(Mgmt__PoolCreateResp, n_tier_bytes), - offsetof(Mgmt__PoolCreateResp, tier_bytes), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "meta_blob_size", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolCreateResp, meta_blob_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_create_resp__field_descriptors[6] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ldr", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateResp, svc_ldr), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_reps", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolCreateResp, n_svc_reps), offsetof(Mgmt__PoolCreateResp, svc_reps), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tgt_ranks", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolCreateResp, n_tgt_ranks), offsetof(Mgmt__PoolCreateResp, tgt_ranks), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tier_bytes", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT64, + offsetof(Mgmt__PoolCreateResp, n_tier_bytes), offsetof(Mgmt__PoolCreateResp, tier_bytes), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "meta_blob_size", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolCreateResp, meta_blob_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_create_resp__field_indices_by_name[] = { 5, /* field[5] = meta_blob_size */ @@ -1814,68 +1683,33 @@ const ProtobufCMessageDescriptor mgmt__pool_create_resp__descriptor = (ProtobufCMessageInit) mgmt__pool_create_resp__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_destroy_req__field_descriptors[5] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolDestroyReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolDestroyReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "force", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolDestroyReq, force), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolDestroyReq, n_svc_ranks), - offsetof(Mgmt__PoolDestroyReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "recursive", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolDestroyReq, recursive), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_destroy_req__field_descriptors[5] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolDestroyReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolDestroyReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "force", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolDestroyReq, force), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolDestroyReq, n_svc_ranks), offsetof(Mgmt__PoolDestroyReq, svc_ranks), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "recursive", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolDestroyReq, recursive), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_destroy_req__field_indices_by_name[] = { 2, /* field[2] = force */ @@ -1942,148 +1776,83 @@ const ProtobufCMessageDescriptor mgmt__pool_destroy_resp__descriptor = (ProtobufCMessageInit) mgmt__pool_destroy_resp__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_evict_req__field_descriptors[7] = -{ - { - "sys", +static const ProtobufCFieldDescriptor mgmt__pool_evict_req__field_descriptors[7] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolEvictReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolEvictReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolEvictReq, n_svc_ranks), offsetof(Mgmt__PoolEvictReq, svc_ranks), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "handles", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_STRING, + offsetof(Mgmt__PoolEvictReq, n_handles), offsetof(Mgmt__PoolEvictReq, handles), NULL, + &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "destroy", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolEvictReq, destroy), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "force_destroy", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolEvictReq, force_destroy), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "machine", 7, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolEvictReq, machine), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__pool_evict_req__field_indices_by_name[] = { + 4, /* field[4] = destroy */ + 5, /* field[5] = force_destroy */ + 3, /* field[3] = handles */ + 1, /* field[1] = id */ + 6, /* field[6] = machine */ + 2, /* field[2] = svc_ranks */ + 0, /* field[0] = sys */ +}; +static const ProtobufCIntRange mgmt__pool_evict_req__number_ranges[1 + 1] = {{1, 0}, {0, 7}}; +const ProtobufCMessageDescriptor mgmt__pool_evict_req__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolEvictReq", + "PoolEvictReq", + "Mgmt__PoolEvictReq", + "mgmt", + sizeof(Mgmt__PoolEvictReq), + 7, + mgmt__pool_evict_req__field_descriptors, + mgmt__pool_evict_req__field_indices_by_name, 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolEvictReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolEvictReq, id), + mgmt__pool_evict_req__number_ranges, + (ProtobufCMessageInit)mgmt__pool_evict_req__init, NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolEvictReq, n_svc_ranks), - offsetof(Mgmt__PoolEvictReq, svc_ranks), NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "handles", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_STRING, - offsetof(Mgmt__PoolEvictReq, n_handles), - offsetof(Mgmt__PoolEvictReq, handles), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "destroy", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolEvictReq, destroy), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "force_destroy", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolEvictReq, force_destroy), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "machine", - 7, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolEvictReq, machine), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__pool_evict_req__field_indices_by_name[] = { - 4, /* field[4] = destroy */ - 5, /* field[5] = force_destroy */ - 3, /* field[3] = handles */ - 1, /* field[1] = id */ - 6, /* field[6] = machine */ - 2, /* field[2] = svc_ranks */ - 0, /* field[0] = sys */ -}; -static const ProtobufCIntRange mgmt__pool_evict_req__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 7 } + NULL /* reserved[123] */ }; -const ProtobufCMessageDescriptor mgmt__pool_evict_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolEvictReq", - "PoolEvictReq", - "Mgmt__PoolEvictReq", - "mgmt", - sizeof(Mgmt__PoolEvictReq), - 7, - mgmt__pool_evict_req__field_descriptors, - mgmt__pool_evict_req__field_indices_by_name, - 1, mgmt__pool_evict_req__number_ranges, - (ProtobufCMessageInit) mgmt__pool_evict_req__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_evict_resp__field_descriptors[2] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolEvictResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "count", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolEvictResp, count), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_evict_resp__field_descriptors[2] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolEvictResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "count", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolEvictResp, count), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_evict_resp__field_indices_by_name[] = { 1, /* field[1] = count */ @@ -2109,68 +1878,34 @@ const ProtobufCMessageDescriptor mgmt__pool_evict_resp__descriptor = (ProtobufCMessageInit) mgmt__pool_evict_resp__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_exclude_req__field_descriptors[5] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolExcludeReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolExcludeReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rank", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolExcludeReq, rank), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "targetidx", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolExcludeReq, n_targetidx), - offsetof(Mgmt__PoolExcludeReq, targetidx), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 5, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolExcludeReq, n_svc_ranks), - offsetof(Mgmt__PoolExcludeReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_exclude_req__field_descriptors[5] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolExcludeReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolExcludeReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rank", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolExcludeReq, rank), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "targetidx", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolExcludeReq, n_targetidx), offsetof(Mgmt__PoolExcludeReq, targetidx), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolExcludeReq, n_svc_ranks), offsetof(Mgmt__PoolExcludeReq, svc_ranks), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_exclude_req__field_indices_by_name[] = { 1, /* field[1] = id */ @@ -2199,106 +1934,62 @@ const ProtobufCMessageDescriptor mgmt__pool_exclude_req__descriptor = (ProtobufCMessageInit) mgmt__pool_exclude_req__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_exclude_resp__field_descriptors[1] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolExcludeResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_exclude_resp__field_descriptors[1] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolExcludeResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_exclude_resp__field_indices_by_name[] = { - 0, /* field[0] = status */ -}; -static const ProtobufCIntRange mgmt__pool_exclude_resp__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor mgmt__pool_exclude_resp__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolExcludeResp", - "PoolExcludeResp", - "Mgmt__PoolExcludeResp", - "mgmt", - sizeof(Mgmt__PoolExcludeResp), - 1, - mgmt__pool_exclude_resp__field_descriptors, - mgmt__pool_exclude_resp__field_indices_by_name, - 1, mgmt__pool_exclude_resp__number_ranges, - (ProtobufCMessageInit) mgmt__pool_exclude_resp__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_drain_req__field_descriptors[5] = -{ - { - "sys", + 0, /* field[0] = status */ +}; +static const ProtobufCIntRange mgmt__pool_exclude_resp__number_ranges[1 + 1] = {{1, 0}, {0, 1}}; +const ProtobufCMessageDescriptor mgmt__pool_exclude_resp__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolExcludeResp", + "PoolExcludeResp", + "Mgmt__PoolExcludeResp", + "mgmt", + sizeof(Mgmt__PoolExcludeResp), 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolDrainReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolDrainReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rank", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolDrainReq, rank), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "targetidx", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolDrainReq, n_targetidx), - offsetof(Mgmt__PoolDrainReq, targetidx), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 5, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolDrainReq, n_svc_ranks), - offsetof(Mgmt__PoolDrainReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, + mgmt__pool_exclude_resp__field_descriptors, + mgmt__pool_exclude_resp__field_indices_by_name, + 1, + mgmt__pool_exclude_resp__number_ranges, + (ProtobufCMessageInit)mgmt__pool_exclude_resp__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__pool_drain_req__field_descriptors[5] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolDrainReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolDrainReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rank", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolDrainReq, rank), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "targetidx", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolDrainReq, n_targetidx), offsetof(Mgmt__PoolDrainReq, targetidx), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolDrainReq, n_svc_ranks), offsetof(Mgmt__PoolDrainReq, svc_ranks), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_drain_req__field_indices_by_name[] = { 1, /* field[1] = id */ @@ -2365,272 +2056,175 @@ const ProtobufCMessageDescriptor mgmt__pool_drain_resp__descriptor = (ProtobufCMessageInit) mgmt__pool_drain_resp__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_extend_req__field_descriptors[6] = +static const ProtobufCFieldDescriptor mgmt__pool_extend_req__field_descriptors[6] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolExtendReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolExtendReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "ranks", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolExtendReq, n_ranks), offsetof(Mgmt__PoolExtendReq, ranks), NULL, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolExtendReq, n_svc_ranks), offsetof(Mgmt__PoolExtendReq, svc_ranks), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tierbytes", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT64, + offsetof(Mgmt__PoolExtendReq, n_tierbytes), offsetof(Mgmt__PoolExtendReq, tierbytes), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "faultDomains", 6, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolExtendReq, n_faultdomains), offsetof(Mgmt__PoolExtendReq, faultdomains), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__pool_extend_req__field_indices_by_name[] = { + 5, /* field[5] = faultDomains */ + 1, /* field[1] = id */ + 2, /* field[2] = ranks */ + 3, /* field[3] = svc_ranks */ + 0, /* field[0] = sys */ + 4, /* field[4] = tierbytes */ +}; +static const ProtobufCIntRange mgmt__pool_extend_req__number_ranges[1 + 1] = {{1, 0}, {0, 6}}; +const ProtobufCMessageDescriptor mgmt__pool_extend_req__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolExtendReq", + "PoolExtendReq", + "Mgmt__PoolExtendReq", + "mgmt", + sizeof(Mgmt__PoolExtendReq), + 6, + mgmt__pool_extend_req__field_descriptors, + mgmt__pool_extend_req__field_indices_by_name, + 1, + mgmt__pool_extend_req__number_ranges, + (ProtobufCMessageInit)mgmt__pool_extend_req__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__pool_extend_resp__field_descriptors[2] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolExtendResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tier_bytes", 2, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT64, + offsetof(Mgmt__PoolExtendResp, n_tier_bytes), offsetof(Mgmt__PoolExtendResp, tier_bytes), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__pool_extend_resp__field_indices_by_name[] = { + 0, /* field[0] = status */ + 1, /* field[1] = tier_bytes */ +}; +static const ProtobufCIntRange mgmt__pool_extend_resp__number_ranges[1 + 1] = {{1, 0}, {0, 2}}; +const ProtobufCMessageDescriptor mgmt__pool_extend_resp__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolExtendResp", + "PoolExtendResp", + "Mgmt__PoolExtendResp", + "mgmt", + sizeof(Mgmt__PoolExtendResp), + 2, + mgmt__pool_extend_resp__field_descriptors, + mgmt__pool_extend_resp__field_indices_by_name, + 1, + mgmt__pool_extend_resp__number_ranges, + (ProtobufCMessageInit)mgmt__pool_extend_resp__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__pool_reintegrate_req__field_descriptors[6] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolReintegrateReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolReintegrateReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rank", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolReintegrateReq, rank), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "targetidx", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolReintegrateReq, n_targetidx), + offsetof(Mgmt__PoolReintegrateReq, targetidx), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolReintegrateReq, n_svc_ranks), + offsetof(Mgmt__PoolReintegrateReq, svc_ranks), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tierbytes", 6, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT64, + offsetof(Mgmt__PoolReintegrateReq, n_tierbytes), + offsetof(Mgmt__PoolReintegrateReq, tierbytes), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__pool_reintegrate_req__field_indices_by_name[] = { + 1, /* field[1] = id */ + 2, /* field[2] = rank */ + 4, /* field[4] = svc_ranks */ + 0, /* field[0] = sys */ + 3, /* field[3] = targetidx */ + 5, /* field[5] = tierbytes */ +}; +static const ProtobufCIntRange mgmt__pool_reintegrate_req__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 6 } +}; +const ProtobufCMessageDescriptor mgmt__pool_reintegrate_req__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolReintegrateReq", + "PoolReintegrateReq", + "Mgmt__PoolReintegrateReq", + "mgmt", + sizeof(Mgmt__PoolReintegrateReq), + 6, + mgmt__pool_reintegrate_req__field_descriptors, + mgmt__pool_reintegrate_req__field_indices_by_name, + 1, mgmt__pool_reintegrate_req__number_ranges, + (ProtobufCMessageInit) mgmt__pool_reintegrate_req__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__pool_reintegrate_resp__field_descriptors[1] = { { - "sys", + "status", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(Mgmt__PoolExtendReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolExtendReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ranks", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolExtendReq, n_ranks), - offsetof(Mgmt__PoolExtendReq, ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolExtendReq, n_svc_ranks), - offsetof(Mgmt__PoolExtendReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tierbytes", - 5, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT64, - offsetof(Mgmt__PoolExtendReq, n_tierbytes), - offsetof(Mgmt__PoolExtendReq, tierbytes), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "faultDomains", - 6, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolExtendReq, n_faultdomains), - offsetof(Mgmt__PoolExtendReq, faultdomains), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__pool_extend_req__field_indices_by_name[] = { - 5, /* field[5] = faultDomains */ - 1, /* field[1] = id */ - 2, /* field[2] = ranks */ - 3, /* field[3] = svc_ranks */ - 0, /* field[0] = sys */ - 4, /* field[4] = tierbytes */ -}; -static const ProtobufCIntRange mgmt__pool_extend_req__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 6 } -}; -const ProtobufCMessageDescriptor mgmt__pool_extend_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolExtendReq", - "PoolExtendReq", - "Mgmt__PoolExtendReq", - "mgmt", - sizeof(Mgmt__PoolExtendReq), - 6, - mgmt__pool_extend_req__field_descriptors, - mgmt__pool_extend_req__field_indices_by_name, - 1, mgmt__pool_extend_req__number_ranges, - (ProtobufCMessageInit) mgmt__pool_extend_req__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_extend_resp__field_descriptors[2] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolExtendResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tier_bytes", - 2, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT64, - offsetof(Mgmt__PoolExtendResp, n_tier_bytes), - offsetof(Mgmt__PoolExtendResp, tier_bytes), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__pool_extend_resp__field_indices_by_name[] = { - 0, /* field[0] = status */ - 1, /* field[1] = tier_bytes */ -}; -static const ProtobufCIntRange mgmt__pool_extend_resp__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor mgmt__pool_extend_resp__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolExtendResp", - "PoolExtendResp", - "Mgmt__PoolExtendResp", - "mgmt", - sizeof(Mgmt__PoolExtendResp), - 2, - mgmt__pool_extend_resp__field_descriptors, - mgmt__pool_extend_resp__field_indices_by_name, - 1, mgmt__pool_extend_resp__number_ranges, - (ProtobufCMessageInit) mgmt__pool_extend_resp__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_reintegrate_req__field_descriptors[6] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolReintegrateReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolReintegrateReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rank", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolReintegrateReq, rank), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "targetidx", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolReintegrateReq, n_targetidx), - offsetof(Mgmt__PoolReintegrateReq, targetidx), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 5, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolReintegrateReq, n_svc_ranks), - offsetof(Mgmt__PoolReintegrateReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tierbytes", - 6, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT64, - offsetof(Mgmt__PoolReintegrateReq, n_tierbytes), - offsetof(Mgmt__PoolReintegrateReq, tierbytes), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__pool_reintegrate_req__field_indices_by_name[] = { - 1, /* field[1] = id */ - 2, /* field[2] = rank */ - 4, /* field[4] = svc_ranks */ - 0, /* field[0] = sys */ - 3, /* field[3] = targetidx */ - 5, /* field[5] = tierbytes */ -}; -static const ProtobufCIntRange mgmt__pool_reintegrate_req__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 6 } -}; -const ProtobufCMessageDescriptor mgmt__pool_reintegrate_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolReintegrateReq", - "PoolReintegrateReq", - "Mgmt__PoolReintegrateReq", - "mgmt", - sizeof(Mgmt__PoolReintegrateReq), - 6, - mgmt__pool_reintegrate_req__field_descriptors, - mgmt__pool_reintegrate_req__field_indices_by_name, - 1, mgmt__pool_reintegrate_req__number_ranges, - (ProtobufCMessageInit) mgmt__pool_reintegrate_req__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_reintegrate_resp__field_descriptors[1] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolReintegrateResp, status), + offsetof(Mgmt__PoolReintegrateResp, status), NULL, NULL, 0, /* flags */ @@ -2663,882 +2257,576 @@ const ProtobufCMessageDescriptor mgmt__pool_reintegrate_resp__descriptor = static const ProtobufCFieldDescriptor mgmt__list_pools_req__field_descriptors[1] = { { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListPoolsReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__list_pools_req__field_indices_by_name[] = { - 0, /* field[0] = sys */ -}; -static const ProtobufCIntRange mgmt__list_pools_req__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor mgmt__list_pools_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.ListPoolsReq", - "ListPoolsReq", - "Mgmt__ListPoolsReq", - "mgmt", - sizeof(Mgmt__ListPoolsReq), - 1, - mgmt__list_pools_req__field_descriptors, - mgmt__list_pools_req__field_indices_by_name, - 1, mgmt__list_pools_req__number_ranges, - (ProtobufCMessageInit) mgmt__list_pools_req__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__list_pools_resp__pool__field_descriptors[5] = -{ - { - "uuid", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListPoolsResp__Pool, uuid), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "label", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListPoolsResp__Pool, label), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_reps", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__ListPoolsResp__Pool, n_svc_reps), - offsetof(Mgmt__ListPoolsResp__Pool, svc_reps), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "state", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListPoolsResp__Pool, state), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rebuild_state", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListPoolsResp__Pool, rebuild_state), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__list_pools_resp__pool__field_indices_by_name[] = { - 1, /* field[1] = label */ - 4, /* field[4] = rebuild_state */ - 3, /* field[3] = state */ - 2, /* field[2] = svc_reps */ - 0, /* field[0] = uuid */ -}; -static const ProtobufCIntRange mgmt__list_pools_resp__pool__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 5 } -}; -const ProtobufCMessageDescriptor mgmt__list_pools_resp__pool__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.ListPoolsResp.Pool", - "Pool", - "Mgmt__ListPoolsResp__Pool", - "mgmt", - sizeof(Mgmt__ListPoolsResp__Pool), - 5, - mgmt__list_pools_resp__pool__field_descriptors, - mgmt__list_pools_resp__pool__field_indices_by_name, - 1, mgmt__list_pools_resp__pool__number_ranges, - (ProtobufCMessageInit) mgmt__list_pools_resp__pool__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__list_pools_resp__field_descriptors[3] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListPoolsResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pools", - 2, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Mgmt__ListPoolsResp, n_pools), - offsetof(Mgmt__ListPoolsResp, pools), - &mgmt__list_pools_resp__pool__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "data_version", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListPoolsResp, data_version), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__list_pools_resp__field_indices_by_name[] = { - 2, /* field[2] = data_version */ - 1, /* field[1] = pools */ - 0, /* field[0] = status */ -}; -static const ProtobufCIntRange mgmt__list_pools_resp__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 3 } -}; -const ProtobufCMessageDescriptor mgmt__list_pools_resp__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.ListPoolsResp", - "ListPoolsResp", - "Mgmt__ListPoolsResp", - "mgmt", - sizeof(Mgmt__ListPoolsResp), - 3, - mgmt__list_pools_resp__field_descriptors, - mgmt__list_pools_resp__field_indices_by_name, - 1, mgmt__list_pools_resp__number_ranges, - (ProtobufCMessageInit) mgmt__list_pools_resp__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__list_cont_req__field_descriptors[3] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListContReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListContReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__ListContReq, n_svc_ranks), - offsetof(Mgmt__ListContReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__list_cont_req__field_indices_by_name[] = { - 1, /* field[1] = id */ - 2, /* field[2] = svc_ranks */ - 0, /* field[0] = sys */ -}; -static const ProtobufCIntRange mgmt__list_cont_req__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 3 } -}; -const ProtobufCMessageDescriptor mgmt__list_cont_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.ListContReq", - "ListContReq", - "Mgmt__ListContReq", - "mgmt", - sizeof(Mgmt__ListContReq), - 3, - mgmt__list_cont_req__field_descriptors, - mgmt__list_cont_req__field_indices_by_name, - 1, mgmt__list_cont_req__number_ranges, - (ProtobufCMessageInit) mgmt__list_cont_req__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__list_cont_resp__cont__field_descriptors[1] = -{ - { - "uuid", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListContResp__Cont, uuid), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__list_cont_resp__cont__field_indices_by_name[] = { - 0, /* field[0] = uuid */ -}; -static const ProtobufCIntRange mgmt__list_cont_resp__cont__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor mgmt__list_cont_resp__cont__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.ListContResp.Cont", - "Cont", - "Mgmt__ListContResp__Cont", - "mgmt", - sizeof(Mgmt__ListContResp__Cont), - 1, - mgmt__list_cont_resp__cont__field_descriptors, - mgmt__list_cont_resp__cont__field_indices_by_name, - 1, mgmt__list_cont_resp__cont__number_ranges, - (ProtobufCMessageInit) mgmt__list_cont_resp__cont__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__list_cont_resp__field_descriptors[2] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__ListContResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "containers", - 2, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Mgmt__ListContResp, n_containers), - offsetof(Mgmt__ListContResp, containers), - &mgmt__list_cont_resp__cont__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__list_cont_resp__field_indices_by_name[] = { - 1, /* field[1] = containers */ - 0, /* field[0] = status */ -}; -static const ProtobufCIntRange mgmt__list_cont_resp__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor mgmt__list_cont_resp__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.ListContResp", - "ListContResp", - "Mgmt__ListContResp", - "mgmt", - sizeof(Mgmt__ListContResp), - 2, - mgmt__list_cont_resp__field_descriptors, - mgmt__list_cont_resp__field_indices_by_name, - 1, mgmt__list_cont_resp__number_ranges, - (ProtobufCMessageInit) mgmt__list_cont_resp__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_query_req__field_descriptors[5] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolQueryReq, n_svc_ranks), - offsetof(Mgmt__PoolQueryReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "include_enabled_ranks", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryReq, include_enabled_ranks), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "include_disabled_ranks", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryReq, include_disabled_ranks), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__pool_query_req__field_indices_by_name[] = { - 1, /* field[1] = id */ - 4, /* field[4] = include_disabled_ranks */ - 3, /* field[3] = include_enabled_ranks */ - 2, /* field[2] = svc_ranks */ - 0, /* field[0] = sys */ -}; -static const ProtobufCIntRange mgmt__pool_query_req__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 5 } -}; -const ProtobufCMessageDescriptor mgmt__pool_query_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolQueryReq", - "PoolQueryReq", - "Mgmt__PoolQueryReq", - "mgmt", - sizeof(Mgmt__PoolQueryReq), - 5, - mgmt__pool_query_req__field_descriptors, - mgmt__pool_query_req__field_indices_by_name, - 1, mgmt__pool_query_req__number_ranges, - (ProtobufCMessageInit) mgmt__pool_query_req__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__storage_usage_stats__field_descriptors[6] = -{ - { - "total", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__StorageUsageStats, total), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "free", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__StorageUsageStats, free), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "min", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__StorageUsageStats, min), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "max", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__StorageUsageStats, max), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "mean", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__StorageUsageStats, mean), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "media_type", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Mgmt__StorageUsageStats, media_type), - &mgmt__storage_media_type__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__storage_usage_stats__field_indices_by_name[] = { - 1, /* field[1] = free */ - 3, /* field[3] = max */ - 4, /* field[4] = mean */ - 5, /* field[5] = media_type */ - 2, /* field[2] = min */ - 0, /* field[0] = total */ -}; -static const ProtobufCIntRange mgmt__storage_usage_stats__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 6 } -}; -const ProtobufCMessageDescriptor mgmt__storage_usage_stats__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.StorageUsageStats", - "StorageUsageStats", - "Mgmt__StorageUsageStats", - "mgmt", - sizeof(Mgmt__StorageUsageStats), - 6, - mgmt__storage_usage_stats__field_descriptors, - mgmt__storage_usage_stats__field_indices_by_name, - 1, mgmt__storage_usage_stats__number_ranges, - (ProtobufCMessageInit) mgmt__storage_usage_stats__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCEnumValue mgmt__pool_rebuild_status__state__enum_values_by_number[3] = -{ - { "IDLE", "MGMT__POOL_REBUILD_STATUS__STATE__IDLE", 0 }, - { "DONE", "MGMT__POOL_REBUILD_STATUS__STATE__DONE", 1 }, - { "BUSY", "MGMT__POOL_REBUILD_STATUS__STATE__BUSY", 2 }, -}; -static const ProtobufCIntRange mgmt__pool_rebuild_status__state__value_ranges[] = { -{0, 0},{0, 3} -}; -static const ProtobufCEnumValueIndex mgmt__pool_rebuild_status__state__enum_values_by_name[3] = -{ - { "BUSY", 2 }, - { "DONE", 1 }, - { "IDLE", 0 }, -}; -const ProtobufCEnumDescriptor mgmt__pool_rebuild_status__state__descriptor = -{ - PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, - "mgmt.PoolRebuildStatus.State", - "State", - "Mgmt__PoolRebuildStatus__State", - "mgmt", - 3, - mgmt__pool_rebuild_status__state__enum_values_by_number, - 3, - mgmt__pool_rebuild_status__state__enum_values_by_name, - 1, - mgmt__pool_rebuild_status__state__value_ranges, - NULL,NULL,NULL,NULL /* reserved[1234] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_rebuild_status__field_descriptors[4] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolRebuildStatus, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "state", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolRebuildStatus, state), - &mgmt__pool_rebuild_status__state__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "objects", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolRebuildStatus, objects), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "records", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolRebuildStatus, records), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned mgmt__pool_rebuild_status__field_indices_by_name[] = { - 2, /* field[2] = objects */ - 3, /* field[3] = records */ - 1, /* field[1] = state */ - 0, /* field[0] = status */ -}; -static const ProtobufCIntRange mgmt__pool_rebuild_status__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 4 } -}; -const ProtobufCMessageDescriptor mgmt__pool_rebuild_status__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolRebuildStatus", - "PoolRebuildStatus", - "Mgmt__PoolRebuildStatus", - "mgmt", - sizeof(Mgmt__PoolRebuildStatus), - 4, - mgmt__pool_rebuild_status__field_descriptors, - mgmt__pool_rebuild_status__field_indices_by_name, - 1, mgmt__pool_rebuild_status__number_ranges, - (ProtobufCMessageInit) mgmt__pool_rebuild_status__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor mgmt__pool_query_resp__field_descriptors[16] = -{ - { - "status", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "uuid", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, uuid), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "label", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, label), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "total_targets", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, total_targets), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "active_targets", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, active_targets), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "disabled_targets", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, disabled_targets), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rebuild", - 7, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, rebuild), - &mgmt__pool_rebuild_status__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tier_stats", - 8, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Mgmt__PoolQueryResp, n_tier_stats), - offsetof(Mgmt__PoolQueryResp, tier_stats), - &mgmt__storage_usage_stats__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "version", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, version), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "leader", - 11, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, leader), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "enabled_ranks", - 12, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, enabled_ranks), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "disabled_ranks", - 13, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, disabled_ranks), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "total_engines", - 14, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, total_engines), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pool_layout_ver", - 15, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, pool_layout_ver), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "upgrade_layout_ver", - 16, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, upgrade_layout_ver), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "state", - 17, + "sys", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, + PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryResp, state), - &mgmt__pool_service_state__descriptor, + offsetof(Mgmt__ListPoolsReq, sys), NULL, + &protobuf_c_empty_string, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned mgmt__pool_query_resp__field_indices_by_name[] = { - 4, /* field[4] = active_targets */ - 11, /* field[11] = disabled_ranks */ - 5, /* field[5] = disabled_targets */ - 10, /* field[10] = enabled_ranks */ - 2, /* field[2] = label */ - 9, /* field[9] = leader */ - 13, /* field[13] = pool_layout_ver */ - 6, /* field[6] = rebuild */ - 15, /* field[15] = state */ - 0, /* field[0] = status */ - 7, /* field[7] = tier_stats */ - 12, /* field[12] = total_engines */ - 3, /* field[3] = total_targets */ - 14, /* field[14] = upgrade_layout_ver */ - 1, /* field[1] = uuid */ - 8, /* field[8] = version */ +static const unsigned mgmt__list_pools_req__field_indices_by_name[] = { + 0, /* field[0] = sys */ +}; +static const ProtobufCIntRange mgmt__list_pools_req__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor mgmt__list_pools_req__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.ListPoolsReq", + "ListPoolsReq", + "Mgmt__ListPoolsReq", + "mgmt", + sizeof(Mgmt__ListPoolsReq), + 1, + mgmt__list_pools_req__field_descriptors, + mgmt__list_pools_req__field_indices_by_name, + 1, mgmt__list_pools_req__number_ranges, + (ProtobufCMessageInit) mgmt__list_pools_req__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__list_pools_resp__pool__field_descriptors[5] = { + { + "uuid", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__ListPoolsResp__Pool, uuid), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "label", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__ListPoolsResp__Pool, label), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_reps", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__ListPoolsResp__Pool, n_svc_reps), + offsetof(Mgmt__ListPoolsResp__Pool, svc_reps), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "state", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__ListPoolsResp__Pool, state), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rebuild_state", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Mgmt__ListPoolsResp__Pool, rebuild_state), NULL, &protobuf_c_empty_string, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__list_pools_resp__pool__field_indices_by_name[] = { + 1, /* field[1] = label */ + 4, /* field[4] = rebuild_state */ + 3, /* field[3] = state */ + 2, /* field[2] = svc_reps */ + 0, /* field[0] = uuid */ }; -static const ProtobufCIntRange mgmt__pool_query_resp__number_ranges[2 + 1] = +static const ProtobufCIntRange mgmt__list_pools_resp__pool__number_ranges[1 + 1] = { { 1, 0 }, - { 10, 8 }, - { 0, 16 } + { 0, 5 } }; -const ProtobufCMessageDescriptor mgmt__pool_query_resp__descriptor = +const ProtobufCMessageDescriptor mgmt__list_pools_resp__pool__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "mgmt.PoolQueryResp", - "PoolQueryResp", - "Mgmt__PoolQueryResp", + "mgmt.ListPoolsResp.Pool", + "Pool", + "Mgmt__ListPoolsResp__Pool", "mgmt", - sizeof(Mgmt__PoolQueryResp), - 16, - mgmt__pool_query_resp__field_descriptors, - mgmt__pool_query_resp__field_indices_by_name, - 2, mgmt__pool_query_resp__number_ranges, - (ProtobufCMessageInit) mgmt__pool_query_resp__init, + sizeof(Mgmt__ListPoolsResp__Pool), + 5, + mgmt__list_pools_resp__pool__field_descriptors, + mgmt__list_pools_resp__pool__field_indices_by_name, + 1, mgmt__list_pools_resp__pool__number_ranges, + (ProtobufCMessageInit) mgmt__list_pools_resp__pool__init, NULL,NULL,NULL /* reserved[123] */ }; +static const ProtobufCFieldDescriptor mgmt__list_pools_resp__field_descriptors[3] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__ListPoolsResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pools", 2, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Mgmt__ListPoolsResp, n_pools), offsetof(Mgmt__ListPoolsResp, pools), + &mgmt__list_pools_resp__pool__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "data_version", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__ListPoolsResp, data_version), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__list_pools_resp__field_indices_by_name[] = { + 2, /* field[2] = data_version */ + 1, /* field[1] = pools */ + 0, /* field[0] = status */ +}; +static const ProtobufCIntRange mgmt__list_pools_resp__number_ranges[1 + 1] = {{1, 0}, {0, 3}}; +const ProtobufCMessageDescriptor mgmt__list_pools_resp__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.ListPoolsResp", + "ListPoolsResp", + "Mgmt__ListPoolsResp", + "mgmt", + sizeof(Mgmt__ListPoolsResp), + 3, + mgmt__list_pools_resp__field_descriptors, + mgmt__list_pools_resp__field_indices_by_name, + 1, + mgmt__list_pools_resp__number_ranges, + (ProtobufCMessageInit)mgmt__list_pools_resp__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__list_cont_req__field_descriptors[3] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__ListContReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__ListContReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__ListContReq, n_svc_ranks), offsetof(Mgmt__ListContReq, svc_ranks), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__list_cont_req__field_indices_by_name[] = { + 1, /* field[1] = id */ + 2, /* field[2] = svc_ranks */ + 0, /* field[0] = sys */ +}; +static const ProtobufCIntRange mgmt__list_cont_req__number_ranges[1 + 1] = {{1, 0}, {0, 3}}; +const ProtobufCMessageDescriptor mgmt__list_cont_req__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.ListContReq", + "ListContReq", + "Mgmt__ListContReq", + "mgmt", + sizeof(Mgmt__ListContReq), + 3, + mgmt__list_cont_req__field_descriptors, + mgmt__list_cont_req__field_indices_by_name, + 1, + mgmt__list_cont_req__number_ranges, + (ProtobufCMessageInit)mgmt__list_cont_req__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__list_cont_resp__cont__field_descriptors[1] = { + { + "uuid", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__ListContResp__Cont, uuid), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__list_cont_resp__cont__field_indices_by_name[] = { + 0, /* field[0] = uuid */ +}; +static const ProtobufCIntRange mgmt__list_cont_resp__cont__number_ranges[1 + 1] = {{1, 0}, {0, 1}}; +const ProtobufCMessageDescriptor mgmt__list_cont_resp__cont__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.ListContResp.Cont", + "Cont", + "Mgmt__ListContResp__Cont", + "mgmt", + sizeof(Mgmt__ListContResp__Cont), + 1, + mgmt__list_cont_resp__cont__field_descriptors, + mgmt__list_cont_resp__cont__field_indices_by_name, + 1, + mgmt__list_cont_resp__cont__number_ranges, + (ProtobufCMessageInit)mgmt__list_cont_resp__cont__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__list_cont_resp__field_descriptors[2] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__ListContResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "containers", 2, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Mgmt__ListContResp, n_containers), offsetof(Mgmt__ListContResp, containers), + &mgmt__list_cont_resp__cont__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__list_cont_resp__field_indices_by_name[] = { + 1, /* field[1] = containers */ + 0, /* field[0] = status */ +}; +static const ProtobufCIntRange mgmt__list_cont_resp__number_ranges[1 + 1] = {{1, 0}, {0, 2}}; +const ProtobufCMessageDescriptor mgmt__list_cont_resp__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.ListContResp", + "ListContResp", + "Mgmt__ListContResp", + "mgmt", + sizeof(Mgmt__ListContResp), + 2, + mgmt__list_cont_resp__field_descriptors, + mgmt__list_cont_resp__field_indices_by_name, + 1, + mgmt__list_cont_resp__number_ranges, + (ProtobufCMessageInit)mgmt__list_cont_resp__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__pool_query_req__field_descriptors[5] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolQueryReq, n_svc_ranks), offsetof(Mgmt__PoolQueryReq, svc_ranks), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "include_enabled_ranks", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryReq, include_enabled_ranks), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "include_disabled_ranks", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryReq, include_disabled_ranks), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__pool_query_req__field_indices_by_name[] = { + 1, /* field[1] = id */ + 4, /* field[4] = include_disabled_ranks */ + 3, /* field[3] = include_enabled_ranks */ + 2, /* field[2] = svc_ranks */ + 0, /* field[0] = sys */ +}; +static const ProtobufCIntRange mgmt__pool_query_req__number_ranges[1 + 1] = {{1, 0}, {0, 5}}; +const ProtobufCMessageDescriptor mgmt__pool_query_req__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolQueryReq", + "PoolQueryReq", + "Mgmt__PoolQueryReq", + "mgmt", + sizeof(Mgmt__PoolQueryReq), + 5, + mgmt__pool_query_req__field_descriptors, + mgmt__pool_query_req__field_indices_by_name, + 1, + mgmt__pool_query_req__number_ranges, + (ProtobufCMessageInit)mgmt__pool_query_req__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__storage_usage_stats__field_descriptors[6] = { + { + "total", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__StorageUsageStats, total), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "free", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__StorageUsageStats, free), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "min", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__StorageUsageStats, min), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "max", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__StorageUsageStats, max), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "mean", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__StorageUsageStats, mean), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "media_type", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ + offsetof(Mgmt__StorageUsageStats, media_type), &mgmt__storage_media_type__descriptor, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__storage_usage_stats__field_indices_by_name[] = { + 1, /* field[1] = free */ + 3, /* field[3] = max */ + 4, /* field[4] = mean */ + 5, /* field[5] = media_type */ + 2, /* field[2] = min */ + 0, /* field[0] = total */ +}; +static const ProtobufCIntRange mgmt__storage_usage_stats__number_ranges[1 + 1] = {{1, 0}, {0, 6}}; +const ProtobufCMessageDescriptor mgmt__storage_usage_stats__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.StorageUsageStats", + "StorageUsageStats", + "Mgmt__StorageUsageStats", + "mgmt", + sizeof(Mgmt__StorageUsageStats), + 6, + mgmt__storage_usage_stats__field_descriptors, + mgmt__storage_usage_stats__field_indices_by_name, + 1, + mgmt__storage_usage_stats__number_ranges, + (ProtobufCMessageInit)mgmt__storage_usage_stats__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCEnumValue mgmt__pool_rebuild_status__state__enum_values_by_number[3] = { + {"IDLE", "MGMT__POOL_REBUILD_STATUS__STATE__IDLE", 0}, + {"DONE", "MGMT__POOL_REBUILD_STATUS__STATE__DONE", 1}, + {"BUSY", "MGMT__POOL_REBUILD_STATUS__STATE__BUSY", 2}, +}; +static const ProtobufCIntRange mgmt__pool_rebuild_status__state__value_ranges[] = {{0, 0}, {0, 3}}; +static const ProtobufCEnumValueIndex mgmt__pool_rebuild_status__state__enum_values_by_name[3] = { + {"BUSY", 2}, + {"DONE", 1}, + {"IDLE", 0}, +}; +const ProtobufCEnumDescriptor mgmt__pool_rebuild_status__state__descriptor = { + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "mgmt.PoolRebuildStatus.State", + "State", + "Mgmt__PoolRebuildStatus__State", + "mgmt", + 3, + mgmt__pool_rebuild_status__state__enum_values_by_number, + 3, + mgmt__pool_rebuild_status__state__enum_values_by_name, + 1, + mgmt__pool_rebuild_status__state__value_ranges, + NULL, + NULL, + NULL, + NULL /* reserved[1234] */ +}; +static const ProtobufCFieldDescriptor mgmt__pool_rebuild_status__field_descriptors[4] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolRebuildStatus, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "state", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolRebuildStatus, state), &mgmt__pool_rebuild_status__state__descriptor, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "objects", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolRebuildStatus, objects), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "records", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolRebuildStatus, records), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__pool_rebuild_status__field_indices_by_name[] = { + 2, /* field[2] = objects */ + 3, /* field[3] = records */ + 1, /* field[1] = state */ + 0, /* field[0] = status */ +}; +static const ProtobufCIntRange mgmt__pool_rebuild_status__number_ranges[1 + 1] = {{1, 0}, {0, 4}}; +const ProtobufCMessageDescriptor mgmt__pool_rebuild_status__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolRebuildStatus", + "PoolRebuildStatus", + "Mgmt__PoolRebuildStatus", + "mgmt", + sizeof(Mgmt__PoolRebuildStatus), + 4, + mgmt__pool_rebuild_status__field_descriptors, + mgmt__pool_rebuild_status__field_indices_by_name, + 1, + mgmt__pool_rebuild_status__number_ranges, + (ProtobufCMessageInit)mgmt__pool_rebuild_status__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor mgmt__pool_query_resp__field_descriptors[18] = { + { + "status", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "uuid", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, uuid), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "label", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, label), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "total_targets", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, total_targets), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "active_targets", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, active_targets), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "disabled_targets", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, disabled_targets), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rebuild", 7, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, rebuild), &mgmt__pool_rebuild_status__descriptor, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "tier_stats", 8, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Mgmt__PoolQueryResp, n_tier_stats), offsetof(Mgmt__PoolQueryResp, tier_stats), + &mgmt__storage_usage_stats__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "version", 10, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, version), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "leader", 11, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, leader), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "enabled_ranks", 12, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, enabled_ranks), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "disabled_ranks", 13, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, disabled_ranks), NULL, &protobuf_c_empty_string, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "total_engines", 14, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, total_engines), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pool_layout_ver", 15, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, pool_layout_ver), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "upgrade_layout_ver", 16, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, upgrade_layout_ver), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "state", 17, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, state), &mgmt__pool_service_state__descriptor, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ldr", 18, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryResp, svc_ldr), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_reps", 19, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolQueryResp, n_svc_reps), offsetof(Mgmt__PoolQueryResp, svc_reps), NULL, + NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned mgmt__pool_query_resp__field_indices_by_name[] = { + 4, /* field[4] = active_targets */ + 11, /* field[11] = disabled_ranks */ + 5, /* field[5] = disabled_targets */ + 10, /* field[10] = enabled_ranks */ + 2, /* field[2] = label */ + 9, /* field[9] = leader */ + 13, /* field[13] = pool_layout_ver */ + 6, /* field[6] = rebuild */ + 15, /* field[15] = state */ + 0, /* field[0] = status */ + 16, /* field[16] = svc_ldr */ + 17, /* field[17] = svc_reps */ + 7, /* field[7] = tier_stats */ + 12, /* field[12] = total_engines */ + 3, /* field[3] = total_targets */ + 14, /* field[14] = upgrade_layout_ver */ + 1, /* field[1] = uuid */ + 8, /* field[8] = version */ +}; +static const ProtobufCIntRange mgmt__pool_query_resp__number_ranges[2 + 1] = { + {1, 0}, {10, 8}, {0, 18}}; +const ProtobufCMessageDescriptor mgmt__pool_query_resp__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "mgmt.PoolQueryResp", + "PoolQueryResp", + "Mgmt__PoolQueryResp", + "mgmt", + sizeof(Mgmt__PoolQueryResp), + 18, + mgmt__pool_query_resp__field_descriptors, + mgmt__pool_query_resp__field_indices_by_name, + 2, + mgmt__pool_query_resp__number_ranges, + (ProtobufCMessageInit)mgmt__pool_query_resp__init, + NULL, + NULL, + NULL /* reserved[123] */ +}; static const ProtobufCFieldDescriptor mgmt__pool_property__field_descriptors[3] = { { @@ -3603,56 +2891,29 @@ const ProtobufCMessageDescriptor mgmt__pool_property__descriptor = (ProtobufCMessageInit) mgmt__pool_property__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_set_prop_req__field_descriptors[4] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolSetPropReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolSetPropReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "properties", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Mgmt__PoolSetPropReq, n_properties), - offsetof(Mgmt__PoolSetPropReq, properties), - &mgmt__pool_property__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolSetPropReq, n_svc_ranks), - offsetof(Mgmt__PoolSetPropReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_set_prop_req__field_descriptors[4] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolSetPropReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolSetPropReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "properties", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Mgmt__PoolSetPropReq, n_properties), offsetof(Mgmt__PoolSetPropReq, properties), + &mgmt__pool_property__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolSetPropReq, n_svc_ranks), offsetof(Mgmt__PoolSetPropReq, svc_ranks), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_set_prop_req__field_indices_by_name[] = { 1, /* field[1] = id */ @@ -3718,56 +2979,29 @@ const ProtobufCMessageDescriptor mgmt__pool_set_prop_resp__descriptor = (ProtobufCMessageInit) mgmt__pool_set_prop_resp__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_get_prop_req__field_descriptors[4] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolGetPropReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolGetPropReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "properties", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Mgmt__PoolGetPropReq, n_properties), - offsetof(Mgmt__PoolGetPropReq, properties), - &mgmt__pool_property__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolGetPropReq, n_svc_ranks), - offsetof(Mgmt__PoolGetPropReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_get_prop_req__field_descriptors[4] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolGetPropReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolGetPropReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "properties", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Mgmt__PoolGetPropReq, n_properties), offsetof(Mgmt__PoolGetPropReq, properties), + &mgmt__pool_property__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolGetPropReq, n_svc_ranks), offsetof(Mgmt__PoolGetPropReq, svc_ranks), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_get_prop_req__field_indices_by_name[] = { 1, /* field[1] = id */ @@ -3846,44 +3080,23 @@ const ProtobufCMessageDescriptor mgmt__pool_get_prop_resp__descriptor = (ProtobufCMessageInit) mgmt__pool_get_prop_resp__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_upgrade_req__field_descriptors[3] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolUpgradeReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolUpgradeReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolUpgradeReq, n_svc_ranks), - offsetof(Mgmt__PoolUpgradeReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_upgrade_req__field_descriptors[3] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolUpgradeReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolUpgradeReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolUpgradeReq, n_svc_ranks), offsetof(Mgmt__PoolUpgradeReq, svc_ranks), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_upgrade_req__field_indices_by_name[] = { 1, /* field[1] = id */ @@ -3948,68 +3161,34 @@ const ProtobufCMessageDescriptor mgmt__pool_upgrade_resp__descriptor = (ProtobufCMessageInit) mgmt__pool_upgrade_resp__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor mgmt__pool_query_target_req__field_descriptors[5] = -{ - { - "sys", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryTargetReq, sys), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "id", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryTargetReq, id), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rank", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Mgmt__PoolQueryTargetReq, rank), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "targets", - 4, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolQueryTargetReq, n_targets), - offsetof(Mgmt__PoolQueryTargetReq, targets), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "svc_ranks", - 5, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_UINT32, - offsetof(Mgmt__PoolQueryTargetReq, n_svc_ranks), - offsetof(Mgmt__PoolQueryTargetReq, svc_ranks), - NULL, - NULL, - 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor mgmt__pool_query_target_req__field_descriptors[5] = { + { + "sys", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryTargetReq, sys), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "id", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryTargetReq, id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rank", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Mgmt__PoolQueryTargetReq, rank), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "targets", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolQueryTargetReq, n_targets), offsetof(Mgmt__PoolQueryTargetReq, targets), + NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "svc_ranks", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, + offsetof(Mgmt__PoolQueryTargetReq, n_svc_ranks), + offsetof(Mgmt__PoolQueryTargetReq, svc_ranks), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned mgmt__pool_query_target_req__field_indices_by_name[] = { 1, /* field[1] = id */ diff --git a/src/mgmt/pool.pb-c.h b/src/mgmt/pool.pb-c.h index fe28bea4b91..4e461323eed 100644 --- a/src/mgmt/pool.pb-c.h +++ b/src/mgmt/pool.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 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION +#elif 1003000 < 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 @@ -825,7 +825,7 @@ struct _Mgmt__PoolQueryResp */ uint32_t version; /* - * current raft leader + * current raft leader (2.4) */ uint32_t leader; /* @@ -852,11 +852,23 @@ struct _Mgmt__PoolQueryResp * pool state */ Mgmt__PoolServiceState state; + /* + * current raft leader (2.6+) + */ + uint32_t svc_ldr; + /* + * service replica ranks + */ + size_t n_svc_reps; + uint32_t *svc_reps; }; -#define MGMT__POOL_QUERY_RESP__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&mgmt__pool_query_resp__descriptor) \ - , 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, 0, 0, NULL, 0,NULL, 0, 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, 0, 0, MGMT__POOL_SERVICE_STATE__Creating } - +#define MGMT__POOL_QUERY_RESP__INIT \ + { \ + PROTOBUF_C_MESSAGE_INIT(&mgmt__pool_query_resp__descriptor) \ + , 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, 0, 0, NULL, 0, \ + NULL, 0, 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, 0, \ + 0, MGMT__POOL_SERVICE_STATE__Creating, 0, 0, NULL \ + } typedef enum { MGMT__POOL_PROPERTY__VALUE__NOT_SET = 0, diff --git a/src/mgmt/srv_drpc.c b/src/mgmt/srv_drpc.c index 013ad396699..02537c3dc14 100644 --- a/src/mgmt/srv_drpc.c +++ b/src/mgmt/srv_drpc.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2019-2023 Intel Corporation. + * (C) Copyright 2019-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -1797,7 +1797,9 @@ ds_mgmt_drpc_pool_query(Drpc__Call *drpc_req, Drpc__Response *drpc_resp) resp.disabled_targets = pool_info.pi_ndisabled; resp.active_targets = pool_info.pi_space.ps_ntargets; resp.total_engines = pool_info.pi_nnodes; - resp.leader = pool_info.pi_leader; + resp.svc_ldr = pool_info.pi_leader; + resp.svc_reps = req->svc_ranks; + resp.n_svc_reps = req->n_svc_ranks; resp.version = pool_info.pi_map_ver; resp.enabled_ranks = (req->include_enabled_ranks) ? range_list_str : ""; resp.disabled_ranks = (req->include_disabled_ranks) ? range_list_str : ""; diff --git a/src/proto/mgmt/pool.proto b/src/proto/mgmt/pool.proto index 38712ef1ad4..e9a50a5c758 100644 --- a/src/proto/mgmt/pool.proto +++ b/src/proto/mgmt/pool.proto @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2023 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -229,13 +229,15 @@ message PoolQueryResp { PoolRebuildStatus rebuild = 7; // pool rebuild status repeated StorageUsageStats tier_stats = 8; // storage tiers usage stats uint32 version = 10; // latest pool map version - uint32 leader = 11; // current raft leader + uint32 leader = 11; // current raft leader (2.4) string enabled_ranks = 12; // optional set of ranks enabled string disabled_ranks = 13; // optional set of ranks disabled uint32 total_engines = 14; // total engines in pool uint32 pool_layout_ver = 15; // current pool global version uint32 upgrade_layout_ver = 16; // latest pool global version to upgrade PoolServiceState state = 17; // pool state + uint32 svc_ldr = 18; // current raft leader (2.6+) + repeated uint32 svc_reps = 19; // service replica ranks } message PoolProperty { diff --git a/src/tests/ftest/control/dmg_pool_query_test.py b/src/tests/ftest/control/dmg_pool_query_test.py index a3cf6797a85..96561d30292 100644 --- a/src/tests/ftest/control/dmg_pool_query_test.py +++ b/src/tests/ftest/control/dmg_pool_query_test.py @@ -1,5 +1,5 @@ """ - (C) Copyright 2020-2022 Intel Corporation. + (C) Copyright 2020-2024 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ @@ -35,7 +35,7 @@ def test_pool_query_basic(self): :avocado: tags=all,daily_regression :avocado: tags=hw,medium - :avocado: tags=dmg,pool_query,basic,control + :avocado: tags=dmg,pool_query,basic,control,pool :avocado: tags=DmgPoolQueryTest,test_pool_query_basic """ self.log.info("==> Verify dmg output against expected output:") @@ -45,28 +45,37 @@ def test_pool_query_basic(self): # fluctuate across test runs. In addition, they're related to object # placement and testing them wouldn't be straightforward, so we'll need # some separate test cases. - del self.pool.query_data["response"]["tier_stats"][0]["free"] - del self.pool.query_data["response"]["tier_stats"][0]["min"] - del self.pool.query_data["response"]["tier_stats"][0]["max"] - del self.pool.query_data["response"]["tier_stats"][0]["mean"] - del self.pool.query_data["response"]["tier_stats"][1]["free"] - del self.pool.query_data["response"]["tier_stats"][1]["min"] - del self.pool.query_data["response"]["tier_stats"][1]["max"] - del self.pool.query_data["response"]["tier_stats"][1]["mean"] + for tier in self.pool.query_data["response"]["tier_stats"]: + del tier["free"] + del tier["min"] + del tier["max"] + del tier["mean"] + for usage in self.pool.query_data["response"]["usage"]: + del usage["free"] + del usage["imbalance"] # Get the expected pool query values from the test yaml. This should be as simple as: # exp_info = self.params.get("exp_vals", path="/run/*", default={}) # but this yields an empty dictionary (the default), so it needs to be defined manually: exp_info = { + "enabled_ranks": None, + "disabled_ranks": None, "status": self.params.get("pool_status", path="/run/exp_vals/*"), - 'state': self.params.get("pool_state", path="/run/exp_vals/*"), + "state": self.params.get("pool_state", path="/run/exp_vals/*"), "uuid": self.pool.uuid.lower(), "total_targets": self.params.get("total_targets", path="/run/exp_vals/*"), "active_targets": self.params.get("active_targets", path="/run/exp_vals/*"), "total_engines": self.params.get("total_engines", path="/run/exp_vals/*"), "disabled_targets": self.params.get("disabled_targets", path="/run/exp_vals/*"), "version": self.params.get("version", path="/run/exp_vals/*"), - "leader": self.params.get("leader", path="/run/exp_vals/*"), + "svc_ldr": self.params.get("leader", path="/run/exp_vals/*"), + "svc_reps": self.params.get("replicas", path="/run/exp_vals/*"), + "rebuild": { + "status": self.params.get("rebuild_status", path="/run/exp_vals/rebuild/*"), + "state": self.params.get("state", path="/run/exp_vals/rebuild/*"), + "objects": self.params.get("objects", path="/run/exp_vals/rebuild/*"), + "records": self.params.get("records", path="/run/exp_vals/rebuild/*") + }, "tier_stats": [ { "media_type": "scm", @@ -79,14 +88,16 @@ def test_pool_query_basic(self): ], "pool_layout_ver": 3, "upgrade_layout_ver": 3, - "rebuild": { - "status": self.params.get("rebuild_status", path="/run/exp_vals/rebuild/*"), - "state": self.params.get("state", path="/run/exp_vals/rebuild/*"), - "objects": self.params.get("objects", path="/run/exp_vals/rebuild/*"), - "records": self.params.get("records", path="/run/exp_vals/rebuild/*") - }, - "enabled_ranks": None, - "disabled_ranks": None + "usage": [ + { + "tier_name": "SCM", + "size": self.params.get("total", path="/run/exp_vals/scm/*") + }, + { + "tier_name": "NVME", + "size": self.params.get("total", path="/run/exp_vals/nvme/*") + } + ] } self.assertDictEqual( @@ -105,7 +116,7 @@ def test_pool_query_inputs(self): :avocado: tags=all,daily_regression :avocado: tags=hw,medium - :avocado: tags=dmg,pool_query,basic,control + :avocado: tags=dmg,pool_query,basic,control,pool :avocado: tags=DmgPoolQueryTest,test_pool_query_inputs """ # Get test UUIDs @@ -152,7 +163,7 @@ def test_pool_query_ior(self): :avocado: tags=all,daily_regression :avocado: tags=hw,medium - :avocado: tags=dmg,pool_query,basic,control + :avocado: tags=dmg,pool_query,basic,control,pool :avocado: tags=DmgPoolQueryTest,test_pool_query_ior """ # Store original pool info diff --git a/src/tests/ftest/control/dmg_pool_query_test.yaml b/src/tests/ftest/control/dmg_pool_query_test.yaml index 52b4d2a47fa..89c7630f663 100644 --- a/src/tests/ftest/control/dmg_pool_query_test.yaml +++ b/src/tests/ftest/control/dmg_pool_query_test.yaml @@ -33,6 +33,7 @@ exp_vals: disabled_targets: 0 version: 1 leader: 0 + replicas: [0] scm: total: 16000008192 nvme: diff --git a/src/tests/ftest/control/dmg_telemetry_basic.py b/src/tests/ftest/control/dmg_telemetry_basic.py index 7882ff0fe71..39eb520aef2 100644 --- a/src/tests/ftest/control/dmg_telemetry_basic.py +++ b/src/tests/ftest/control/dmg_telemetry_basic.py @@ -98,7 +98,7 @@ def test_container_telemetry(self): open_close_qty = self.params.get("open_close_qty", "/run/test/*", 2) self.add_pool(connect=False) self.pool.set_query_data() - pool_leader_rank = self.pool.query_data["response"]["leader"] + pool_leader_rank = self.pool.query_data["response"]["svc_ldr"] self.pool_leader_host = self.server_managers[0].get_host(pool_leader_rank) self.log.info( "Pool leader host: %s (rank: %s)", diff --git a/src/tests/ftest/pool/destroy_rebuild.py b/src/tests/ftest/pool/destroy_rebuild.py index 8f9d1d4adf7..753e8fb009e 100644 --- a/src/tests/ftest/pool/destroy_rebuild.py +++ b/src/tests/ftest/pool/destroy_rebuild.py @@ -59,7 +59,7 @@ def test_destroy_while_rebuilding(self): # Get the pool leader rank pool.set_query_data() - leader_rank = pool.query_data["response"]["leader"] + leader_rank = pool.query_data["response"]["svc_ldr"] if leader_rank in ap_ranks: ap_ranks.remove(leader_rank) elif leader_rank in non_ap_ranks: diff --git a/src/tests/ftest/pool/list_verbose.py b/src/tests/ftest/pool/list_verbose.py index d794f004789..74d50231567 100644 --- a/src/tests/ftest/pool/list_verbose.py +++ b/src/tests/ftest/pool/list_verbose.py @@ -1,5 +1,5 @@ """ - (C) Copyright 2018-2023 Intel Corporation. + (C) Copyright 2018-2024 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ @@ -49,8 +49,10 @@ def create_expected(self, pool, scm_free, nvme_free, scm_imbalance, if scm_size is None: scm_size = pool.scm_size.value * rank_count + scm_size = int(scm_size) if nvme_size is None: nvme_size = pool.nvme_size.value * rank_count + nvme_size = int(nvme_size) targets_total = self.server_managers[0].get_config_value("targets") * rank_count @@ -59,17 +61,36 @@ def create_expected(self, pool, scm_free, nvme_free, scm_imbalance, upgrade_layout_ver = p_query["response"]["upgrade_layout_ver"] return { + "state": state, "uuid": pool.uuid.lower(), "label": pool.label.value, - "svc_ldr": 0, + "total_targets": targets_total, + "active_targets": targets_total - targets_disabled, + "total_engines": rank_count, + "disabled_targets": targets_disabled, + "svc_ldr": pool.svc_leader, "svc_reps": pool.svc_ranks, - "state": state, - "targets_total": targets_total, - "targets_disabled": targets_disabled, "upgrade_layout_ver": upgrade_layout_ver, "pool_layout_ver": pool_layout_ver, - "query_error_msg": "", - "query_status_msg": "", + "rebuild": { + "status": 0, + "state": rebuild_state, + "objects": 0, + "records": 0 + }, + # NB: tests should not expect min/max/mean values + "tier_stats": [ + { + "total": scm_size, + "free": scm_free, + "media_type": "scm", + }, + { + "total": nvme_size, + "free": nvme_free, + "media_type": "nvme", + }, + ], "usage": [ { "tier_name": "SCM", @@ -78,12 +99,11 @@ def create_expected(self, pool, scm_free, nvme_free, scm_imbalance, "imbalance": scm_imbalance }, { - "tier_name": "NVMe", + "tier_name": "NVME", "size": nvme_size, "free": nvme_free, "imbalance": nvme_imbalance }], - "rebuild_state": rebuild_state } @staticmethod @@ -112,7 +132,7 @@ def get_scm_nvme_free_imbalance(pool_list_out): scm_size = usage["size"] scm_free = usage["free"] scm_imbalance = usage["imbalance"] - elif usage["tier_name"] == "NVMe": + elif usage["tier_name"] == "NVME": nvme_free = usage["free"] nvme_imbalance = usage["imbalance"] @@ -171,6 +191,12 @@ def verify_pool_lists(self, targets_disabled, scm_size, nvme_size, state, rebuil expected_pools = [] actual_pools = self.get_dmg_command().get_pool_list_all(verbose=True) + for pool in actual_pools: + del pool['version'] # not easy to calculate expected value, could cause flaky tests + for tier in pool["tier_stats"]: # expected values are tricky to calculate + del tier['min'] + del tier['max'] + del tier['mean'] # Get free and imbalance from actual so that we can use them in expected. free_data = self.get_scm_nvme_free_imbalance(actual_pools) @@ -334,7 +360,7 @@ def verify_used_imbalance(self, storage): # 1. Create a pool of 80GB. self.pool = [] - if storage == "NVMe": + if storage == "NVME": self.pool.append(self.get_pool(namespace="/run/pool_both/*")) nvme_size = [None] else: @@ -412,7 +438,7 @@ def test_used_imbalance(self): """ errors = [] self.log.debug("---------- NVMe test ----------") - errors.extend(self.verify_used_imbalance("NVMe")) + errors.extend(self.verify_used_imbalance("NVME")) self.log.debug("---------- SCM test ----------") errors.extend(self.verify_used_imbalance("SCM")) diff --git a/src/tests/ftest/pool/svc.py b/src/tests/ftest/pool/svc.py index 181e300cf40..6375206fab8 100644 --- a/src/tests/ftest/pool/svc.py +++ b/src/tests/ftest/pool/svc.py @@ -33,7 +33,7 @@ def check_leader(self, previous_leader=None, expect_change=True): self.pool.use_label = True try: - current_leader = int(self.pool.query_data["response"]["leader"]) + current_leader = int(self.pool.query_data["response"]["svc_ldr"]) except KeyError as error: self.log.error("self.pool.query_data: %s", self.pool.query_data) self.fail( diff --git a/src/tests/ftest/util/dmg_utils.py b/src/tests/ftest/util/dmg_utils.py index c31aa74198b..c509fbf1541 100644 --- a/src/tests/ftest/util/dmg_utils.py +++ b/src/tests/ftest/util/dmg_utils.py @@ -631,6 +631,7 @@ def pool_create(self, scm_size, uid=None, gid=None, nvme_size=None, data["status"] = output["status"] data["uuid"] = output["response"]["uuid"] data["svc"] = ",".join([str(svc) for svc in output["response"]["svc_reps"]]) + data["leader"] = output["response"]["svc_ldr"] data["ranks"] = ",".join([str(r) for r in output["response"]["tgt_ranks"]]) data["scm_per_rank"] = output["response"]["tier_bytes"][0] data["nvme_per_rank"] = output["response"]["tier_bytes"][1] @@ -662,7 +663,7 @@ def pool_query(self, pool, show_enabled=False, show_disabled=False): # "total_engines": 1, # "disabled_targets": 0, # "version": 1, - # "leader": 0, + # "svc_ldr": 0, # "rebuild": { # "status": 0, # "state": "idle", @@ -838,10 +839,8 @@ def pool_list(self, no_query=False, verbose=False): # "svc_reps": [ # 0 # ], - # "targets_total": 8, - # "targets_disabled": 0, - # "query_error_msg": "", - # "query_status_msg": "", + # "total_targets": 8, + # "disabled_targets": 0, # "usage": [ # { # "tier_name": "SCM", diff --git a/src/tests/ftest/util/test_utils_pool.py b/src/tests/ftest/util/test_utils_pool.py index 48e79d61994..fbb6484e292 100644 --- a/src/tests/ftest/util/test_utils_pool.py +++ b/src/tests/ftest/util/test_utils_pool.py @@ -242,6 +242,7 @@ def __init__(self, context, dmg_command, label_generator=None, namespace=POOL_NA self.pool = None self.info = None self.svc_ranks = None + self.svc_leader = None self.connected = False # Flag to allow the non-create operations to use UUID. e.g., if you want # to destroy the pool with UUID, set this to False, then call destroy(). @@ -454,6 +455,7 @@ def create(self): self.svc_ranks = [ int(self.pool.svc.rl_ranks[index]) for index in range(self.pool.svc.rl_nr)] + self.svc_leader = int(data["leader"]) @fail_on(DaosApiError) def connect(self, permission=2): @@ -1044,7 +1046,7 @@ def get_space_per_target(self, ranks, target_idx): rank_result = self.query_targets(rank=rank, target_idx=target_idx) for target, target_info in enumerate(rank_result['response']['Infos']): rank_target_tier_space[rank][target] = {} - for tier in target_info['Space']: + for tier in target_info['space']: rank_target_tier_space[rank][target][tier['media_type']] = { 'total': tier['total'], 'free': tier['free'],