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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: daniel@yesql.se, guopa@vmware.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, ibrar.ahmad@gmail.com, alvherre@2ndquadrant.com, masao.fujii@oss.nttdata.com, a.lubennikova@postgrespro.ru, pasim@vmware.com, thomas.munro@gmail.com, horiguchi.kyotaro@lab.ntt.co.jp, pgsql-hackers@postgresql.org
Date: 2021-11-09T03:51:15Z
Lists: pgsql-hackers
On Mon, Nov 08, 2021 at 05:55:16PM +0900, Kyotaro Horiguchi wrote:

I have quickly looked at the patch set.

> 0001: (I don't remember about this, though) I don't see how to make it
> work on Windows.  Anyway the next step would be to write comments.

Look at Utils.pm where we have dir_symlink, then.  symlink() does not
work on WIN32, so we have a wrapper that uses junction points.  FWIW,
I don't like much the behavior you are enforcing in init_from_backup
when coldly copying a source path, but I have not looked enough at the
patch set to have a strong opinion about this part, either.

> 0002: I didn't see it in details and didn't check if it finds the
> issue but it actually scceeds with the fix.  The change to
> poll_query_until is removed since it doesn't seem actually used.

+# Create tablespace
+my $dropme_ts_master1 = PostgreSQL::Test::Utils::tempdir();
+$dropme_ts_master1 =
PostgreSQL::Test::Utils::perl2host($dropme_ts_master1);
+my $dropme_ts_master2 = PostgreSQL::Test::Utils::tempdir();
+$dropme_ts_master2 =
PostgreSQL::Test::Utils::perl2host($dropme_ts_master2);
+my $source_ts_master = PostgreSQL::Test::Utils::tempdir();
+$source_ts_master =
PostgreSQL::Test::Utils::perl2host($source_ts_master);
+my $target_ts_master = PostgreSQL::Test::Utils::tempdir();
+$target_ts_master =
PostgreSQL::Test::Utils::perl2host($target_ts_master);

Rather than creating N temporary directories, it would be simpler to
create only one, and have subdirs in it for the rest?  It seems to me
that it would make debugging much easier.  The uses of perl2host()
seem sufficient.
--
Michael

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.