Re: [PATCH] Accept connections post recovery without waiting for RemoveOldXlogFiles
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: Nitin Motiani <nitinmotiani@google.com>
Cc: pgsql-hackers@postgresql.org
Date: 2025-09-09T07:52:52Z
Lists: pgsql-hackers
On Mon, Sep 8, 2025 at 6:33 PM Nitin Motiani <nitinmotiani@google.com> wrote: > > Hi Hackers, > > I'd like to propose a patch to allow accepting connections post recovery without waiting for the removal of old xlog files. As another idea, could crash recovery avoid waiting for the end-of-recovery checkpoint itself to finish, similar to archive recovery? In other words, crash recovery would write the end-of-recovery WAL record and request a checkpoint, but not block until it completes. Thought? One concern, though: in your case, the first checkpoint after crash recovery could take a very long time, since it needs to remove a large number of WAL files. This could delay subsequent checkpoints beyond checkpoint_timeout. If so, perhaps we'd need to limit how many WAL files a single checkpoint can remove. Regards, -- Fujii Masao