Re: stat() vs ERROR_DELETE_PENDING, round N + 1
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>, Michael Paquier <michael@paquier.xyz>
Date: 2021-09-05T21:55:00Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > On 2021-09-06 01:32:55 +1200, Thomas Munro wrote: >> The best idea is probably to set FILE_DISPOSITION_DELETE | >> FILE_DISPOSITION_POSIX_SEMANTICS before unlinking. This appears to be >> a silver bullet, but isn't available on ancient Windows releases that >> we support, or file systems other than local NTFS. So maybe we need a >> combination of that + STATUS_DELETE_PENDING as shown in the attached. >> I'll look into that next. > When was that introduced? Googling says that it was introduced in Win10, although in RS2 (version 1703, general availability in 4/2017) not the initial release. > I'd be ok to only fix these bugs on e.g. Win10, Win Server 2019, Win Server > 2016 or such. Yeah, particularly if the fix is trivial on the newer systems and incredibly complicated otherwise. Between the effort needed and the risk of introducing new bugs, I'm really not excited about an invasive fix for this. regards, tom lane
Commits
-
Check for STATUS_DELETE_PENDING on Windows.
- e2f0f8ed251d 15.0 landed
-
Fix our Windows stat() emulation to handle file sizes > 4GB.
- bed90759fcbc 14.0 cited
-
Attempt to handle pending-delete files on Windows
- 9951741bbeb3 10.0 cited