pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Bossart, Nathan <bossartn@amazon.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: k.jamison@fujitsu.com <k.jamison@fujitsu.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: please update ps display for recovery checkpoint
Date: Thu, 10 Dec 2020 22:02:10 -0600
Message-ID: <20201211040210.GZ24052@telsasoft.com> (raw )
In-Reply-To: <X9Ltbgcqy18Xvizq@paquier.xyz >
References: <20200919160031.GC30557@telsasoft.com >
<20201002072814.GE1464@paquier.xyz >
<20201002091354.GH8476@telsasoft.com >
<9A1B9D98-4576-438A-943F-0AFB05946C7C@amazon.com >
<20201203215809.GS24052@telsasoft.com >
<1A9049D3-44B9-4504-AC18-4BE42F69E8AB@amazon.com >
<549f04f1-6362-b599-c5e6-87330e36f03d@oss.nttdata.com >
<X9Brc31Jj5cemRUw@paquier.xyz >
<B8C46DD1-557F-4D20-97DD-DBC16772457F@amazon.com >
<X9Ltbgcqy18Xvizq@paquier.xyz >
Isn't the sense of "reset" inverted ?
I think maybe you mean to do set_ps_display(""); in the "if reset".
On Fri, Dec 11, 2020 at 12:54:22PM +0900, Michael Paquier wrote:
> +update_checkpoint_display(int flags, bool restartpoint, bool reset)
> +{
> + if (reset)
> + {
> + char activitymsg[128];
> +
> + snprintf(activitymsg, sizeof(activitymsg), "performing %s%s%s",
> + (flags & CHECKPOINT_END_OF_RECOVERY) ? "end-of-recovery " : "",
> + (flags & CHECKPOINT_IS_SHUTDOWN) ? "shutdown " : "",
> + restartpoint ? "restartpoint" : "checkpoint");
> + set_ps_display(activitymsg);
> + }
> + else
> + set_ps_display("");
> +}
> +
> +
> /*
> * Perform a checkpoint --- either during shutdown, or on-the-fly
> *
> @@ -8905,6 +8937,9 @@ CreateCheckPoint(int flags)
> if (log_checkpoints)
> LogCheckpointStart(flags, false);
>
> + /* Update the process title */
> + update_checkpoint_display(flags, false, false);
> +
> TRACE_POSTGRESQL_CHECKPOINT_START(flags);
>
> /*
> @@ -9120,6 +9155,9 @@ CreateCheckPoint(int flags)
> /* Real work is done, but log and update stats before releasing lock. */
> LogCheckpointEnd(false);
>
> + /* Reset the process title */
> + update_checkpoint_display(flags, false, true);
> +
> TRACE_POSTGRESQL_CHECKPOINT_DONE(CheckpointStats.ckpt_bufs_written,
> NBuffers,
> CheckpointStats.ckpt_segs_added,
> @@ -9374,6 +9412,9 @@ CreateRestartPoint(int flags)
> if (log_checkpoints)
> LogCheckpointStart(flags, true);
>
> + /* Update the process title */
> + update_checkpoint_display(flags, true, false);
> +
> CheckPointGuts(lastCheckPoint.redo, flags);
>
> /*
> @@ -9492,6 +9533,9 @@ CreateRestartPoint(int flags)
> /* Real work is done, but log and update before releasing lock. */
> LogCheckpointEnd(true);
>
> + /* Reset the process title */
> + update_checkpoint_display(flags, true, true);
> +
> xtime = GetLatestXTime();
> ereport((log_checkpoints ? LOG : DEBUG2),
> (errmsg("recovery restart point at %X/%X",
view thread (30+ messages) latest in thread
Message-ID: <20201211040210.GZ24052@telsasoft.com>
Permalink: ../20201211040210.GZ24052@telsasoft.com/
Also on: postgresql.org/message-id/20201211040210.GZ24052@telsasoft.com
copy link · copy postgr.es
reply 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, michael@paquier.xyz, bossartn@amazon.com, masao.fujii@oss.nttdata.com, k.jamison@fujitsu.com, thomas.munro@gmail.com
Subject: Re: please update ps display for recovery checkpoint
In-Reply-To: <20201211040210.GZ24052@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