From 47ad2233fad4335fdd866c8ad55941706ae1661d Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Wed, 27 May 2026 15:52:30 -0700 Subject: [PATCH] Fix 051_effective_wal_level.pl on builds without injection points. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 2af1dc89282 placed the new "logical decoding disabled after REPACK (CONCURRENTLY)" check at the end of 051_effective_wal_level.pl. That placement assumed the logical slot "test_slot" no longer existed when the check ran, but the assumption only holds on builds with injection points: the earlier injection-point-driven tests drop "test_slot" as a side effect, while on builds without injection points the slot persists. When "test_slot" still exists, logical decoding remains enabled and the new check fails on those buildfarm members. Move the REPACK test earlier in the script, ensuring that the test starts with logical decoding disabled. Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAD21AoBmdmBQ-+Jga+jSKKq5OPGEP1pEjSJfRPT6MCwVHLD6og@mail.gmail.com --- .../recovery/t/051_effective_wal_level.pl | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/test/recovery/t/051_effective_wal_level.pl b/src/test/recovery/t/051_effective_wal_level.pl index 9341e11d58a..c862073c34e 100644 --- a/src/test/recovery/t/051_effective_wal_level.pl +++ b/src/test/recovery/t/051_effective_wal_level.pl @@ -65,6 +65,20 @@ ok( $primary->log_contains( # Wait for the checkpointer to disable logical decoding. wait_for_logical_decoding_disabled($primary); +# Test that logical decoding is disabled after repack +$primary->safe_psql('postgres', qq[create table foo(a int primary key)]); +$primary->safe_psql('postgres', qq[repack (concurrently) foo;]); +ok( $primary->log_contains( + "logical decoding is enabled upon creating a new logical replication slot" + ), + "logical decoding enabled by repack"); + +# Wait for the checkpointer to disable logical decoding. +wait_for_logical_decoding_disabled($primary); +test_wal_level($primary, "replica|replica", + "logical decoding disabled after repack" +); + # Create a new logical slot and check that effective_wal_level must be increased # to 'logical'. $primary->safe_psql('postgres', @@ -400,20 +414,6 @@ select pg_cancel_backend(pid) from pg_stat_activity where query ~ 'slot_canceled "the activation process aborted"); } -# Test that logical decoding is disabled after repack -$primary->safe_psql('postgres', qq[create table foo(a int primary key)]); -$primary->safe_psql('postgres', qq[repack (concurrently) foo;]); -ok( $primary->log_contains( - "logical decoding is enabled upon creating a new logical replication slot" - ), - "logical decoding enabled by repack"); - -# Wait for the checkpointer to disable logical decoding. -wait_for_logical_decoding_disabled($primary); -test_wal_level($primary, "replica|replica", - "logical decoding disabled after repack" -); - $primary->stop; done_testing();