Repository navigation
Conversation
Tiered backfills and ranged heals created lower-tier copies with TTL 0, the destination's maximum. An entry written with an explicit TTL, such as a git bundle or an apiv1 Time-To-Live upload, outlived that TTL on any replica whose local tier was filled from the shared tier. Tiered now records when an explicit TTL ends in an internal header on Create and UpdateMetadata, and copies into another tier get the time left. A copy is skipped once that time has passed. Entries written without a TTL, and entries written before this change, keep the old behaviour. Tiered removes the header from the headers it returns. Signed-off-by: Ravi Agarwal <ravi@perplexity.ai> Co-authored-by: Perplexity <noreply@perplexity.ai>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Signed-off-by: Ravi Agarwal <ravi@perplexity.ai> Co-authored-by: Perplexity <noreply@perplexity.ai>
|
@codex review Created with Perplexity |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cd033d637
ℹ️ 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".
Signed-off-by: Ravi Agarwal <ravi@perplexity.ai> Co-authored-by: Perplexity <noreply@perplexity.ai>
|
@codex review Created with Perplexity |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
When a tiered cache serves an entry from a higher tier, it backfills the lowest tier, and a ranged
If-Matchread can heal tier 0 from a deeper tier. Both create the new copy with TTL0, which means the destination's maximum TTL. Some entries are written with an explicit TTL: git bundles (bundle-cache-ttl, 2h by default), apiv1 uploads withTime-To-Live, and handler fills that set a TTL function.On a replica whose cold disk tier is filled from a shared S3 tier, the copy outlives that TTL, so the replica keeps serving the entry after the writer's tier has expired it. This is the tier-side counterpart of #439, which stopped S3 reads from extending explicit TTLs.
Change
Tiered.Createstores the end of an explicit TTL in an internalX-Cachew-Expires-Atheader, which is written to every tier with the entry.Tiered.UpdateMetadatastamps it again, or clears it when the new TTL is0.expired. The caller still gets the response it was reading.Tieredowns the header: a caller-supplied value is replaced, andStat,OpenandAuthoritativeStatremove it from the headers they return.Memorynow caps an explicit TTL at itsmax-ttlinCreateandUpdateMetadata, asDiskandS3already do. Without that, a backfill into a memory tier carrying the writer's remaining TTL could outlive the memory tier's maximum, which TTL0used to enforce.expiredfill result.Behaviour changes
0, and entries written before this change, behave as before, because they carry no header.max-ttlnow expires atmax-ttl.Tiered, so apart from theMemorycap they are unaffected.Remotecachewd, the expiry survives only if that server uses a single cache, which stores and returns the header. A tiered server removes the header from the responses it serves, so the client's backfill from it still gets the maximum TTL.Testing
tiered_expiry_test.gorecord the TTL each tier'sCreatereceives, so they need no sleeps. All five fail onmain.TestTieredBackfillKeepsWriterTTL: a backfill keeps the writer's TTL.TestTieredBackfillWithoutTTLUsesMaxTTL: an entry without a TTL, including one with a caller-supplied header, still gets the maximum.TestTieredBackfillKeepsUpdatedTTL: a TTL thatUpdateMetadatarefreshes and then clears.TestTieredHealKeepsWriterTTL: a ranged heal.TestTieredSkipsBackfillPastWriterTTL: a backfill is skipped once the TTL has passed.TestMemoryCapsTTLAtMaxTTLchecks thatCreateandUpdateMetadatacap a TTL abovemax-ttl. It fails without theMemorychange.cachewdreplicas sharing a MinIO bucket, each with its own disk tier. An entry is PUT on replica A with an 8s TTL and read once on replica B, which backfills B's disk. 10s later onmain, A returns 404 but B still returns 200 with the expired body. With this change, both return 404.Created with Perplexity