Re: Make relfile tombstone files conditional on WAL level - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Make relfile tombstone files conditional on WAL level
Date
Msg-id CA+hUKGLo6k3BTSo5dHiY3zUh4TUVbdkPaJVpj8mQAes0k4p9CQ@mail.gmail.com
Whole thread Raw
In response to Re: Make relfile tombstone files conditional on WAL level  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Make relfile tombstone files conditional on WAL level
List pgsql-hackers
On Fri, Mar 5, 2021 at 11:02 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> This is a WIP with an open question to research: what could actually
> break if we did this?

I thought this part of bgwriter.c might be a candidate:

       if (FirstCallSinceLastCheckpoint())
       {
           /*
            * After any checkpoint, close all smgr files.  This is so we
            * won't hang onto smgr references to deleted files indefinitely.
            */
            smgrcloseall();
       }

Hmm, on closer inspection, isn't the lack of real interlocking with
checkpoints a bit suspect already?  What stops bgwriter from writing
to the previous relfilenode generation's fd, if a relfilenode is
recycled while BgBufferSync() is running?  Not sinval, and not the
above code that only runs between BgBufferSync() invocations.



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add jsonlog log_destination for JSON server logs
Next
From: Michael Paquier
Date:
Subject: Re: reindexdb usage message about system catalogs