From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix pg_rewind with in-place tablespaces when source is remote
Date: Sun, 30 Jul 2023 06:26:59 +0000
Message-ID: <E1qPztK-001y7K-HF@gemulon.postgresql.org> (raw)
Fix pg_rewind with in-place tablespaces when source is remote
libpq_source.c would consider any result returned by
pg_tablespace_location() as a symlink, resulting in run-time errors like
that:
pg_rewind: error: file "pg_tblspc/NN" is of different type in source and target
In-place tablespaces are directories located in pg_tblspc/, returned as
relative paths instead of absolute paths, so rely on that to make the
difference with a normal tablespace and an in-place one. If the path is
relative, the tablespace is handled as a directory. If the path is
absolute, consider it as a symlink.
In-place tablespaces are only intended for development purposes, so like
363e8f9 no backpatch is done. A test is added in pg_rewind with an
in-place tablespace and some data in it.
Author: Rui Zhao, Michael Paquier
Discussion: https://postgr.es/m/2b79d2a8-b2d5-4bd7-a15b-31e485100980.xiyuan.zr@alibaba-inc.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/bf227926d22b5cffba4b6724df0eb239a7037cbd
Modified Files
--------------
src/bin/pg_rewind/libpq_source.c | 11 ++++++++++-
src/bin/pg_rewind/t/001_basic.pl | 20 ++++++++++++++++++++
src/bin/pg_rewind/t/RewindTest.pm | 1 +
3 files changed, 31 insertions(+), 1 deletion(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix pg_rewind with in-place tablespaces when source is remote
In-Reply-To: <E1qPztK-001y7K-HF@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox