Skip to content

fix(cache): serve S3 data object when companion metadata is stale#390

Draft
worstell wants to merge 1 commit into
mainfrom
worstell/s3-stale-companion-fallback
Draft

fix(cache): serve S3 data object when companion metadata is stale#390
worstell wants to merge 1 commit into
mainfrom
worstell/s3-stale-companion-fallback

Conversation

@worstell

Copy link
Copy Markdown
Contributor

The S3 backend commits an object as two sequential writes: the data object, then a companion .meta object carrying mutable metadata (ETag, refreshed expiry). Between the two writes — or when concurrent writers to the same key interleave — the companion's tag doesn't match the data object, and reads reported a miss even though a valid, fully-committed data object exists. For large objects the mismatch window spans a competing writer's entire upload, so hot keys can repeatedly appear missing.

The data object is self-describing: its immutable headers (including ETag) travel in its own user metadata. On tag mismatch, serve it with those headers and its own expiry instead of returning a miss. The expiry-refresh path then rewrites the companion with the object's tag, reconciling the pair.

The S3 backend commits an object as two sequential writes: the data
object, then a companion .meta object carrying mutable metadata. Between
the two writes (or when concurrent writers to the same key interleave),
the companion's tag doesn't match the data object, and reads reported a
miss even though a valid, fully-committed data object exists. For large
objects the commit window spans the entire upload of a competing writer,
so hot keys could repeatedly appear missing.

The data object is self-describing: its immutable headers (including
ETag) travel in its own user metadata. On tag mismatch, serve it with
those headers and its own expiry instead of returning a miss. The
expiry-refresh path then rewrites the companion with the object's tag,
reconciling the pair.
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