Skip to content

feat(cp): copy objects across aliases via download and upload - #353

Merged
cxymds merged 5 commits into
mainfrom
cursor/feat-cross-alias-s3-copy-fce3
Aug 25, 2026
Merged

feat(cp): copy objects across aliases via download and upload#353
cxymds merged 5 commits into
mainfrom
cursor/feat-cross-alias-s3-copy-fce3

Conversation

@loverustfs

@loverustfs loverustfs commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Background

rc cp already performs same-alias S3-to-S3 copies with server-side CopyObject, including recursive prefix copies. Copies between different aliases failed with unsupported_feature, even though rc mirror already downloads and re-uploads across aliases. Operators had to stage through a local path or switch to mirror.

Solution

  • Same alias: keep CopyObject / multipart copy.
  • Different aliases: HEAD the source, download to a temporary file, upload with the destination alias credentials, then delete the staging file.
  • Source content type and user metadata are copied unless --metadata-directive replace is set.
  • Storage-class rejection for cross-alias copies uses the upload multipart threshold, because the write is an upload rather than CopyObject.
  • Client cache now includes both source and destination aliases.

This is additive. Same-alias CopyObject behavior is unchanged.

This PR must be marked BREAKING because docs/reference/rc/cp.md is a protected CLI behavior contract. The change is additive; no JSON schema or config schema_version bump applies.

Tests

  • Unit: planner client aliases for cross-alias and same-alias copies, storage-class threshold, content-type and user-metadata copy vs replace
  • Integration: recursive dry-run across aliases without CopyObject; live recursive copy uses LIST + GET + PUT; single-object overwrite uses GET then PUT and never sends x-amz-copy-source; upload forwards x-amz-meta-* from the source HEAD
  • Regression: scripts/regression/cross-alias-copy.sh

Validation

cargo fmt --all
cargo clippy --workspace -- -D warnings
cargo test --workspace
./scripts/regression/cross-alias-copy.sh
Open in Web Open in Cursor 

cursoragent and others added 3 commits August 24, 2026 16:14
Same-alias copies keep using server-side CopyObject. When the source and
destination aliases differ, rc cp now streams through a temporary file
and uploads with the destination credentials so recursive and single
object copies no longer fail with unsupported_feature.

Co-authored-by: RustFS <hello@rustfs.com>
Add recursive download/upload coverage, same-alias client-cache
behavior, and user-metadata forwarding. Mark the protected cp
contract with a BREAKING migration note for the additive change.

Co-authored-by: RustFS <hello@rustfs.com>
The previous synchronize event ran before the PR body included
BREAKING. This empty commit re-runs CI against the updated description.

Co-authored-by: RustFS <hello@rustfs.com>
Comment thread crates/cli/src/commands/cp.rs
Comment thread crates/cli/src/commands/cp.rs
@cxymds
cxymds merged commit 9d0e151 into main Aug 25, 2026
17 checks passed
@cxymds
cxymds deleted the cursor/feat-cross-alias-s3-copy-fce3 branch August 25, 2026 06:07
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.

3 participants