diff --git a/src/test/recovery/t/019_replslot_limit.pl b/src/test/recovery/t/019_replslot_limit.pl index 1eec98f2c9e..e78b548b213 100644 --- a/src/test/recovery/t/019_replslot_limit.pl +++ b/src/test/recovery/t/019_replslot_limit.pl @@ -314,8 +314,6 @@ my $node_primary3 = get_new_node('primary3'); $node_primary3->init(allows_streaming => 1, extra => ['--wal-segsize=1']); $node_primary3->append_conf( 'postgresql.conf', qq( - min_wal_size = 2MB - max_wal_size = 2MB log_checkpoints = yes max_slot_wal_keep_size = 1MB )); @@ -345,6 +343,16 @@ $logstart = get_log_size($node_primary3); kill 'STOP', $senderpid, $receiverpid; advance_wal($node_primary3, 2); +# Run CHECKPOINT in the background. It is expected to reach slot +# invalidation, signal the stopped walsender, and then wait until the +# walsender releases the slot. +my $checkpoint = $node_primary3->background_psql('postgres'); +$checkpoint->query_until( + qr/starting_checkpoint/, q( + \echo starting_checkpoint + CHECKPOINT; +)); + my $max_attempts = $TestLib::timeout_default; while ($max_attempts-- >= 0) { @@ -366,6 +374,7 @@ $node_primary3->poll_query_until('postgres', "SELECT wal_status FROM pg_replication_slots WHERE slot_name = 'rep3'", "lost") or die "timed out waiting for slot to be lost"; +$checkpoint->quit; $max_attempts = $TestLib::timeout_default; while ($max_attempts-- >= 0)