At Fri, 29 Jul 2022 11:27:01 +1200, Thomas Munro <thomas.mu...@gmail.com> wrote 
in 
> Maybe it just needs a replication slot?  I see:
> 
> ERROR:  requested WAL segment 000000010000000000000003 has already been 
> removed

Agreed, I see the same.  The same failure can be surely reproducible
by inserting wal-switch+checkpoint after taking backup [1].  And it is
fixed by the attached.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center


[1]:
--- a/src/test/recovery/t/033_replay_tsp_drops.pl
+++ b/src/test/recovery/t/033_replay_tsp_drops.pl
@@ -30,6 +30,13 @@ sub test_tablespace
        my $backup_name = 'my_backup';
        $node_primary->backup($backup_name);
 
+       $node_primary->psql(
+               'postgres',
+               qq[
+               CREATE TABLE t(); DROP TABLE t; SELECT pg_switch_wal();
+               CHECKPOINT;
+               ]);
+
        my $node_standby = PostgreSQL::Test::Cluster->new("standby2_$strategy");
        $node_standby->init_from_backup($node_primary, $backup_name,
                has_streaming => 1);
diff --git a/src/test/recovery/t/033_replay_tsp_drops.pl b/src/test/recovery/t/033_replay_tsp_drops.pl
index 9b74cb09ac..0756ca6c87 100644
--- a/src/test/recovery/t/033_replay_tsp_drops.pl
+++ b/src/test/recovery/t/033_replay_tsp_drops.pl
@@ -20,6 +20,7 @@ sub test_tablespace
 	$node_primary->psql(
 		'postgres',
 		qq[
+			SELECT pg_create_physical_replication_slot('slot1', true);
 			SET allow_in_place_tablespaces=on;
 			CREATE TABLESPACE dropme_ts1 LOCATION '';
 			CREATE TABLESPACE dropme_ts2 LOCATION '';

Reply via email to