Skip to content

feat(bucket)!: implement staged forced cleanup - #327

Merged
cxymds merged 1 commit into
mainfrom
cxymds/feat-forced-bucket-cleanup
Jul 24, 2026
Merged

feat(bucket)!: implement staged forced cleanup#327
cxymds merged 1 commit into
mainfrom
cxymds/feat-forced-bucket-cleanup

Conversation

@cxymds

@cxymds cxymds commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • implement rc rb --force as an explicit staged cleanup of current objects, versions, null versions, delete markers, and incomplete multipart uploads
  • validate --dangerous --yes before alias or network resolution and refuse multipart cleanup before any mutation unless both guards are present
  • pre-discover all work, delete deterministic batches of at most 1000, abort the frozen multipart set with bounded concurrency, then re-list all four resource classes before ordinary DeleteBucket
  • preserve itemized success/failure and stage state in human and output-v3 results, with authentication distinct and retention/Object Lock failures mapped to conflict
  • never send the RustFS force-delete header or governance bypass from this workflow

BREAKING contract update

The protected rb command and output references now define the staged forced-cleanup result and require --dangerous --yes before aborting multipart uploads. The implementation intentionally replaces the prior vendor force-delete behavior for this command.

Validation

  • make pre-commit
  • 14 focused staged-cleanup tests
  • DeleteBucket authentication mapping and force-header absence tests
  • CLI help/Clap contract tests
  • two mutation reversals proving the force-header and multipart-refusal tests fail when their production guards are removed
  • git diff --check

Adversarial review

  • Correctness: PASS — pagination stalls/cycles, 1001-item batching, partial failures, four-way residue checks, and non-transactional races are covered.
  • Security: PASS — no vendor force header or retention bypass; guards run before network access; terminal-controlled text is escaped.
  • Concurrency: PASS — multipart abort uses the shared bounded helper with an asserted maximum of eight active operations.
  • Compatibility: PASS — ordinary S3 deletion, version/null-version/delete-marker semantics, and stable exit classes are preserved.
  • Performance: PASS — discovery and result retention are intentionally O(n), with bounded mutation batches and abort concurrency.
  • Test coverage: PASS — focused, integration, workspace, and mutation-reversal checks exercise the production path.
  • Simplicity: PASS — no existing common workflow satisfies the required frozen-plan and staged-result contract.

Closes rustfs/backlog#1405
Refs rustfs/backlog#1364
Refs rustfs/backlog#1361

@cxymds
cxymds force-pushed the cxymds/feat-forced-bucket-cleanup branch from 5f2e1ad to eaff4fa Compare July 24, 2026 14:20
@cxymds
cxymds merged commit defcde3 into main Jul 24, 2026
17 checks passed
@cxymds
cxymds deleted the cxymds/feat-forced-bucket-cleanup branch July 24, 2026 14:32
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