Re: pg_tablespace_location() failure with allow_in_place_tablespaces
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-03-30T07:23:25Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-get_dirent_type-for-Windows-junction-points.patch (text/x-patch) patch 0001
- 0002-Remove-unnecessary-Windows-specific-basebackup-code.patch (text/x-patch) patch 0002
On Sat, Mar 26, 2022 at 6:33 PM Michael Paquier <michael@paquier.xyz> wrote: > Ah, good point. I have not tested on Windows so I am not 100% sure, > but indeed it would make sense to reverse both conditions if a > junction point happens to be marked as both FILE_ATTRIBUTE_DIRECTORY > and FILE_ATTRIBUTE_REPARSE_POINT when scanning a directory. Based on > a read of the the upstream docs, I guess that this is the case: > https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/ca28ec38-f155-4768-81d6-4bfeb8586fc9 > > Note the "A file or directory that has an associated reparse point." > for the description of FILE_ATTRIBUTE_REPARSE_POINT. That leads to the attached patches, the first of which I'd want to back-patch. Unfortunately while testing this I realised there is something else wrong here: if you take a basebackup using tar format, in-place tablespaces are skipped (they should get their own OID.tar file, but they don't, also no error). While it wasn't one of my original goals for in-place tablespaces to work in every way (and I'm certain some external tools would be confused by them), it seems we're pretty close so we should probably figure out that piece of the puzzle. It may be obvious why but I didn't have time to dig into that today... perhaps instead of just skipping the readlink() we should be writing something different into the mapfile and then restoring as appropriate...
Commits
-
Remove unnecessary Windows-specific basebackup code.
- 202b56ba91cb 15.0 landed
- 5344723755bd 16.0 landed
-
Fix get_dirent_type() for Windows junction points.
- fee0165fc1cf 14.5 landed
- 6d306ab73168 15.0 landed
- 9d3444dcce4d 16.0 landed
-
doc: Remove mention to in-place tablespaces for pg_tablespace_location()
- 7a7cd84893e0 15.0 landed
-
Fix pg_tablespace_location() with in-place tablespaces
- f6f0db4d6240 15.0 landed
-
Fix pg_basebackup with in-place tablespaces.
- c6f2f01611d4 15.0 landed