From: Justin Pryzby <pryzby@telsasoft.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Aleksander Alekseev <aleksander@timescale.com>
Cc: pgsql-hackers@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>
Subject: Re: Background writer and checkpointer in crash recovery
Date: Mon, 12 Sep 2022 21:13:11 -0500
Message-ID: <20220913021311.GN31833@telsasoft.com> (raw)
In-Reply-To: <20220912005443.GB31833@telsasoft.com>
References: <CA+hUKGJ8NRsqgkZEnsnRc2MFROBV-jCnacbYvtpptK2A9YYp9Q@mail.gmail.com>
<CA+hUKGKBngNkTLm1gSmosY6o-azfUvQxALaBSEOjs6KpKYQ9pg@mail.gmail.com>
<162763450191.31964.15384962987091520173.pgcf@coridan.postgresql.org>
<CA+Tgmoa9TsiRDQnTm20fMJjWD3W9Lm3kSS8VJJRXeFnoRw6k9g@mail.gmail.com>
<CA+hUKGKiBnK9cB_NAxBOHJ7okw9p46F7ZmBP2FjpdTf5RJxS-g@mail.gmail.com>
<CA+TgmoYxi_f14WW6osP61DYQinrVQLyFX1F38NZWHW9xJJmgNg@mail.gmail.com>
<CA+hUKG+egXmO5GYhrhO5WgXziFeVMAE_uSVBEEBqsYh3Tid9fg@mail.gmail.com>
<CA+hUKGK--es4iccyAcLrevOdz5Sns4u=nNXDG5nF_G3MaGPggg@mail.gmail.com>
<20220912005443.GB31833@telsasoft.com>
On Sun, Sep 11, 2022 at 07:54:43PM -0500, Justin Pryzby wrote:
> On Tue, Aug 03, 2021 at 02:19:22PM +1200, Thomas Munro wrote:
> > On Tue, Aug 3, 2021 at 9:52 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> > > On Tue, Aug 3, 2021 at 1:17 AM Robert Haas <robertmhaas@gmail.com> wrote:
> > > > That's great. I just realized that this leaves us with identical
> > > > RequestCheckpoint() calls in two nearby places. Is there any reason
> > > > not to further simplify as in the attached?
> > >
> > > LGTM.
> >
> > And pushed.
>
> Gripe: this made the "ps" display worse than before.
>
> 7ff23c6d2 Run checkpointer and bgwriter in crash recovery.
>
> A couple years ago, I complained that during the end-of-recovery
> checkpoint, the "ps" display still said "recovering NNNNN", which made
> it look like it was stuck on a particular WAL file.
>
> That led to commit df9274adf, which updated the startup process's "ps"
> to say "end-of-recovery checkpoint".
>
> But since the start process no longer does the checkpoint, it still
> says:
>
> postgres 19738 11433 5 19:33 ? 00:00:01 postgres: startup recovering 000000010000000C000000FB
> postgres 19739 11433 3 19:33 ? 00:00:00 postgres: checkpointer performing end-of-recovery checkpoint
>
> That looks inconsistent. It'd be better if the startup process's "ps"
> were cleared.
Like this, maybe.
It's similar to what I suggested to consider backpatching here:
https://www.postgresql.org/message-id/20201214032224.GA30237%40telsasoft.cominline patch 1: src/backend/access/transam/xlog.c (+1/-0 lines) download inline-1.patchdiff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.cindex 7a710e6490d..4bf8614d45f 100644--- a/src/backend/access/transam/xlog.c+++ b/src/backend/access/transam/xlog.c@@ -5302,6 +5302,7 @@ StartupXLOG(void)
EndOfLogTLI = endOfRecoveryInfo->endOfLogTLI;
abortedRecPtr = endOfRecoveryInfo->abortedRecPtr;
missingContrecPtr = endOfRecoveryInfo->missingContrecPtr;
+ set_ps_display("");
/*
* When recovering from a backup (we are in recovery, and archive recovery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pryzby@telsasoft.com, thomas.munro@gmail.com, robertmhaas@gmail.com, aleksander@timescale.com, michael@paquier.xyz
Subject: Re: Background writer and checkpointer in crash recovery
In-Reply-To: <20220913021311.GN31833@telsasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox