Skip to content

Stabilize cancel/terminate isolation tests with sync steps - #10456

Open
gayyappan wants to merge 1 commit into
timescale:mainfrom
gayyappan:cagg_iso
Open

Stabilize cancel/terminate isolation tests with sync steps#10456
gayyappan wants to merge 1 commit into
timescale:mainfrom
gayyappan:cagg_iso

Conversation

@gayyappan

@gayyappan gayyappan commented Aug 13, 2026

Copy link
Copy Markdown
Member

cagg_cancel_kill_refresh flaked on PG19beta2: the terminated backend's "step tr3_refresh: <... completed>" was reported after wp2_release instead of before it. Same lines, different position.

isolationtester's (blocked_step) marker only delays the reporting of a step's completion, never the launch of the next step. A step launches as soon as the preceding one is done or deemed blocked, and a marker-delayed step counts as deemed blocked. So the waitpoint-release step was launched and reported while the signalled backend was still unwinding, and which of the two got reported first came down to timing.

Fix it the way src/test/isolation/README prescribes: add an empty step in the signalling session right after the signal step. Rule (A) -- all prior steps of a session must be done before the next one launches -- then transitively holds the release step until the cancelled or terminated refresh has been fully reported. This also closes a visibility race in the cancel permutations, where s1_registered_ranges could read the catalog before R1's PG_CATCH cleanup committed.
(https://github.com/postgres/postgres/blob/ac5cea86e8a474e13d7dcd22a4a7fabf722c5514/src/test/isolation/README#L207)

Applied to the two sibling specs carrying the same latent race.

cagg_cancel_kill_refresh flaked on PG19beta2: the terminated backend's
"step tr3_refresh: <... completed>" was reported after wp2_release
instead of before it. Same lines, different position.

isolationtester's (blocked_step) marker only delays the *reporting* of a
step's completion, never the *launch* of the next step. A step launches
as soon as the preceding one is done or deemed blocked, and a
marker-delayed step counts as deemed blocked. So the waitpoint-release
step was launched and reported while the signalled backend was still
unwinding, and which of the two got reported first came down to timing.

Fix it the way src/test/isolation/README prescribes: add an empty step
in the signalling session right after the signal step. Rule (A) -- all
prior steps of a session must be done before the next one launches --
then transitively holds the release step until the cancelled or
terminated refresh has been fully reported. This also closes a
visibility race in the cancel permutations, where s1_registered_ranges
could read the catalog before R1's PG_CATCH cleanup committed.

Applied to the two sibling specs carrying the same latent race.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@gayyappan
gayyappan marked this pull request as ready for review August 13, 2026 21:39
@github-actions
github-actions Bot requested review from akuzm and kpan2034 August 13, 2026 21:39
@github-actions

Copy link
Copy Markdown

@kpan2034, @akuzm: please review this pull request.

Powered by pull-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant