diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-07-29 12:50:47 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-07-29 12:50:47 +0200 |
commit | 59be1c942a47f6c8a4c47d242200fbbf4be59b88 (patch) | |
tree | 05ad4f1febb342e1aabe22ee25b1e4efd55e0c7a /src | |
parent | 0234ed81e958b2b6b21f231547e851c09c8f1744 (diff) | |
download | postgresql-59be1c942a47f6c8a4c47d242200fbbf4be59b88.tar.gz postgresql-59be1c942a47f6c8a4c47d242200fbbf4be59b88.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/test/recovery/t/033_replay_tsp_drops.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/recovery/t/033_replay_tsp_drops.pl b/src/test/recovery/t/033_replay_tsp_drops.pl index 9b74cb09ac3..7cd55742fc0 100644 --- a/src/test/recovery/t/033_replay_tsp_drops.pl +++ b/src/test/recovery/t/033_replay_tsp_drops.pl @@ -26,6 +26,7 @@ sub test_tablespace CREATE TABLESPACE source_ts LOCATION ''; CREATE TABLESPACE target_ts LOCATION ''; CREATE DATABASE template_db IS_TEMPLATE = true; + SELECT pg_create_physical_replication_slot('slot', true); ]); my $backup_name = 'my_backup'; $node_primary->backup($backup_name); @@ -40,10 +41,11 @@ sub test_tablespace # Make sure connection is made $node_primary->poll_query_until('postgres', 'SELECT count(*) = 1 FROM pg_stat_replication'); + $node_primary->safe_psql('postgres', "SELECT pg_drop_replication_slot('slot')"); $node_standby->safe_psql('postgres', 'CHECKPOINT'); - # Do immediate shutdown just after a sequence of CREAT DATABASE / DROP + # Do immediate shutdown just after a sequence of CREATE DATABASE / DROP # DATABASE / DROP TABLESPACE. This causes CREATE DATABASE WAL records # to be applied to already-removed directories. my $query = q[ |