Skip to content

feat(scanner): add cycle reset and show recovery status - #423

Merged
cxymds merged 1 commit into
mainfrom
cxymds/scanner-cycle-reset
Nov 18, 2026
Merged

cxymds merged 1 commit into
mainfrom
cxymds/scanner-cycle-reset

Conversation

@cxymds

@cxymds cxymds commented Nov 18, 2026

Copy link
Copy Markdown
Member

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

  • Add rc admin scanner reset cycle <ALIAS> --yes. It sends a signed POST to /rustfs/admin/v3/scanner/cycle-state/reset with {"mode":"full-rescan"} and requires admin:ConfigUpdate.
  • Report success only when the server acknowledges status=reset and mode=full-rescan. The acknowledgement covers the cycle reset. Operators can follow subsequent scan progress with rc admin scanner status <ALIAS>.
  • Display the responding node's recovery state and reason when available. Preserve the full recovery object in JSON and support older servers that omit it.
  • Add the scanner_cycle_reset success record to output schema v3 and document the recovery workflow.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace passed with 2,035 tests passed and 2 ignored.
  • cargo test -p rustfs-cli --features golden --test golden passed all 5 tests.
  • ./scripts/check-protected-files.sh origin/main passed. 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.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@cxymds
cxymds merged commit 05e11aa into main Nov 18, 2026
14 checks passed
@cxymds
cxymds deleted the cxymds/scanner-cycle-reset branch November 18, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants