Skip to content

Commit

Permalink
DAOS-14422 control: Update pool query UX for MD-on-SSD phase2
Browse files Browse the repository at this point in the history
Required-githooks: true

Signed-off-by: Tom Nabarro <[email protected]>
  • Loading branch information
tanabarr committed Aug 8, 2024
1 parent cb11ae8 commit 91a5b89
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 116 deletions.
6 changes: 3 additions & 3 deletions src/control/cmd/daos/pretty/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func printPoolTiers(suss []*daos.StorageUsageStats, w *txtfmt.ErrWriter, fullSta
// Meta-blob aggregate size.
if fullStats {
fmt.Fprintf(w, "- Total memory-file size: %s\n",
humanize.Bytes(tierStats.Total))
humanize.Bytes(memFileBytes))
}
fmt.Fprintf(w, "- Metadata storage:\n")
mdOnSSD = true
Expand Down Expand Up @@ -93,7 +93,7 @@ func PrintPoolInfo(pi *daos.PoolInfo, out io.Writer) error {
if pi.QueryMask.HasOption(daos.PoolQueryOptionSpace) && pi.TierStats != nil {
fmt.Fprintln(w, "Pool space info:")
fmt.Fprintf(w, "- Target count:%d\n", pi.ActiveTargets)
printPoolTiers(pi.TierStats, w, true)
printPoolTiers(pi.MemFileBytes, pi.TierStats, w, true)
}
return w.Err
}
Expand All @@ -109,7 +109,7 @@ func PrintPoolQueryTargetInfo(pqti *daos.PoolQueryTargetInfo, out io.Writer) err
// 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 {
printPoolTiers(pqti.Space, w, false)
printPoolTiers(pqti.MemFileBytes, pqti.Space, w, false)
}

return w.Err
Expand Down
4 changes: 2 additions & 2 deletions src/control/cmd/dmg/pretty/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func printTierBytesRow(fmtName string, tierBytes uint64, numRanks int) txtfmt.Ta
}
}

