DAOS-19358 control: Fix dmg system erase for MD-on-SSD - #18718
Conversation
Features: control Signed-off-by: Tom Nabarro <tom.nabarro@hpe.com>
|
Ticket title is 'Fix dmg system erase for MD-on-SSD ' |
|
Test stage Build on EL 9 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/1/execution/node/521/log |
|
Test stage Build on Leap 15 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/1/execution/node/569/log |
Features: control Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
Features: control Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
|
Test stage Build on EL 9 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/2/execution/node/521/log |
|
Test stage Build on Leap 15 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/2/execution/node/569/log |
|
Test stage Unit Test completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-18718/3/testReport/ |
|
Test stage Unit Test completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-18718/4/testReport/ |
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/4/execution/node/1675/log |
Features: control Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
Features: control Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/6/execution/node/1463/log |
kjacque
left a comment
There was a problem hiding this comment.
This is definitely a complicated problem... I find myself wondering about corner cases. What about:
- There is only one MS replica.
- A subset of the MS replicas are unresponsive, but there is quorum amongst those remaining (minus the original leader) to elect a new leader.
- A subset of the MS replicas are unresponsive, and there is NOT quorum to elect a new leader once the current leader is subtracted from the set.
In general it would be nice to refactor the updated function to be more testable at the unit level. Erase is a pretty scary operation, especially since the system can wind up in a state requiring "manual recovery," which isn't really defined. If there's no way to close that window, we really need to document it.
| maxWait := 30 * time.Second | ||
| pollInterval := 500 * time.Millisecond |
There was a problem hiding this comment.
Would be better to find a way to inject these wait times - would make it easier to test.
| maxWait := 30 * time.Second | ||
| pollInterval := 500 * time.Millisecond |
There was a problem hiding this comment.
Same comment about the timing as above.
| // 3. On the leader, raft DB is stopped early in the operation, creating a window | ||
| // where leadership changes cannot be safely handled | ||
| // 4. If the leader crashes after stopping raft but before completing, manual | ||
| // recovery will be required (replicas/engines may be in inconsistent states) |
There was a problem hiding this comment.
How does a user recover in this situation?
| // Give the kernel time to complete pending I/O operations | ||
| time.Sleep(100 * time.Millisecond) |
There was a problem hiding this comment.
Does this wait time come from some specific documentation? Would be nice if there was a more deterministic way to tell it was done.
| if err := svc.eraseAndRestart(false); err != nil { | ||
| return nil, errors.Wrap(err, "erasing and restarting non-leader") | ||
| } | ||
| // Never reaches here - process is exec'd |
There was a problem hiding this comment.
I'd be inclined to panic or error here, so the issue can be discovered quickly if this ever changes.
| // superblock). They will remain in AwaitFormat until the leader calls | ||
| // ResetFormatRanks (which is idempotent for already-started engines) followed | ||
| // by StorageFormat to complete the format process. | ||
| if !isLeader { |
There was a problem hiding this comment.
Any reason not to break this block and the leader section out into their own helper functions?
| // Critical: DB is stopped but files not removed. Try to log and continue. | ||
| svc.log.Errorf("CRITICAL: failed to remove leader DB files, continuing: %s", err) | ||
| } | ||
| svc.log.Debug("SystemErase: LEADER - Raft database files removed") |
There was a problem hiding this comment.
Should maybe be in an else block, to avoid misleading messaging.
| unix.Sync() | ||
| time.Sleep(100 * time.Millisecond) |
There was a problem hiding this comment.
If the 100ms time is always needed after the sync, it'd be good to put it in a helper function.
| // Now tell MS replica peers to erase their databases and restart. | ||
| // When they restart and try to rejoin, they'll find the leader's DB is also clean. | ||
| for _, peer := range peers { |
There was a problem hiding this comment.
Hmm, so when the replicas come back up, they just form their own MS cluster, right? Which the old leader doesn't join yet, because it's still managing this erase process.
|
Test stage Functional Hardware Large MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/7/execution/node/1572/log |
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18718/7/execution/node/1625/log |
To completely wipe and reformat a DAOS system, dmg system erase can be used.
Features: control
Steps for the author:
After all prior steps are complete: