pg_rewind fails on Windows where tablespaces are used
Chris Travers <chris.travers@stormatics.tech>
From: Chris Travers <chris.travers@stormatics.tech>
To: Farooq Rashed <farooq.rashed@desc.gov.ae>, pgsql-bugs@lists.postgresql.org
Date: 2024-05-08T08:02:21Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix readlink() for non-PostgreSQL junction points on Windows.
- 2c4a532c96a9 13.19 landed
- f4fd5325cc87 14.16 landed
- 9b136b0f2e53 15.11 landed
-
Fix stat() for recursive junction points on Windows.
- fbf8efbda88c 13.19 landed
- 9f1c67488e59 14.16 landed
- e708f31881fd 15.11 landed
-
Fix pg_rewind with in-place tablespaces when source is remote
- bf227926d22b 17.0 cited
-
Make unlink() work for junction points on Windows.
- f357233c9db8 16.0 cited
-
Use in-place tablespaces in regression test.
- d6d317dbf615 15.0 cited
Hi, 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: 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 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 Best Regards, Chris Travers