Skip to content

Commit 798d644

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 <[email protected]> Reported-by: Matthias van de Meent <[email protected]> Discussion: https://postgr.es/m/CAEze2Wj5nau_qpjbwihvmXLfkAWOZ5TKdbnqOc6nKSiRJEoPyQ@mail.gmail.com
1 parent 4ab5dae commit 798d644

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ sub test_tablespace
2626
CREATE TABLESPACE source_ts LOCATION '';
2727
CREATE TABLESPACE target_ts LOCATION '';
2828
CREATE DATABASE template_db IS_TEMPLATE = true;
29+
SELECT pg_create_physical_replication_slot('slot', true);
2930
]);
3031
my $backup_name = 'my_backup';
3132
$node_primary->backup($backup_name);
@@ -40,10 +41,11 @@ sub test_tablespace
4041
# Make sure connection is made
4142
$node_primary->poll_query_until('postgres',
4243
'SELECT count(*) = 1 FROM pg_stat_replication');
44+
$node_primary->safe_psql('postgres', "SELECT pg_drop_replication_slot('slot')");
4345

4446
$node_standby->safe_psql('postgres', 'CHECKPOINT');
4547

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

0 commit comments

Comments
 (0)