#2143: retry drop_chunks once on deadlock before the DELETE fallback - #2145
Merged
Conversation
The nightly's purge e2e caught the field case: drop_chunks lost a deadlock to a background job whose chunk locks clear in milliseconds, then the DELETE fallback deadlocked against the same partner — one transient loss burned the whole purge cycle. 40P01 now earns exactly one immediate retry, seamed through an internal delegate so all four arms pin without a store: one deadlock retries and succeeds, two in a row give up to the fallback (standing contention), non-deadlock failures never retry, clean runs stay single-shot. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(Split from the parent commit: the byte-level insert refused its non-unique anchor and the commit chain did not gate on it — the anchor discipline worked, the shell plumbing did not.) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Reviewed. This is a tightly scoped fix and looks correct:
No findings to flag. |
This was referenced Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Option 3 from the issue (product-side retry), which the purge e2e then inherits for free.
The field case (nightly run 31334656715):
drop_chunkson collection_log lost a40P01deadlock to a background job whose chunk locks clear within milliseconds of the abort — then the row-by-row DELETE fallback deadlocked against the same partner, so one transient loss burned the entire purge cycle and failed the e2e's survival assertion.The fix:
40P01earns exactly one immediate retry. A second deadlock in a row is standing contention, where the existing fallback-plus-next-cycle posture is right and a retry loop camped on a lock queue is not. Non-deadlock failures keep the original single-shot behavior; cancellation still propagates.Pins (the retry logic is seamed through an internal delegate, so all arms test without a store): one deadlock → retries once and succeeds; two deadlocks → exactly two attempts then null (fallback); non-deadlock → one attempt, no retry; clean run → single-shot.
Closes #2143 on merge (I'll close explicitly — dev-target PRs don't auto-close).