Skip to content

feat(transfer): apply retention and legal hold atomically#308

Merged
cxymds merged 3 commits into
mainfrom
cxymds/issue-1460-object-lock
Jul 23, 2026
Merged

feat(transfer): apply retention and legal hold atomically#308
cxymds merged 3 commits into
mainfrom
cxymds/issue-1460-object-lock

Conversation

@cxymds

@cxymds cxymds commented Jul 23, 2026

Copy link
Copy Markdown
Member

Closes rustfs/backlog#1460

Background

The transfer option model already carried Object Lock retention and legal-hold state, but the S3 adapter rejected those fields. Applying them after object creation would leave a temporary unlocked version and violate WORM guarantees.

Root cause

Advanced writes had no typed mapping from the core Object Lock model to PutObject, CopyObject, or CreateMultipartUpload, and generic error classification could not distinguish lock configuration, IAM, and policy failures.

Solution

  • validate retention expiry before any mutation
  • apply retention mode/date and legal hold atomically to PutObject and CopyObject
  • apply lock headers exactly once on CreateMultipartUpload, never UploadPart or CompleteMultipartUpload
  • classify disabled Object Lock, IAM denial, governance/compliance policy conflicts, and source lookup failures deterministically
  • add request-capture coverage plus a RustFS beta.10 smoke test for Put, Copy, multipart persistence, and cleanup
  • preserve the #1461 boundary: no cp/pipe flags, output changes, schema changes, or protected documentation changes

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • cargo test -p rustfs-cli --test integration --features integration --no-run
  • workflow YAML and shell syntax validation

All local checks pass.

@cxymds
cxymds merged commit dc92a4b into main Jul 23, 2026
17 checks passed
@cxymds
cxymds deleted the cxymds/issue-1460-object-lock branch July 23, 2026 09:53
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