From b3dfd8d4ea1547ccbb6fca64f0334e40762b0f4d Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Tue, 8 Sep 2026 10:46:20 +0530 Subject: [PATCH] Fix buildfarm failure introduced by 6168c65ddc. Commit 6168c65ddc added a test verifying that the conflict detection slot's xmin regresses to the horizon pinned by an in-progress transaction in the database of a newly added subscription that has retain_dead_tuples enabled. However, it used query_until(), which can return before starting a transaction, allowing the test to proceed without a pinned xid. Use query_safe() so the transaction setup completes synchronously and the xid is assigned before the xmin checks run. Per buildfarm. Author: Hayato Kuroda Discussion: https://postgr.es/m/OS9PR01MB12149257A97EE1BD3296F6AEBF5B12@OS9PR01MB12149.jpnprd01.prod.outlook.com Backpatch-through: 19 --- src/test/subscription/t/035_conflicts.pl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/test/subscription/t/035_conflicts.pl b/src/test/subscription/t/035_conflicts.pl index d57cbe05cd7..5804e38ed69 100644 --- a/src/test/subscription/t/035_conflicts.pl +++ b/src/test/subscription/t/035_conflicts.pl @@ -667,9 +667,7 @@ $node_B->safe_psql('dbb', "CREATE TABLE tab (a int PRIMARY KEY, b int)"); # Hold a transaction with an assigned transaction ID open in dbb, pinning its # oldest active transaction ID. my $dbb_session = $node_B->background_psql('dbb'); -$dbb_session->query_until( - qr/starting_bg_psql/, q{ - \echo starting_bg_psql +$dbb_session->query_safe(q{ BEGIN; SELECT txid_current(); }); @@ -704,11 +702,7 @@ ok( $node_B->poll_query_until( # Once the pinned transaction commits, the xmin must be able to advance # again. -$dbb_session->query_until( - qr/committed/, q{ - COMMIT; - \echo committed -}); +$dbb_session->query_safe("COMMIT;"); ok($dbb_session->quit, 'close pinned session'); $next_xid = $node_B->safe_psql('postgres', "SELECT txid_current() + 1");