Re: Background writer and checkpointer in crash recovery

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Thomas Munro <thomas.munro@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Aleksander Alekseev <aleksander@timescale.com>, pgsql-hackers@lists.postgresql.org
Date: 2022-09-13T04:32:11Z
Lists: pgsql-hackers
On Mon, Sep 12, 2022 at 09:13:11PM -0500, Justin Pryzby wrote:
> Like this, maybe.
> 
> It's similar to what I suggested to consider backpatching here:
> https://www.postgresql.org/message-id/20201214032224.GA30237%40telsasoft.com

At the same time, df9274adf has been done because the end-of-recovery
checkpoint done potentially by the startup process if the checkpointer
was not up at the end of recovery would take long.  Any of the actions
taken in the startup process when finishing recovery are not that
costly, on the contrary, as far as I know.

I am not opposed to clearing the ps display when we are at this state
of the game for the startup process, but rather than clearing it we
could switch provide something more useful that shows what's
happening.  Say a simple "performing end-of-recovery actions", for
example..
--
Michael

Commits

  1. Clear ps display of startup process at the end of recovery

  2. Further simplify a bit of logic in StartupXLOG().

  3. Run checkpointer and bgwriter in crash recovery.

  4. Add some checkpoint/restartpoint status to ps display

  5. Start background writer during archive recovery. Background writer now performs