Re: pg_rewind fails on Windows where tablespaces are used

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Chris Travers <chris(dot)travers(at)stormatics(dot)tech>
Cc: Farooq Rashed <farooq(dot)rashed(at)desc(dot)gov(dot)ae>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: pg_rewind fails on Windows where tablespaces are used
Date: 2024-07-09 16:01:17
Message-ID: 5169f6d5-240e-49ec-9265-ddafa6e863bd@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On 2024-06-04 Tu 12:53 AM, Michael Paquier wrote:
> 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.

An EDB customer has encountered the same issue. They are not using
in-place tablespaces.

I have reproduced this problem on release 15, not using an in-place
tablespace.

The solution I came up with was to backpatch commits c5cb8f3b, 387803d8
and 5fc88c5d53.

I don't think we need to do anything relating to in-place tablespaces.
These are documented as a developer only option and not for production.

The only question in my mind is whether those patches should be
backpatched. It's a couple of hundred lines, and I think it's safe, but
I'd welcome other opinions. If we are going to backpatch them we should
also look at adding to adding tests for use of tablespaces with
pg_rewind on the back branches. Ideally we'd get this done in time for
the next maintenance release.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2024-07-09 23:12:29 Re: pg_rewind fails on Windows where tablespaces are used
Previous Message PG Bug reporting form 2024-07-09 11:00:29 BUG #18531: err when using 'current of' with incremental COMMIT