Skip to content

fix(admin): align heal commands with RustFS API#142

Merged
overtrue merged 1 commit intomainfrom
codex/fix-2538-admin-heal-api
Apr 19, 2026
Merged

fix(admin): align heal commands with RustFS API#142
overtrue merged 1 commit intomainfrom
codex/fix-2538-admin-heal-api

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Related Issue

Resolves rustfs/rustfs#2538

Background

rc admin heal start was calling /rustfs/admin/v3/heal/start with the CLI request shape. RustFS expects the admin heal route to be /rustfs/admin/v3/heal/ or /rustfs/admin/v3/heal/{bucket} with the server HealOpts JSON body. The mismatch caused RustFS to return an XML InvalidRequest response, which rc surfaced as Invalid path.

Solution

  • Translate heal start requests to the RustFS admin heal route and required HealOpts JSON shape.
  • Send heal stop through the same route with forceStop=true and a valid body.
  • Route heal status to the RustFS background-heal status endpoint.
  • Avoid printing an empty status block when the server returns success without status details.
  • Report admin 400 Bad Request responses as bad requests instead of path parsing failures.

Tests

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace
  • Manual verification against a local RustFS server: rc admin heal start local, rc admin heal start local --json, and rc admin heal status local --json

@overtrue overtrue merged commit 371425d into main Apr 19, 2026
15 checks passed
@overtrue overtrue deleted the codex/fix-2538-admin-heal-api branch April 19, 2026 16:12
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f5a3a3e2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/s3/src/admin.rs
impl From<&HealStartRequest> for RustfsHealOptions {
fn from(request: &HealStartRequest) -> Self {
Self {
recursive: false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Enable recursive mode for root heal starts

When rc admin heal start <alias> is invoked without --bucket/--prefix, rustfs_heal_path() targets /heal/, but this conversion always sends recursive: false. On RustFS/MinIO-style heal APIs, non-recursive root heal requests are treated as status/no-op flows rather than a full namespace heal, so the command can report success without actually starting a heal run. Set recursive based on request scope (at least for the root /heal/ case) to preserve the documented “all buckets” behavior.

Useful? React with 👍 / 👎.

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.

Heal command fail

1 participant