On Wed, Jul 27, 2022 at 6:06 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Wed, Jul 27, 2022 at 5:01 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> > Someone else still has the old file open, so we can't rename the new
> > one to its name? On Windows that should have gone through pgrename()
> > in dirmod.c, which would retry 100 times with a 100ms sleep between.
> > Since every backend reads that file (I added an elog() and saw it 2289
> > times during make check), I guess you can run out of luck.
> >
> > /me thinks
>
> Maybe we just have to rearrange the locking slightly? Something like
> the attached.
Erm, let me try that again, this time with the CloseTransientFile()
also under the lock, so that we never have a file handle without a
lock.