public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Banck <[email protected]>
To: Soumya S Murali <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: VASUKI M <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Álvaro Herrera <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] Expose checkpoint reason to completion log messages.
Date: Thu, 8 Jan 2026 18:36:13 +0100
Message-ID: <[email protected];lightning.p46.dedyn.io> (raw)
In-Reply-To: <CAMtXxw9qg+-G24Xe-P=a2gWmCGnE4-CcOBOZ9tdO9eAqjMgEvQ@mail.gmail.com>
References: <CAMtXxw9tPwV=NBv5S9GZXMSKPeKv5f9hRhSjZ8__oLsoS5jcuA@mail.gmail.com>
	<rbgsftgjpffyscyfa6plqmm7fdl3fccuikuvao3tssihux3t73@dnb6u5njlrak>
	<CAMtXxw-Pvpznd_QczTYTsVhn=19qiX5N7X6DG6p9iyZdNDs7yw@mail.gmail.com>
	<CAHGQGwFzR=1EwefWGVNF5GaOMsNkWZZ9oJMXiwO3x8AhjUTqsQ@mail.gmail.com>
	<[email protected]>
	<CAE2r8H7yMJ2XncBM59-n0jMOGDSw3R2gLn6Cd_-eq_y-3NPw=w@mail.gmail.com>
	<CAHGQGwGXoai8-83p5x2FhHnu6LD=epsapa_RTTzM3RHShju3Jw@mail.gmail.com>
	<CAMtXxw-AuUyyGj8V7k0x9GgftoDd-DovMDedH0vTFv32BEpeXA@mail.gmail.com>
	<[email protected]>
	<CAMtXxw9qg+-G24Xe-P=a2gWmCGnE4-CcOBOZ9tdO9eAqjMgEvQ@mail.gmail.com>

Hi,

On Thu, Jan 08, 2026 at 11:58:43AM +0530, Soumya S Murali wrote:
> On Wed, Jan 7, 2026 at 1:37 PM Michael Banck <[email protected]> wrote:
> > On Wed, Jan 07, 2026 at 12:35:08PM +0530, Soumya S Murali wrote:
> I have reworked the patch to factor out the checkpoint reason logic to
> use the same wording for both checkpoint start and completion log
> (including wal, time, fast, force, and wait). The format has been
> aligned with existing conventions and has been verified by running
> make check and recovery TAP tests including t/019_replslot_limit.pl
> successfully.
> Kindly review my patch and let me know the feedback.

Thanks for the new patch.

> index 22d0a2e8c3..9f7439f9a2 100644
> --- a/src/backend/access/transam/xlog.c
> +++ b/src/backend/access/transam/xlog.c
[...]
> +static const char *
> +CheckpointReasonString(int flags)
> +{
> +	static char buf[128];
> +
> +	buf[0] = '\0';
> +
> +	if (flags & CHECKPOINT_IS_SHUTDOWN)
> +		strcat(buf, " shutdown");
> +	if (flags & CHECKPOINT_END_OF_RECOVERY)
> +		strcat(buf, " end-of-recovery");
> +	if (flags & CHECKPOINT_FAST)
> +		strcat(buf, " fast");
> +	if (flags & CHECKPOINT_FORCE)
> +		strcat(buf, " force");
> +	if (flags & CHECKPOINT_WAIT)
> +		strcat(buf, " wait");
> +	if (flags & CHECKPOINT_CAUSE_XLOG)
> +		strcat(buf, " wal");
> +	if (flags & CHECKPOINT_CAUSE_TIME)
> +		strcat(buf, " time");
> +	if (flags & CHECKPOINT_FLUSH_UNLOGGED)
> +		strcat(buf, " flush-unlogged");
> +
> +	return buf;
> +}

The way this is coded now prepends the final string with a space
character. This is fine for the checkpoint starting message, but makes
the checkpoint finished message look slightly weird (not the "( wal)"):

|2026-01-08 18:30:33.691 CET [1666416] LOG:  checkpoint complete ( wal):
|wrote 20 buffers (0.1%), wrote 0 SLRU buffers; 0 WAL file(s) added, 4
|removed, 33 recycled; write=2.221 s, sync=0.019 s, total=2.701 s; sync
|files=3, longest=0.018 s, average=0.007 s; distance=601885 kB,
|estimate=601885 kB; lsn=0/D2D59FC8, redo lsn=0/B492B500

Also I think the translators might now complain, but I am not sure how
to best approach this.


Michael






view thread (13+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Expose checkpoint reason to completion log messages.
  In-Reply-To: <[email protected];lightning.p46.dedyn.io>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox