Re: Intermittent pg_ctl failures on Windows - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Intermittent pg_ctl failures on Windows
Date
Msg-id 20190718053834.GG1416@paquier.xyz
Whole thread Raw
In response to Re: Intermittent pg_ctl failures on Windows  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Intermittent pg_ctl failures on Windows  (Жарков Роман <r.zharkov@postgrespro.ru>)
List pgsql-hackers
On Wed, Jul 17, 2019 at 09:51:48AM -0400, Tom Lane wrote:
> r.zharkov@postgrespro.ru writes:
>> On Windows systems we cannot handle ERROR_DELETE_PENDING because
>> GetLastError() returns ERROR_ACCESS_DENIED instead.
>> So we rename the lock files before delete them.
>
> This seems improbably broken/stupid.  Also, I've not seen any buildfarm
> failures that would match this; it's always pg_ctl complaining not the
> postmaster.

Oh, it is.  A lot.  And this has been discussed a couple of times
across multiple threads on -bugs and/or -hackers.  I think that
Windows just lacks a way to detect reliably if a file is pending for
deletion or not, and there is no way that we are going to enforce
blindly a ERROR_DELETE_PENDING when we see EACCES.  One code path
which is impacted by that is our wrapper for stat() for the win32
port...  For now I'd rather believe that what the OS tells us is true,
in which case here it is plain wrong, but well.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_receivewal documentation
Next
From: Amit Kapila
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs