Skip to content

Commit 59be1c9

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 0234ed8 commit 59be1c9

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
@@ -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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy