Re: Intermittent pg_ctl failures on Windows

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: r(dot)zharkov(at)postgrespro(dot)ru, Badrul Chowdhury <bachow(at)microsoft(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Intermittent pg_ctl failures on Windows
Date: 2019-07-18 05:38:34
Message-ID: 20190718053834.GG1416@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 17, 2019 at 09:51:48AM -0400, Tom Lane wrote:
> r(dot)zharkov(at)postgrespro(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-07-18 05:45:05 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Michael Paquier 2019-07-18 05:29:09 Re: pg_receivewal documentation