Repository navigation
feat(scanner): add cycle reset and show recovery status - #423
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the scanner cycle recovery changes.
No open issues 🎉
What changed in this PR
Adds scanner cycle recovery to rc’s admin commands, letting operators reset invalid cycle state and inspect recovery details without manually signing API requests.
Changes:
- Adds
rc admin scanner reset cycle <ALIAS> --yes, with a signed full-rescan request and strict acknowledgement validation. - Displays recovery state and reason in text output while preserving the complete recovery object in JSON.
- Extends output schema v3, documents the recovery workflow, and adds integration and help-contract tests.
| File | Description |
|---|---|
schemas/output_v3.json |
Defines the scanner_cycle_reset success record. |
docs/reference/rc/admin.md |
Documents reset usage, permissions, and recovery monitoring. |
crates/s3/src/admin.rs |
Implements the signed reset request and validates its acknowledgement. |
crates/core/src/admin/observability.rs |
Adds the scanner recovery trait and reset result type. |
crates/core/src/admin/mod.rs |
Exports the new recovery API types. |
crates/cli/tests/help_contract.rs |
Checks reset subcommand help and required confirmation. |
crates/cli/tests/admin_scanner.rs |
Tests recovery output, reset requests, acknowledgements, and error handling. |
crates/cli/src/commands/admin/scanner.rs |
Adds reset command handling and recovery status display. |
crates/cli/src/commands/admin/mod.rs |
Updates scanner help and unsupported-operation guidance. |
Review effort: Balanced
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.
Background
When invalid cycle state blocks the RustFS scanner, operators can reset it through the Admin API. Until now, rc exposed only the status endpoint and omitted the recovery state and reason from its text output. Operators had to inspect JSON for the cause and send the signed reset request themselves.
Changes
rc admin scanner reset cycle <ALIAS> --yes. It sends a signed POST to/rustfs/admin/v3/scanner/cycle-state/resetwith{"mode":"full-rescan"}and requiresadmin:ConfigUpdate.status=resetandmode=full-rescan. The acknowledgement covers the cycle reset. Operators can follow subsequent scan progress withrc admin scanner status <ALIAS>.scanner_cycle_resetsuccess record to output schema v3 and document the recovery workflow.Validation
cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspacepassed with 2,035 tests passed and 2 ignored.cargo test -p rustfs-cli --features golden --test goldenpassed all 5 tests../scripts/check-protected-files.sh origin/mainpassed. The command reference diff consists entirely of additions under the repository's BREAKING change policy.Scanner integration tests use a local HTTP server to verify the signed request, acknowledgement, output, and error exit codes. Validation did not run a reset against a live RustFS cluster.
Related issue: no linked GitHub issue.