Skip to content

Commit 2f86dcb

Browse files
committed
DAOS-17938 pool: Add degraded to query output
Add the following to pool query output (shown as dmg pool query output): - Data redundancy: degraded When data redundancy is intact, "normal" is shown instead of "degraded". Features: control pool Signed-off-by: Li Wei <[email protected]>
1 parent faf28dc commit 2f86dcb

File tree

14 files changed

+311
-217
lines changed

14 files changed

+311
-217
lines changed

src/client/pydaos/raw/daos_cref.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
(C) Copyright 2018-2023 Intel Corporation.
3-
(C) Copyright 2025 Hewlett Packard Enterprise Development LP
3+
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
44
55
SPDX-License-Identifier: BSD-2-Clause-Patent
66
"""
@@ -53,7 +53,8 @@ class RebuildStatus(ctypes.Structure):
5353
("rs_errno", ctypes.c_uint32),
5454
("rs_state", ctypes.c_uint32),
5555
("rs_max_supported_layout_ver", ctypes.c_uint16),
56-
("rs_padding16", ctypes.c_uint16),
56+
("rs_flags", ctypes.c_uint8),
57+
("rs_reserved_", ctypes.c_uint8),
5758
("rs_fail_rank", ctypes.c_uint32),
5859
("rs_toberb_obj_nr", ctypes.c_uint64),
5960
("rs_obj_nr", ctypes.c_uint64),

src/control/cmd/daos/pretty/pool.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// (C) Copyright 2020-2024 Intel Corporation.
3-
// (C) Copyright 2025 Hewlett Packard Enterprise Development LP
3+
// (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
44
// (C) Copyright 2025 Google LLC
55
//
66
// SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -138,6 +138,11 @@ func PrintPoolInfo(pi *daos.PoolInfo, out io.Writer) error {
138138
} else {
139139
fmt.Fprintf(w, "- Rebuild failed, status=%d\n", pi.Rebuild.Status)
140140
}
141+
if pi.Rebuild.Degraded {
142+
fmt.Fprintln(w, "- Data redundancy: degraded")
143+
} else {
144+
fmt.Fprintln(w, "- Data redundancy: normal")
145+
}
141146
} else {
142147
fmt.Fprintln(w, "- No rebuild status available.")
143148
}

src/control/cmd/daos/pretty/pool_test.go

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// (C) Copyright 2020-2024 Intel Corporation.
3-
// (C) Copyright 2025 Hewlett Packard Enterprise Development LP
3+
// (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
44
//
55
// SPDX-License-Identifier: BSD-2-Clause-Patent
66
//
@@ -50,9 +50,10 @@ Pool health info:
5050
PoolLayoutVer: 1,
5151
UpgradeLayoutVer: 2,
5252
Rebuild: &daos.PoolRebuildStatus{
53-
State: daos.PoolRebuildStateBusy,
54-
Objects: 42,
55-
Records: 21,
53+
State: daos.PoolRebuildStateBusy,
54+
Objects: 42,
55+
Records: 21,
56+
Degraded: true,
5657
},
5758
TierStats: []*daos.StorageUsageStats{
5859
{
@@ -72,6 +73,7 @@ Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=TargetsExcluded
7273
Pool layout out of date (1 < 2) -- see `+backtickStr+` for details.
7374
Pool health info:
7475
- Rebuild busy, 42 objs, 21 recs
76+
- Data redundancy: degraded
7577
Pool space info:
7678
- Target count:1
7779
- Storage tier 0 (SCM):
@@ -96,9 +98,10 @@ Pool space info:
9698
UpgradeLayoutVer: 2,
9799
EnabledRanks: ranklist.MustCreateRankSet("[0,1,2]"),
98100
Rebuild: &daos.PoolRebuildStatus{
99-
State: daos.PoolRebuildStateBusy,
100-
Objects: 42,
101-
Records: 21,
101+
State: daos.PoolRebuildStateBusy,
102+
Objects: 42,
103+
Records: 21,
104+
Degraded: true,
102105
},
103106
TierStats: []*daos.StorageUsageStats{
104107
{
@@ -119,6 +122,7 @@ Pool layout out of date (1 < 2) -- see `+backtickStr+` for details.
119122
Pool health info:
120123
- Enabled ranks: 0-2
121124
- Rebuild busy, 42 objs, 21 recs
125+
- Data redundancy: degraded
122126
Pool space info:
123127
- Target count:1
124128
- Storage tier 0 (SCM):
@@ -144,9 +148,10 @@ Pool space info:
144148
DisabledRanks: ranklist.MustCreateRankSet("[0,1,3]"),
145149
DeadRanks: ranklist.MustCreateRankSet("[2]"),
146150
Rebuild: &daos.PoolRebuildStatus{
147-
State: daos.PoolRebuildStateBusy,
148-
Objects: 42,
149-
Records: 21,
151+
State: daos.PoolRebuildStateBusy,
152+
Objects: 42,
153+
Records: 21,
154+
Degraded: true,
150155
},
151156
TierStats: []*daos.StorageUsageStats{
152157
{
@@ -166,6 +171,7 @@ Pool health info:
166171
- Disabled ranks: 0-1,3
167172
- Dead ranks: 2
168173
- Rebuild busy, 42 objs, 21 recs
174+
- Data redundancy: degraded
169175
`, poolUUID.String()),
170176
},
171177
"normal response; disabled ranks": {
@@ -182,9 +188,10 @@ Pool health info:
182188
UpgradeLayoutVer: 2,
183189
DisabledRanks: ranklist.MustCreateRankSet("[0,1,3]"),
184190
Rebuild: &daos.PoolRebuildStatus{
185-
State: daos.PoolRebuildStateBusy,
186-
Objects: 42,
187-
Records: 21,
191+
State: daos.PoolRebuildStateBusy,
192+
Objects: 42,
193+
Records: 21,
194+
Degraded: true,
188195
},
189196
TierStats: []*daos.StorageUsageStats{
190197
{
@@ -205,6 +212,7 @@ Pool layout out of date (1 < 2) -- see `+backtickStr+` for details.
205212
Pool health info:
206213
- Disabled ranks: 0-1,3
207214
- Rebuild busy, 42 objs, 21 recs
215+
- Data redundancy: degraded
208216
Pool space info:
209217
- Target count:1
210218
- Storage tier 0 (SCM):
@@ -229,9 +237,10 @@ Pool space info:
229237
UpgradeLayoutVer: 2,
230238
DisabledRanks: ranklist.MustCreateRankSet("[0,1,3]"),
231239
Rebuild: &daos.PoolRebuildStatus{
232-
State: 42,
233-
Objects: 42,
234-
Records: 21,
240+
State: 42,
241+
Objects: 42,
242+
Records: 21,
243+
Degraded: false,
235244
},
236245
TierStats: []*daos.StorageUsageStats{
237246
{
@@ -252,6 +261,7 @@ Pool layout out of date (1 < 2) -- see `+backtickStr+` for details.
252261
Pool health info:
253262
- Disabled ranks: 0-1,3
254263
- Rebuild unknown, 42 objs, 21 recs
264+
- Data redundancy: normal
255265
Pool space info:
256266
- Target count:1
257267
- Storage tier 0 (SCM):
@@ -275,10 +285,11 @@ Pool space info:
275285
PoolLayoutVer: 1,
276286
UpgradeLayoutVer: 2,
277287
Rebuild: &daos.PoolRebuildStatus{
278-
Status: 2,
279-
State: daos.PoolRebuildStateBusy,
280-
Objects: 42,
281-
Records: 21,
288+
Status: 2,
289+
State: daos.PoolRebuildStateBusy,
290+
Objects: 42,
291+
Records: 21,
292+
Degraded: true,
282293
},
283294
TierStats: []*daos.StorageUsageStats{
284295
{
@@ -299,6 +310,7 @@ Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=TargetsExcluded
299310
Pool layout out of date (1 < 2) -- see `+backtickStr+` for details.
300311
Pool health info:
301312
- Rebuild failed, status=2
313+
- Data redundancy: degraded
302314
Pool space info:
303315
- Target count:1
304316
- Storage tier 0 (SCM):
@@ -322,9 +334,10 @@ Pool space info:
322334
PoolLayoutVer: 1,
323335
UpgradeLayoutVer: 2,
324336
Rebuild: &daos.PoolRebuildStatus{
325-
State: daos.PoolRebuildStateBusy,
326-
Objects: 42,
327-
Records: 21,
337+
State: daos.PoolRebuildStateBusy,
338+
Objects: 42,
339+
Records: 21,
340+
Degraded: true,
328341
},
329342
TierStats: []*daos.StorageUsageStats{
330343
{
@@ -346,6 +359,7 @@ Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=TargetsExcluded
346359
Pool layout out of date (1 < 2) -- see `+backtickStr+` for details.
347360
Pool health info:
348361
- Rebuild busy, 42 objs, 21 recs
362+
- Data redundancy: degraded
349363
Pool space info:
350364
- Target count:1
351365
- Total memory-file size: 1.1 GB

0 commit comments

Comments
 (0)