Skip to content

fix(cache-warming): Expire the completed gap backfill after 30 days - #3110

Merged
BYK merged 2 commits into
mainfrom
fix/cache-warming-backfill-done-ttl
Nov 10, 2026
Merged

BYK merged 2 commits into
mainfrom
fix/cache-warming-backfill-done-ttl

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #2944, from the review question there.

A completed backfill set junior:cache_warming:backfill:work_state to done with no TTL. If warming stays off for more than 30 days, the gap lists expire but the key stays, so the backfill never fills them again.

The backfill now uses junior:cache_warming:backfill:work_state:v2, and its done gets the gap list TTL (GLOBAL_GAPS_TTL_MS). The old key is ignored: a heartbeat returns when the claim fails, so an old done with no TTL would never be replaced. Existing installs run the backfill once more after deploy, and that run fills only segments that are empty. A fresh install and a long-lived install both check for empty segment lists again about once a month. Between checks, a heartbeat still makes only one state call. A rerun fills only lists that are empty when it starts, so lists with live gaps do not change.

The existing backfill test now sets the old key to done with no TTL, and checks that the backfill still runs and that its new key is there just before the TTL and gone at the TTL. Without the fix, the test fails. The docs bullet in config-and-env.md now says the fill repeats after 30 days.

tsc --noEmit and the full pnpm lint pass. The backfill, heartbeat, and heartbeat-timers tests pass.

via @BYK.

--

View Session [Sentry]

A completed run kept its key with no TTL, so gap lists that expired while
warming was off never got history again. Give the key the gap list TTL, so
a heartbeat checks for empty segment lists again about once a month.

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 10, 2026 10:55pm UTC

Request Review

@BYK BYK closed this Nov 10, 2026
@BYK BYK reopened this Nov 10, 2026
@BYK
BYK marked this pull request as ready for review November 10, 2026 22:26
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 10, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 87b3cfe. Configure here.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

210 screenshot changes — 0 changed · 210 added · 0 removed

Review screenshots in Frameshift

… expire

A done value written before this change has no TTL, and a heartbeat returns
when the claim fails, so it is never overwritten. Use a v2 key. Existing
installs run the backfill once more, and it fills only empty segments.

Co-Authored-By: BYK <[email protected]>
@BYK
BYK enabled auto-merge (squash) November 10, 2026 22:58
@BYK
BYK merged commit 7f1b057 into main Nov 10, 2026
44 checks passed
@BYK
BYK deleted the fix/cache-warming-backfill-done-ttl branch November 10, 2026 23:03

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 55859dcc Deployed Nov 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant