Re: standby recovery fails (tablespace related) (tentative patch and discussion)

Kyotaro Horiguchi <horikyota.ntt@gmail.com>

From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: thomas.munro@gmail.com
Cc: tgl@sss.pgh.pa.us, boekewurm+postgres@gmail.com, alvherre@alvh.no-ip.org, pgsql-hackers@postgresql.org
Date: 2022-07-29T05:20:08Z
Lists: pgsql-hackers

Attachments

At Fri, 29 Jul 2022 11:27:01 +1200, Thomas Munro <thomas.munro@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);

Commits

  1. Improve recently-added test reliability

  2. Fix new recovery test for log_error_verbosity=verbose case

  3. Fix test instability

  4. Fix replay of create database records on standby

  5. Allow "in place" tablespaces.

  6. Fix get_dirent_type() for Windows junction points.

  7. Revert "Fix replay of create database records on standby"

  8. Add end-to-end testing of pg_basebackup's tar-format output.

  9. Make DROP DATABASE command generate less WAL records.

  10. Consolidate methods for translating a Perl path to a Windows path.