fix(heal): preserve incomplete and unknown cluster status - #377
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related Issues
Refs rustfs/backlog#2508.
Summary of Changes
When a peer is offline, the background-heal endpoint can return
degradedwith coverage 3/4. The CLI previously decoded that state as Unknown, discarded coverage, and printedIdleplusNo active heal operation.Preservedegradedand optional completeness/coverage fields through the SDK and output schema, keep explicit unknown states out of the legacy fallback, and show incomplete or unknown status consistently in the headline and body. Active partial snapshots retain their activity label and show a coverage warning.Keep legacy servers and token-scoped running, finished, stopped and notFound responses compatible, including terminal failure details. Missing counts remain unknown, future reason codes pass through JSON, and terminal output escapes control characters. Status-query exit codes remain unchanged.
Verification
cargo test -p rustfs-cli --test admin_heal_status -- --test-threads=1: 9 groups passed, including JSON schema checks, partial/unknown/future states, runtime availability, missing counts, token errors and terminal-safe reason rendering.cargo test --workspace: 2,684 passed, 0 failed, 2 existing ignored tests.cargo test -p rustfs-cli --features golden --test golden: 5 passed.cargo clippy --workspace --all-targets -- -D warnings: passed.cargo fmt --all --check,git diff --cached --check, and JSON schema syntax: passed.Local builds disabled debug symbols and incremental outputs to fit available storage; loopback tests explicitly bypassed proxies.
Impact
The existing v2 status schema gains optional completeness/coverage fields and the recognized
degradedstate. Legacy and token responses retain absent fields. No server, repair, persistence, credential or exit-code behavior changes. Rollback is a revert of this CLI change.Four-node peer-stop/recovery validation has not been rerun with the patched CLI. Keep the backlog issue open until raw, JSON and text agree on incomplete status and all aliases recover to complete coverage 4/4.
Review
Two sequential review passes covered the final implementation:
Additional Notes
The optional combined workspace-plus-golden invocation exposes an existing alias snapshot key-order issue: SDK test dependency feature unification enables
serde_json/preserve_order. The same four ordering-only failures reproduce on unmodified main. Default workspace tests and standalone CLI golden tests both pass; snapshot baselines were not changed.