Skip to content

fix(preprod): run size comparisons outside one enclosing transaction - #130338

Draft
ldelvoye wants to merge 14 commits into
ldelvoye/ref/preprod-size-tasks-splitfrom
ldelvoye/fix/preprod-compare-transaction
Draft

ldelvoye wants to merge 14 commits into
ldelvoye/ref/preprod-size-tasks-splitfrom
ldelvoye/fix/preprod-compare-transaction

Conversation

@ldelvoye

@ldelvoye ldelvoye commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

resolves INFRENG-977

Runs the preprod size comparison task without holding a database transaction across the file downloads, the diff and the result uploads.

The task used to wrap the whole run in one transaction, open for up to its 120 s deadline, with a savepoint per write inside it. It now computes and uploads every result first and records the rows in one short transaction at the end, so a run is still all-or-nothing: a failure or a deadline leaves no rows, as before. Worth weighing in review: two runs that overlap on the same pair now both compute the diff where the second used to block on the first's transaction, and the one that loses deletes its own result file. The manual and monitor paths claim their row with a conditional update for the same reason.

The task held a worker transaction open for the whole run, up to its
120 s deadline, pinning xmin on the default primary. Each PENDING row,
state change and file upload now commits on its own, and a comparison
whose diff or upload raises is marked FAILED so it can be retried.
@linear-code

linear-code Bot commented Nov 6, 2026

Copy link
Copy Markdown

INFRENG-977

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 6, 2026
Recording each comparison as it finished left PENDING, PROCESSING and
FAILED rows behind when a run failed, and neither the sweeper nor a
member's compare request recovers those. The run now computes every
result first and records them in one short transaction, so a failed run
leaves no rows, as it did before.
A deadline landing while the recording transaction commits left SUCCESS
rows pointing at deleted files. Cleanup now checks for a referencing row
first. The single-comparison path claims its row with a conditional
update, so it cannot overwrite a result an overlapping run recorded.
The old task dispatched the status check and PR comment inside its
transaction, so a deadline landing on the COMMIT itself never lost them.
Dispatching after the recording transaction reopened that window.
The single-comparison helper marked its row PROCESSING and later SUCCESS
without checking the row was still PENDING, so two overlapping runs
could overwrite each other. It also uploaded the result inside the
transaction that records it, and left the file behind when that write
failed.
@ldelvoye
ldelvoye changed the base branch from master to ldelvoye/fix/preprod-manual-compare-claim November 9, 2026 22:13
@ldelvoye
ldelvoye added this pull request to stack #130530 November 9, 2026 22:13
@ldelvoye
ldelvoye removed this pull request from stack #130530 November 9, 2026 22:16
@ldelvoye
ldelvoye changed the base branch from ldelvoye/fix/preprod-manual-compare-claim to master November 9, 2026 22:16
@ldelvoye
ldelvoye changed the base branch from master to ldelvoye/ref/preprod-size-tasks-split November 9, 2026 23:18
@ldelvoye
ldelvoye added this pull request to stack #130548 November 9, 2026 23:18

This branch was successfully deployed

1 active (outdated) deployment
Preview — 78ae19c5 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant