diff options
author | Amit Kapila <akapila@postgresql.org> | 2025-09-11 09:33:48 +0000 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2025-09-11 09:33:48 +0000 |
commit | 01d793698f5921547a7b5e1e003722c17f552574 (patch) | |
tree | e1e07b699357db1c428b1cb013f45538b85f0f20 /src | |
parent | 2bbbb2eca9303df590cc79be74b13cad259124a5 (diff) |
Fix intermittent test failure introduced in 6456c6e2c4.
The test assumes that a backend will execute COMMIT PREPARED on the
publisher and hit the injection point commit-after-delay-checkpoint within
the commit critical section. This should cause the apply worker on the
subscriber to wait for the transaction to complete.
However, the test does not guarantee that the injection point is actually
triggered, creating a race condition where the apply worker may proceed
prematurely during COMMIT PREPARED.
This commit resolves the issue by explicitly waiting for the injection
point to be hit before continuing with the test, ensuring consistent and
reliable behavior.
Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Discussion: https://postgr.es/m/TY4PR01MB1690751D1CA8C128B0770EC6F9409A@TY4PR01MB16907.jpnprd01.prod.outlook.com
Diffstat (limited to 'src')
-rw-r--r-- | src/test/subscription/t/035_conflicts.pl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/subscription/t/035_conflicts.pl b/src/test/subscription/t/035_conflicts.pl index db0d5b464e8..880551fc69d 100644 --- a/src/test/subscription/t/035_conflicts.pl +++ b/src/test/subscription/t/035_conflicts.pl @@ -475,6 +475,9 @@ if ($injection_points_supported != 0) } ); + # Wait until the backend enters the injection point + $node_B->wait_for_event('client backend', 'commit-after-delay-checkpoint'); + # Confirm the update is suspended $result = $node_B->safe_psql('postgres', 'SELECT * FROM tab WHERE a = 1'); |