From 4f311e78e316423de9114aff14d859ba7c6aa76e Mon Sep 17 00:00:00 2001 From: alterego655 <824662526@qq.com> Date: Tue, 26 May 2026 09:40:04 +0800 Subject: [PATCH v2 2/2] Clean up replslot limit test comments Update stale comments and test names in 019_replslot_limit.pl to match the actual WAL advancement and wal_status checks. Also remove a redundant standby stop in the inactive_since coverage. --- src/test/recovery/t/019_replslot_limit.pl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/recovery/t/019_replslot_limit.pl b/src/test/recovery/t/019_replslot_limit.pl index 472aa07587f..0984f999e13 100644 --- a/src/test/recovery/t/019_replslot_limit.pl +++ b/src/test/recovery/t/019_replslot_limit.pl @@ -60,7 +60,7 @@ $result = $node_primary->safe_psql('postgres', ); is($result, "reserved|t", 'check the catching-up state'); -# Advance WAL by five segments (= 5MB) on primary +# Advance WAL by one segment (= 1MB) on primary $node_primary->advance_wal(1); $node_primary->safe_psql('postgres', "CHECKPOINT;"); @@ -110,7 +110,7 @@ $node_primary->safe_psql('postgres', "CHECKPOINT;"); $result = $node_primary->safe_psql('postgres', "SELECT wal_status FROM pg_replication_slots WHERE slot_name = 'rep1'"); is($result, "reserved", - 'check that safe_wal_size gets close to the current LSN'); + 'check that slot remains reserved after advancing WAL'); # The standby can reconnect to primary $node_standby->start; @@ -121,7 +121,7 @@ $node_standby->stop; # wal_keep_size overrides max_slot_wal_keep_size $result = $node_primary->safe_psql('postgres', "ALTER SYSTEM SET wal_keep_size to '8MB'; SELECT pg_reload_conf();"); -# Advance WAL again then checkpoint, reducing remain by 6 MB. +# Advance WAL again, reducing remain by 6 MB. $node_primary->advance_wal(6); $result = $node_primary->safe_psql('postgres', "SELECT wal_status as remain FROM pg_replication_slots WHERE slot_name = 'rep1'" @@ -141,7 +141,7 @@ $node_standby->stop; # Advance WAL again without checkpoint, reducing remain by 6 MB. $node_primary->advance_wal(6); -# Slot gets into 'reserved' state +# Slot gets into 'extended' state $result = $node_primary->safe_psql('postgres', "SELECT wal_status FROM pg_replication_slots WHERE slot_name = 'rep1'"); is($result, "extended", 'check that the slot state changes to "extended"'); @@ -480,8 +480,6 @@ is( $primary4->safe_psql( 't', 'last inactive time for an inactive physical slot is updated correctly'); -$standby4->stop; - # Testcase end: Check inactive_since property of the streaming standby's slot # ============================================================================= -- 2.51.0