]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove TAP test for timeline lookup race with logical decoding on standbys
authorMichael Paquier <michael@paquier.xyz>
Thu, 11 Jun 2026 10:00:55 +0000 (19:00 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 11 Jun 2026 10:00:55 +0000 (19:00 +0900)
16b89ff04839 has introduced this test, but I have missed that the script
should check for the existence of the test module injection_points.
This requirement has been added by 105b2cb33617 in v18 and newer
branches.

Let's just remove the test on v17.  There is still coverage in v18 and
HEAD, that should be good enough.

Per reports from the buildfarm.

Discussion: https://postgr.es/m/aiqFjzGHpnYFP-Gm@paquier.xyz
Backpatch-through: 17 (only)

src/backend/access/transam/xlog.c
src/test/recovery/t/035_standby_logical_decoding.pl

index f0e1e381f1fc34ee4893aa1c00b9931bf9adff55..745276908d2faf0f38cef8272069ae9e8e61a612 100644 (file)
@@ -6120,8 +6120,6 @@ StartupXLOG(void)
        if (ArchiveRecoveryRequested)
                CleanupAfterArchiveRecovery(EndOfLogTLI, EndOfLog, newTLI);
 
-       INJECTION_POINT("promotion-after-wal-segment-cleanup");
-
        /*
         * Local WAL inserts enabled, so it's time to finish initialization of
         * commit timestamp.
index 7f63c72bd20eefdb28b86e8e30134dd2969c920c..9c5b1ba64a811345c74c1706f4fa7682a47c4e2e 100644 (file)
@@ -1014,73 +1014,4 @@ is($cascading_stdout, $expected,
        'got same expected output from pg_recvlogical decoding session on cascading standby'
 );
 
-##################################################
-# Test that logical decoding on standby correctly handles a timeline
-# change during promotion.  This relies on an injection point that
-# waits between the moment the segments of the old timeline are removed
-# and the moment RecoveryInProgress() would set, catching that a WAL
-# sender is still able to decode changes across a promotion.
-##################################################
-
-# Create a logical slot on the cascading standby for this test.
-$node_cascading_standby->create_logical_slot_on_standby($node_standby,
-       'race_slot', 'testdb');
-
-$node_standby->safe_psql('testdb',
-       qq[INSERT INTO decoding_test(x,y) SELECT s, s::text FROM generate_series(10,13) s;]
-);
-$node_standby->wait_for_replay_catchup($node_cascading_standby);
-
-$expected = q{BEGIN
-table public.decoding_test: INSERT: x[integer]:10 y[text]:'10'
-table public.decoding_test: INSERT: x[integer]:11 y[text]:'11'
-table public.decoding_test: INSERT: x[integer]:12 y[text]:'12'
-table public.decoding_test: INSERT: x[integer]:13 y[text]:'13'
-COMMIT};
-
-$node_standby->safe_psql('testdb', 'CREATE EXTENSION injection_points;');
-$node_standby->wait_for_replay_catchup($node_cascading_standby);
-
-# Attach injection point to pause startup after WAL segment cleanup
-# but before RecoveryInProgress() flips to false.
-$node_cascading_standby->safe_psql('testdb',
-       "SELECT injection_points_attach('promotion-after-wal-segment-cleanup', 'wait');"
-);
-
-# Promote, wait for the removal of the segments on the old timeline.
-$node_cascading_standby->safe_psql('testdb', "SELECT pg_promote(false)");
-$node_cascading_standby->wait_for_event('startup',
-       'promotion-after-wal-segment-cleanup');
-
-# Start pg_recvlogical.
-my ($stdout2, $stderr2);
-my $handle2 = IPC::Run::start(
-       [
-               'pg_recvlogical',
-               '--dbname' => $node_cascading_standby->connstr('testdb'),
-               '--slot' => 'race_slot',
-               '--option' => 'include-xids=0',
-               '--option' => 'skip-empty-xacts=1',
-               '--file' => '-',
-               '--no-loop',
-               '--start',
-       ],
-       '>' => \$stdout2,
-       '2>' => \$stderr2,
-       IPC::Run::timeout($default_timeout));
-
-# Verify that pg_recvlogical successfully decodes the data while startup
-# is still paused in the injection point.
-$pump_timeout = IPC::Run::timer($default_timeout);
-ok( pump_until($handle2, $pump_timeout, \$stdout2, qr/COMMIT/s),
-       'pg_recvlogical works during promotion timeline switch');
-chomp($stdout2);
-is($stdout2, $expected,
-       'got expected output from pg_recvlogical during promotion timeline switch'
-);
-
-# Resume promotion.
-$node_cascading_standby->safe_psql('testdb',
-       "SELECT injection_points_wakeup('promotion-after-wal-segment-cleanup');");
-
 done_testing();