Repository navigation
Copy S3 objects server-side - #49
Merged
Merged
Conversation
The old copy downloaded the object and uploaded it back, moving every byte through the client and recompressing it on the way.
Escaping them whole is accepted by AWS and MinIO but not by every S3-compatible backend. A backend with no copy operation at all now falls back to copying through the client.
Contributor
Author
|
Two follow-ups pushed: The copy source now keeps its slashes literal and escapes each key segment on its own ( A backend that answers Verified again against MinIO, plus transport-level tests covering the escaping, both fallbacks and the non-fallback error path. |
billettc
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
S3Store.CopyObjectused to download the object and upload it back, moving every byte through the client and, on a compressed store, decompressing and recompressing it on the way. It now asks the service to do the copy: a singleCopyObjectcall for objects up to 5 GiB, the largest S3 accepts in one call, and a multipart copy of 1 GiB parts above that, aborted if any part fails.GSStore.CopyObjectalready worked this way.Verified against a local MinIO (
docker compose up -d minio): write, copy, read back on both paths, plus a missing source, with the threshold and part size lowered to reach the multipart path. There are also transport-level tests, running with no backend, over the copy source, the byte ranges and the storage class.go build ./...,go vet ./...andgo test ./...all pass.