-
Notifications
You must be signed in to change notification settings - Fork 341
DAOS-18347 control: Add rebuild states to pool query #17322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
61cc7aa
DAOS-18347 control: Add rebuild states to pool query
tanabarr 0c5727e
adjust states before drpc response
tanabarr 1e079cd
update state definitions in src/control/lib/daos, increase code
tanabarr 038e0d0
Merge remote-tracking branch 'origin/master' into tanabarr/control-re…
tanabarr 1046349
minor test corrections
tanabarr c006389
add derived_state to pool rebuild status
tanabarr b509a41
Merge remote-tracking branch 'origin/master' into tanabarr/control-re…
tanabarr 71f5621
Merge remote-tracking branch 'origin/master' into tanabarr/control-re…
tanabarr 336aee5
add derived_state in dmg_pool_query_test.py
tanabarr 3644daf
Merge remote-tracking branch 'origin/master' into tanabarr/control-re…
tanabarr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| // | ||
| // (C) Copyright 2020-2024 Intel Corporation. | ||
| // (C) Copyright 2025 Hewlett Packard Enterprise Development LP | ||
| // (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP | ||
| // | ||
| // SPDX-License-Identifier: BSD-2-Clause-Patent | ||
| // | ||
|
|
@@ -262,7 +262,7 @@ Pool space info: | |
| Free: 1 B, min:0 B, max:0 B, mean:0 B | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild failed": { | ||
| "rebuild failing": { | ||
| pi: &daos.PoolInfo{ | ||
| QueryMask: daos.DefaultPoolQueryMask, | ||
| State: daos.PoolServiceStateTargetsExcluded, | ||
|
|
@@ -275,10 +275,11 @@ Pool space info: | |
| PoolLayoutVer: 1, | ||
| UpgradeLayoutVer: 2, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| Status: 2, | ||
| State: daos.PoolRebuildStateBusy, | ||
| Objects: 42, | ||
| Records: 21, | ||
| Status: -2, | ||
| State: daos.PoolRebuildStateBusy, | ||
| DerivedState: daos.PoolRebuildStateFailing, | ||
| Objects: 42, | ||
| Records: 21, | ||
| }, | ||
| TierStats: []*daos.StorageUsageStats{ | ||
| { | ||
|
|
@@ -298,7 +299,7 @@ Pool space info: | |
| Pool %s, ntarget=2, disabled=1, leader=42, version=100, state=TargetsExcluded | ||
| Pool layout out of date (1 < 2) -- see `+backtickStr+` for details. | ||
| Pool health info: | ||
| - Rebuild failed, status=2 | ||
| - Rebuild failing (state=busy, status=-2) | ||
| Pool space info: | ||
| - Target count:1 | ||
| - Storage tier 0 (SCM): | ||
|
|
@@ -355,6 +356,144 @@ Pool space info: | |
| - Data storage: | ||
| Total size: 4 B | ||
| Free: 2 B, min:0 B, max:0 B, mean:0 B | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild state idle": { | ||
| pi: &daos.PoolInfo{ | ||
| UUID: poolUUID, | ||
| TotalTargets: 8, | ||
| ActiveTargets: 8, | ||
| State: daos.PoolServiceStateReady, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| State: daos.PoolRebuildStateIdle, | ||
| DerivedState: daos.PoolRebuildStateIdle, | ||
| Status: 0, | ||
| Objects: 0, | ||
| Records: 0, | ||
| }, | ||
| }, | ||
| expPrintStr: fmt.Sprintf(` | ||
| Pool %s, ntarget=8, disabled=0, leader=0, version=0, state=Ready | ||
| Pool health info: | ||
| - Rebuild idle, 0 objs, 0 recs | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild state stopped": { | ||
| pi: &daos.PoolInfo{ | ||
| UUID: poolUUID, | ||
| TotalTargets: 8, | ||
| ActiveTargets: 8, | ||
| State: daos.PoolServiceStateReady, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| State: daos.PoolRebuildStateDone, | ||
| DerivedState: daos.PoolRebuildStateStopped, | ||
| Status: int32(daos.OpCanceled), | ||
| Objects: 0, | ||
| Records: 0, | ||
| }, | ||
| }, | ||
| expPrintStr: fmt.Sprintf(` | ||
| Pool %s, ntarget=8, disabled=0, leader=0, version=0, state=Ready | ||
| Pool health info: | ||
| - Rebuild stopped (state=done, status=-2027) | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild state done": { | ||
| pi: &daos.PoolInfo{ | ||
| UUID: poolUUID, | ||
| TotalTargets: 8, | ||
| ActiveTargets: 8, | ||
| State: daos.PoolServiceStateReady, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| State: daos.PoolRebuildStateDone, | ||
| DerivedState: daos.PoolRebuildStateDone, | ||
| Status: 0, | ||
| Objects: 200, | ||
| Records: 1000, | ||
| }, | ||
| }, | ||
| expPrintStr: fmt.Sprintf(` | ||
| Pool %s, ntarget=8, disabled=0, leader=0, version=0, state=Ready | ||
| Pool health info: | ||
| - Rebuild done, 200 objs, 1000 recs | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild state failed": { | ||
| pi: &daos.PoolInfo{ | ||
| UUID: poolUUID, | ||
| TotalTargets: 8, | ||
| ActiveTargets: 8, | ||
| State: daos.PoolServiceStateReady, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| State: daos.PoolRebuildStateDone, | ||
| DerivedState: daos.PoolRebuildStateFailed, | ||
| Status: -1, | ||
| }, | ||
| }, | ||
| expPrintStr: fmt.Sprintf(` | ||
| Pool %s, ntarget=8, disabled=0, leader=0, version=0, state=Ready | ||
| Pool health info: | ||
| - Rebuild failed (state=done, status=-1) | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild state busy": { | ||
| pi: &daos.PoolInfo{ | ||
| UUID: poolUUID, | ||
| TotalTargets: 8, | ||
| ActiveTargets: 8, | ||
| State: daos.PoolServiceStateReady, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| State: daos.PoolRebuildStateBusy, | ||
| DerivedState: daos.PoolRebuildStateBusy, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DerivedState may not be needed here either?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above |
||
| Status: 0, | ||
| Objects: 150, | ||
| Records: 750, | ||
| }, | ||
| }, | ||
| expPrintStr: fmt.Sprintf(` | ||
| Pool %s, ntarget=8, disabled=0, leader=0, version=0, state=Ready | ||
| Pool health info: | ||
| - Rebuild busy, 150 objs, 750 recs | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild state stopping": { | ||
| pi: &daos.PoolInfo{ | ||
| UUID: poolUUID, | ||
| TotalTargets: 8, | ||
| ActiveTargets: 8, | ||
| State: daos.PoolServiceStateReady, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| State: daos.PoolRebuildStateBusy, | ||
| DerivedState: daos.PoolRebuildStateStopping, | ||
| Status: int32(daos.OpCanceled), | ||
| Objects: 100, | ||
| Records: 500, | ||
| }, | ||
| }, | ||
| expPrintStr: fmt.Sprintf(` | ||
| Pool %s, ntarget=8, disabled=0, leader=0, version=0, state=Ready | ||
| Pool health info: | ||
| - Rebuild stopping (state=busy, status=-2027) | ||
| `, poolUUID.String()), | ||
| }, | ||
| "rebuild state failing": { | ||
| pi: &daos.PoolInfo{ | ||
| UUID: poolUUID, | ||
| TotalTargets: 8, | ||
| ActiveTargets: 8, | ||
| State: daos.PoolServiceStateReady, | ||
| Rebuild: &daos.PoolRebuildStatus{ | ||
| State: daos.PoolRebuildStateBusy, | ||
| DerivedState: daos.PoolRebuildStateFailing, | ||
| Status: -1, | ||
| Objects: 75, | ||
| Records: 300, | ||
| }, | ||
| }, | ||
| expPrintStr: fmt.Sprintf(` | ||
| Pool %s, ntarget=8, disabled=0, leader=0, version=0, state=Ready | ||
| Pool health info: | ||
| - Rebuild failing (state=busy, status=-1) | ||
| `, poolUUID.String()), | ||
| }, | ||
| } { | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this case need a DerivedState? I suppose if it is not needed, there is no harm to have it here though?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to test for the value because it will be included in the structure returned. The value should always either match State or be one of the additional states.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I definitely trust your conclusion here, since you are much more familiar with the implementation & test infrastructure. I asked since I see only a test of the expected human-readable string output versus expected string. And in
PrintPoolInfo()thepi.Rebuild.DerivedStateis only printed whenpi.Rebuild.Status != 0. Does not seem worth changing even if technically the test case could get away without specifyingDerivedState.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do see your point and we don't need to specify, the main reason I've included it is to represent what would be expected in poolInfo responses from the control API but there is not a practical necessity.