Skip to content

fix: use companion metadata object for S3 instead of self-copy#331

Merged
alecthomas merged 1 commit into
mainfrom
s3-companion-metadata
Jun 18, 2026
Merged

fix: use companion metadata object for S3 instead of self-copy#331
alecthomas merged 1 commit into
mainfrom
s3-companion-metadata

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

Replace server-side CopyObject (copy-to-self) for updating headers and
refreshing expiry with a small companion .meta object. S3's CopyObject
has a 5GB limit, which caused failures for large objects:

The specified copy source is larger than the maximum allowable size
for a copy source: 5368709120

The companion stores mutable metadata (ETag, expiry) as a few-hundred-byte
JSON object. Immutable headers remain in the data object's user metadata
for backwards compatibility — existing objects without companions continue
to work via legacy fallback.

On read, both are read and the companion is overlaid on top of the base
metadata. Expiry refresh becomes a tiny PutObject instead of copying
potentially multi-GB data server-side.

Replace server-side CopyObject (copy-to-self) for updating headers and
refreshing expiry with a small companion .meta object. S3's CopyObject
has a 5GB limit, which caused failures for large objects:

  The specified copy source is larger than the maximum allowable size
  for a copy source: 5368709120

The companion stores mutable metadata (ETag, expiry) as a few-hundred-byte
JSON object. Immutable headers remain in the data object's user metadata
for backwards compatibility — existing objects without companions continue
to work via legacy fallback.

On read, both are read and the companion is overlaid on top of the base
metadata. Expiry refresh becomes a tiny PutObject instead of copying
potentially multi-GB data server-side.
@alecthomas alecthomas requested a review from a team as a code owner June 18, 2026 12:16
@alecthomas alecthomas requested review from jrobotham-square and removed request for a team June 18, 2026 12:16
@alecthomas alecthomas changed the title s3: use companion metadata object instead of self-copy fix: use companion metadata object for S3 instead of self-copy Jun 18, 2026
@alecthomas alecthomas merged commit 63b7130 into main Jun 18, 2026
8 of 9 checks passed
@alecthomas alecthomas deleted the s3-companion-metadata branch June 18, 2026 12:41
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