From: | Justin Pryzby <pryzby(at)telsasoft(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, "k(dot)jamison(at)fujitsu(dot)com" <k(dot)jamison(at)fujitsu(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: please update ps display for recovery checkpoint |
Date: | 2020-12-11 04:02:10 |
Message-ID: | 20201211040210.GZ24052@telsasoft.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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",
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2020-12-11 04:17:35 | Re: please update ps display for recovery checkpoint |
Previous Message | Michael Paquier | 2020-12-11 03:54:22 | Re: please update ps display for recovery checkpoint |