Skip to content

fix(rm): delete versions with explicit version IDs#293

Draft
overtrue wants to merge 1 commit into
mainfrom
overtrue/safer-removal-5104
Draft

fix(rm): delete versions with explicit version IDs#293
overtrue wants to merge 1 commit into
mainfrom
overtrue/safer-removal-5104

Conversation

@overtrue

Copy link
Copy Markdown
Contributor

Related issues

Refs rustfs/rustfs#5104.
Refs rustfs/backlog#1405.
Blocked full bucket cleanup dependency: rustfs/backlog#1384.

Background

The initial removal-flag implementation made rm --versions and rb --force rely on the RustFS-specific x-rustfs-force-delete header. That collapses all versions of a key into one opaque server operation, loses per-version results, and cannot provide the staged discovery and failure guarantees required by backlog #1405.

Changes

  • Preserve each object key and version ID as a distinct delete target.
  • Send standard S3 DeleteObjects requests with explicit VersionId values for versions and delete markers.
  • Recognize DeleteMarkerVersionId in delete results so delete-marker cleanup is tracked correctly.
  • Fail closed on duplicate version targets or non-advancing pagination before mutation.
  • Stop a versioned delete when a batch is incomplete instead of silently treating the key as deleted.
  • Keep the RustFS force-delete header limited to the existing explicit --purge option.
  • Hide and reject rb --force and rb --dangerous before alias or network resolution until safe bucket-wide multipart discovery is available.

Scope

This PR does not claim to complete rb --force. The full staged workflow remains tracked by rustfs/backlog#1405 and is blocked by rustfs/backlog#1384. The existing explicit rm --purge behavior remains unchanged.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

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.

1 participant