mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
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 <kuroda.hayato@fujitsu.com>
Discussion: https://postgr.es/m/OS9PR01MB12149257A97EE1BD3296F6AEBF5B12@OS9PR01MB12149.jpnprd01.prod.outlook.com
Backpatch-through: 19
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user