Repository navigation
test(platform): keep a held delegated start off the audit chain head - #4027
Merged
Merged
Conversation
The busy-retry lane holds a delegated start open at the agent row while it probes that the retry queues behind it, so the start's SERIALIZABLE snapshot stays open for hundreds of milliseconds in the one organization every lane of the run shares. Assigning its task wrote an audit row, and the audit chain head that row takes is bumped by every audited write of the org: a lane running beside this one failed the start's first attempt (40001 on the chain head's ensure-insert), which rolled back and freed the agent row, so the READ COMMITTED retry queued on it started and the start's second attempt answered agent_busy — one live run, but not the order the round holds (CI on #4025, 1234/1235; passed on re-run). The task a held start works is now assigned up front, so the start writes no audit row and never reaches for the chain head. What a concurrent lane can still fail (a dependency on an index page it wrote) is rare and never the retry's doing, since the retry commits nothing while it queues: a round whose held start lost its first attempt is void and re-run on fresh tasks, bounded, and says so in the log. The lock-order rounds get the same guard. Reproduced locally by bumping the chain head from a side session: every round voided before the change, and the round passes at its first try after it.
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.
The busy-retry lane holds a delegated start open at the agent row while it probes that the retry queues behind it, so the start's SERIALIZABLE snapshot stays open for hundreds of milliseconds in the one organization every lane of the run shares. Assigning its task wrote an audit row, and the audit chain head that row takes is bumped by every audited write of the org: a lane running beside this one failed the start's first attempt (40001 on the chain head's ensure-insert), which rolled back and freed the agent row, so the READ COMMITTED retry queued on it started and the start's second attempt answered
agent_busy— one live run, but not the order the round holds. Seen on #4025's Checks run (Backend integration 1234/1235); the job passed on re-run.begintrace never sees.Proof: the throwaway Postgres log attributes 122 of the serialization failures to
INSERT INTO app.audit_chain_heads … ON CONFLICT DO NOTHING. Bumping the chain head from a side session every 300 ms voided every held round before the change and none after it. Lane alone: 38/38. Fullbackend:integrationlocally: 1231/1231 across 207 lanes.Test-only; one file.