Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7cfe688

Browse files
committed
Fix test instability
On FreeBSD, the new test fails due to a WAL file being removed before the standby has had the chance to copy it. Fix by adding a replication slot to prevent the removal until after the standby has connected. Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reported-by: Matthias van de Meent <boekewurm+postgres@gmail.com> Discussion: https://postgr.es/m/CAEze2Wj5nau_qpjbwihvmXLfkAWOZ5TKdbnqOc6nKSiRJEoPyQ@mail.gmail.com
1 parent 9a7e26b commit 7cfe688

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/recovery/t/033_replay_tsp_drops.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ sub test_tablespace
2424
CREATE TABLESPACE source_ts LOCATION '';
2525
CREATE TABLESPACE target_ts LOCATION '';
2626
CREATE DATABASE template_db IS_TEMPLATE = true;
27+
SELECT pg_create_physical_replication_slot('slot', true);
2728
]);
2829
my $backup_name = 'my_backup';
2930
$node_primary->backup($backup_name);
@@ -38,10 +39,11 @@ sub test_tablespace
3839
# Make sure connection is made
3940
$node_primary->poll_query_until('postgres',
4041
'SELECT count(*) = 1 FROM pg_stat_replication');
42+
$node_primary->safe_psql('postgres', "SELECT pg_drop_replication_slot('slot')");
4143

4244
$node_standby->safe_psql('postgres', 'CHECKPOINT');
4345

44-
# Do immediate shutdown just after a sequence of CREAT DATABASE / DROP
46+
# Do immediate shutdown just after a sequence of CREATE DATABASE / DROP
4547
# DATABASE / DROP TABLESPACE. This causes CREATE DATABASE WAL records
4648
# to be applied to already-removed directories.
4749
my $query = q[

0 commit comments

Comments
 (0)