func getPoolRespStorageRows(mdOnSSD bool, tierBytes []uint64, tierRatios []float64, numRanks int) (title string, rows []txtfmt.TableRow) {
func getPoolCreateRespRows(mdOnSSD bool, tierBytes []uint64, tierRatios []float64, numRanks int) (title string, rows []txtfmt.TableRow) {
title = "Pool created with "
tierName := "SCM"
if mdOnSSD {
Expand Down Expand Up @@ -124,7 +124,7 @@ func PrintPoolCreateResponse(pcr *control.PoolCreateResp, out io.Writer, opts ..

mdOnSsdEnabled := pcr.MemFileBytes > 0

title, tierRows := getPoolRespStorageRows(mdOnSsdEnabled, pcr.TierBytes, tierRatios,
title, tierRows := getPoolCreateRespRows(mdOnSsdEnabled, pcr.TierBytes, tierRatios,
numRanks)

// Print memory-file to meta-blob ratio for MD-on-SSD.
Expand Down
216 changes: 118 additions & 98 deletions src/control/common/proto/mgmt/pool.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/control/lib/control/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ type (
SvcReps []uint32 `json:"svc_reps"`
TgtRanks []uint32 `json:"tgt_ranks"`
TierBytes []uint64 `json:"tier_bytes"` // Per-rank storage tier sizes.
MemFileBytes uint64 `json:"mem_file_bytes"` // MD-on-SSD mode only.
MemFileBytes uint64 `json:"mem_file_bytes"` // Per-rank. MD-on-SSD mode only.
}
)

Expand Down
8 changes: 5 additions & 3 deletions src/control/lib/daos/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,18 @@ type (
DisabledRanks *ranklist.RankSet `json:"disabled_ranks,omitempty"`
PoolLayoutVer uint32 `json:"pool_layout_ver"`
UpgradeLayoutVer uint32 `json:"upgrade_layout_ver"`
MemFileBytes uint64 `json:"mem_file_bytes"`
}

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"`
Type PoolQueryTargetType `json:"target_type"`
State PoolQueryTargetState `json:"target_state"`
Space []*StorageUsageStats `json:"space"`
MemFileBytes uint64 `json:"mem_file_bytes"`
}

// StorageTargetUsage represents DAOS target storage usage
Expand Down
38 changes: 32 additions & 6 deletions src/mgmt/pool.pb-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -3305,7 +3305,7 @@ const ProtobufCMessageDescriptor mgmt__pool_rebuild_status__descriptor =
(ProtobufCMessageInit) mgmt__pool_rebuild_status__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor mgmt__pool_query_resp__field_descriptors[19] =
static const ProtobufCFieldDescriptor mgmt__pool_query_resp__field_descriptors[20] =
{
{
"status",
Expand Down Expand Up @@ -3535,6 +3535,18 @@ static const ProtobufCFieldDescriptor mgmt__pool_query_resp__field_descriptors[1
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"mem_file_bytes",
21,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Mgmt__PoolQueryResp, mem_file_bytes),
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 */
Expand All @@ -3543,6 +3555,7 @@ static const unsigned mgmt__pool_query_resp__field_indices_by_name[] = {
10, /* field[10] = enabled_ranks */
2, /* field[2] = label */
9, /* field[9] = leader */
19, /* field[19] = mem_file_bytes */
13, /* field[13] = pool_layout_ver */
18, /* field[18] = query_mask */
6, /* field[6] = rebuild */
Expand All @@ -3561,7 +3574,7 @@ static const ProtobufCIntRange mgmt__pool_query_resp__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 10, 8 },
{ 0, 19 }
{ 0, 20 }
};
const ProtobufCMessageDescriptor mgmt__pool_query_resp__descriptor =
{
Expand All @@ -3571,7 +3584,7 @@ const ProtobufCMessageDescriptor mgmt__pool_query_resp__descriptor =
"Mgmt__PoolQueryResp",
"mgmt",
sizeof(Mgmt__PoolQueryResp),
19,
20,
mgmt__pool_query_resp__field_descriptors,
mgmt__pool_query_resp__field_indices_by_name,
2, mgmt__pool_query_resp__number_ranges,
Expand Down Expand Up @@ -4213,7 +4226,7 @@ const ProtobufCEnumDescriptor mgmt__pool_query_target_info__target_state__descri
mgmt__pool_query_target_info__target_state__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};
static const ProtobufCFieldDescriptor mgmt__pool_query_target_info__field_descriptors[3] =
static const ProtobufCFieldDescriptor mgmt__pool_query_target_info__field_descriptors[4] =
{
{
"type",
Expand Down Expand Up @@ -4251,16 +4264,29 @@ static const ProtobufCFieldDescriptor mgmt__pool_query_target_info__field_descri
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"mem_file_bytes",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Mgmt__PoolQueryTargetInfo, mem_file_bytes),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned mgmt__pool_query_target_info__field_indices_by_name[] = {
3, /* field[3] = mem_file_bytes */
2, /* field[2] = space */
1, /* field[1] = state */
0, /* field[0] = type */
};
static const ProtobufCIntRange mgmt__pool_query_target_info__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
{ 0, 4 }
};
const ProtobufCMessageDescriptor mgmt__pool_query_target_info__descriptor =
{
Expand All @@ -4270,7 +4296,7 @@ const ProtobufCMessageDescriptor mgmt__pool_query_target_info__descriptor =
"Mgmt__PoolQueryTargetInfo",
"mgmt",
sizeof(Mgmt__PoolQueryTargetInfo),
3,
4,
mgmt__pool_query_target_info__field_descriptors,
mgmt__pool_query_target_info__field_indices_by_name,
1, mgmt__pool_query_target_info__number_ranges,
Expand Down
12 changes: 10 additions & 2 deletions src/mgmt/pool.pb-c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/proto/mgmt/pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ message PoolQueryResp {
uint32 svc_ldr = 18; // current raft leader (2.6+)
repeated uint32 svc_reps = 19; // service replica ranks
uint64 query_mask = 20; // Bitmask of pool query options used
// TODO DAOS-14223: Add mem_file_bytes.
uint64 mem_file_bytes = 21; // per-pool accumulated value of memory file sizes
}

message PoolProperty {
Expand Down Expand Up @@ -330,6 +330,7 @@ message PoolQueryTargetInfo {
TargetState state = 2; // target state see enum daos_target_state_t
// TODO: target performance data
repeated StorageTargetUsage space = 3; // this target's usage per storage tier
uint64 mem_file_bytes = 4; // per-target value of memory file size
}

// PoolQueryTargetResp represents a pool target query response
Expand Down

0 comments on commit 91a5b89

Please sign in to comment.