Re: stat() vs ERROR_DELETE_PENDING, round N + 1

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: stat() vs ERROR_DELETE_PENDING, round N + 1
Date: 2021-09-29 10:26:25
Message-ID: CAC+AXB0ruMK7=WC=rXKW8eodfdp55CENdZhjEqib9u-_HqCAEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 28, 2021 at 2:50 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:

> On Thu, Sep 23, 2021 at 9:13 PM Juan José Santamaría Flecha
> <juanjo(dot)santamaria(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-09-29 10:51:21 Re: Failed transaction statistics to measure the logical replication progress
Previous Message Drouvot, Bertrand 2021-09-29 09:54:40 Re: [BUG] failed assertion in EnsurePortalSnapshotExists()