Repository navigation
feat(atlas-worker): add gated per-key cache purge - #12393
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4801d24f20
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| if (req.method === "POST" && url.pathname === "/purge") { | ||
| const existed = this.row() !== undefined; | ||
| this.state.storage.sql.exec("DELETE FROM entry WHERE id = 1"); |
There was a problem hiding this comment.
Serialize purge with in-flight cache fills
If a purge arrives while a same-key cache miss is awaiting embedQuery() or searchService(), this deletion removes the row that the suspended fill still expects. Those outbound-fetch awaits allow other Durable Object requests to execute; when the fill resumes, its UPDATE affects no rows and meta(this.row()!) throws, returning a 500 to the active search. If a post-purge search recreates the row first, the older fill can instead write its pre-purge result into the new entry, defeating invalidation indefinitely. Serialize purge with fills or use a generation identifier to prevent pre-purge operations from updating post-purge state.
Useful? React with 👍 / 👎.
Summary
Per-prefix purge is intentionally omitted: the key is a SHA-256 digest and cannot be prefix-enumerated without a separate index. README also records the deferred #6805 triggers; no TTL or sweeper is added.
Closes #8312
Evidence
npm test— 22 tests passed, including authenticated purge, unauthenticated refusal, and miss/refill after purge.npm run typecheck— passed.git diff --check— passed.Merge Danger
Door: two-way
Blast Radius: narrow — gated cache invalidation for one query/config key.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.