Skip to content

fix: bound tiered etag metadata writes#381

Merged
alecthomas merged 1 commit into
mainfrom
aat/bound-tiered-etag-metadata
Jul 3, 2026
Merged

fix: bound tiered etag metadata writes#381
alecthomas merged 1 commit into
mainfrom
aat/bound-tiered-etag-metadata

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

Only publish tiered cache ETags when a successful write replaces an existing authoritative object with a different ETag, avoiding unbounded metadata growth for immutable cache keys.

Only publish tiered cache ETags when a successful write replaces an existing authoritative object with a different ETag, avoiding unbounded metadata growth for immutable cache keys.
@alecthomas alecthomas requested a review from a team as a code owner July 3, 2026 11:30
@alecthomas alecthomas requested review from jrobotham-square and removed request for a team July 3, 2026 11:30
@alecthomas alecthomas enabled auto-merge (squash) July 3, 2026 11:30
@alecthomas alecthomas merged commit d0785bd into main Jul 3, 2026
7 checks passed
@alecthomas alecthomas deleted the aat/bound-tiered-etag-metadata branch July 3, 2026 11:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddbf81106c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/cache/tiered.go
Comment on lines +121 to +122
case errors.Is(err, os.ErrNotExist):
return false, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish replacements even after authoritative eviction

When the authoritative tier returns os.ErrNotExist here, the write is treated as a new key and tieredWriter.Close() never records the new ETag. Cache implementations are allowed to evict objects independently, so with a shorter remote/authoritative TTL (or eviction) and longer local tiers, other replicas can still hold the old ETag; because invalidateStale() only checks metadata, those local hits will keep serving stale content after this replacement. Previously every successful create published the ETag, so this regresses mutable keys whenever the authoritative copy disappeared before the replacement write.

Useful? React with 👍 / 👎.

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