On Fri, Mar 5, 2021 at 11:02 AM Thomas Munro <thomas.mu...@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.