Re: stat() vs ERROR_DELETE_PENDING, round N + 1 - Mailing list pgsql-hackers

From Juan José Santamaría Flecha
Subject Re: stat() vs ERROR_DELETE_PENDING, round N + 1
Date
Msg-id CAC+AXB0ruMK7=WC=rXKW8eodfdp55CENdZhjEqib9u-_HqCAEA@mail.gmail.com
Whole thread Raw
In response to Re: stat() vs ERROR_DELETE_PENDING, round N + 1  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: stat() vs ERROR_DELETE_PENDING, round N + 1  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers

On Tue, Sep 28, 2021 at 2:50 AM Thomas Munro <thomas.munro@gmail.com> wrote:
On Thu, Sep 23, 2021 at 9:13 PM Juan José Santamaría Flecha
<juanjo.santamaria@gmail.com> wrote:
> When GetTempFileName() finds a duplicated file name and the file is pending for deletion, it fails with an "ERROR_ACCESS_DENIED" error code. That may describe the situation better than "ERROR_FILE_EXISTS".

Thanks for looking.  Why do you think that's better?  I assume that's
just the usual NT->Win32 error conversion at work.

When a function returns an error caused by accessing a file in DELETE_PENDING you should expect an EACCES. Nonetheless, if we can emulate a POSIX behaviour by mapping it to EEXIST, that works for me. I also consider that having the logic for DELETE_PENDING in a single function is an improvement.

Regards,

Juan José Santamaría Flecha

pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: [BUG] failed assertion in EnsurePortalSnapshotExists()
Next
From: Amit Kapila
Date:
Subject: Re: Failed transaction statistics to measure the logical replication progress