From: Michael Paquier <michael@paquier.xyz>
To: Chris Travers <chris.travers@stormatics.tech>
Cc: Farooq Rashed <farooq.rashed@desc.gov.ae>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: pg_rewind fails on Windows where tablespaces are used
Date: Tue, 4 Jun 2024 13:53:04 +0900
Message-ID: <Zl6dsK5IcNGTL0qD@paquier.xyz> (raw)
In-Reply-To: <CA+pA0kLc5VxOaO4WfLjmh7W0V+quVvVtT5CaRVRAZMuh0zft4Q@mail.gmail.com>
References: <CA+pA0kLc5VxOaO4WfLjmh7W0V+quVvVtT5CaRVRAZMuh0zft4Q@mail.gmail.com>
On Wed, May 08, 2024 at 03:02:21PM +0700, Chris Travers wrote:
> Setup is PostgreSQL on Windows with a tablespace on a separate drive. When
> I go to run pg_rewind it consistently fails with the following error:
(Chris has poked me regarding this issue last week in Vancouver.)
> pg_rewind: servers diverged at WAL location 39B/7EC6F60 on timeline 2
> pg_rewind: rewinding from last common checkpoint at 39B/7E8E3F8 on timeline
> 2
> pg_rewind: error: file "pg_tblspc/34244696" is of different type in source
> and target
>
> The file is confirmed to be a JUNCTION to the correct location on both the
> source and target. So the error looks like a problem interacting with
> Windows and detecting JUNCTION types in this case.
I am not completely sure to follow here. Aren't you making use of an
in-place tablespace here? Could you provide more details about the
structure of the data folders, because these are on separate hosts,
right? When rewinding from a live server, readlink() returns an
absolute path for a junction point, meaning that the result would not
be influenced by bf227926d22b as we would always handle such an entry
with FILE_TYPE_SYMLINK. On Windows, the link creation would be
covered by pgsymlink(), which would create the link as a junction
point.
Note that I do not object to a backpatch of bf227926d22b, as I did not
do it for the sake of caution as in-place tablespaces are a developer
feature. If you use it for tests of your own on stable branches,
well, why not.
> I came across the following which looks like it would fix this problem but
> don't have a proper build environment. Please consider backporting the fix
> at least as far as Postgres 15 as this bug fix does apply to non-in-place
> tablespaces on Windows. The thread is
> https://postgrespro.com/list/thread-id/2657122
I'd suggest to use the postgresql.org reference. This refers to
commit bf227926d22b, for the following thread:
https://www.postgresql.org/message-id/2b79d2a8-b2d5-4bd7-a15b-31e485100980.xiyuan.zr@alibaba-inc.com
Thanks,
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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-bugs@postgresql.org
Cc: michael@paquier.xyz, chris.travers@stormatics.tech, farooq.rashed@desc.gov.ae, pgsql-bugs@lists.postgresql.org
Subject: Re: pg_rewind fails on Windows where tablespaces are used
In-Reply-To: <Zl6dsK5IcNGTL0qD@paquier.xyz>
* 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