public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nitin Jadhav <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Add CHECKPOINT_REQUESTED flag to the log message in LogCheckpointStart()
Date: Wed, 2 Mar 2022 17:40:28 +0530
Message-ID: <CAMm1aWZRvUaU0KXbWNtOsNPUp1GJgJ2AL6p33p-_is+Cge_LfA@mail.gmail.com> (raw)

Hi,

I have noticed that the CHECKPOINT_REQUESTED flag information is not
present in the log message of LogCheckpointStart() function. I would
like to understand if it was missed or left intentionally. The log
message describes all the possible checkpoint flags except
CHECKPOINT_REQUESTED flag. I feel we should support this. Thoughts?

Please find the patch attached.

Thanks & Regards,
Nitin Jadhav


Attachments:

  [application/octet-stream] v1-0001-add-checkpoint_requested-flag-to-the-log-message.patch (2.2K, ../CAMm1aWZRvUaU0KXbWNtOsNPUp1GJgJ2AL6p33p-_is+Cge_LfA@mail.gmail.com/2-v1-0001-add-checkpoint_requested-flag-to-the-log-message.patch)
  download | inline diff:
From 0c5d0c2851fb93d48630ab1d8f2ddc7f6edbd1ab Mon Sep 17 00:00:00 2001
From: Nitin Jadhav <[email protected]>
Date: Wed, 2 Mar 2022 12:02:17 +0000
Subject: [PATCH] add CHECKPOINT_REQUESTED flag to the log message

---
 src/backend/access/transam/xlog.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 0d2bd7a357..ce87fd52d6 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6044,7 +6044,7 @@ LogCheckpointStart(int flags, bool restartpoint)
 	if (restartpoint)
 		ereport(LOG,
 		/* translator: the placeholders show checkpoint options */
-				(errmsg("restartpoint starting:%s%s%s%s%s%s%s%s",
+				(errmsg("restartpoint starting:%s%s%s%s%s%s%s%s%s",
 						(flags & CHECKPOINT_IS_SHUTDOWN) ? " shutdown" : "",
 						(flags & CHECKPOINT_END_OF_RECOVERY) ? " end-of-recovery" : "",
 						(flags & CHECKPOINT_IMMEDIATE) ? " immediate" : "",
@@ -6052,11 +6052,12 @@ LogCheckpointStart(int flags, bool restartpoint)
 						(flags & CHECKPOINT_WAIT) ? " wait" : "",
 						(flags & CHECKPOINT_CAUSE_XLOG) ? " wal" : "",
 						(flags & CHECKPOINT_CAUSE_TIME) ? " time" : "",
-						(flags & CHECKPOINT_FLUSH_ALL) ? " flush-all" : "")));
+						(flags & CHECKPOINT_FLUSH_ALL) ? " flush-all" : "",
+						(flags & CHECKPOINT_REQUESTED) ? " requested" : "")));
 	else
 		ereport(LOG,
 		/* translator: the placeholders show checkpoint options */
-				(errmsg("checkpoint starting:%s%s%s%s%s%s%s%s",
+				(errmsg("checkpoint starting:%s%s%s%s%s%s%s%s%s",
 						(flags & CHECKPOINT_IS_SHUTDOWN) ? " shutdown" : "",
 						(flags & CHECKPOINT_END_OF_RECOVERY) ? " end-of-recovery" : "",
 						(flags & CHECKPOINT_IMMEDIATE) ? " immediate" : "",
@@ -6064,7 +6065,8 @@ LogCheckpointStart(int flags, bool restartpoint)
 						(flags & CHECKPOINT_WAIT) ? " wait" : "",
 						(flags & CHECKPOINT_CAUSE_XLOG) ? " wal" : "",
 						(flags & CHECKPOINT_CAUSE_TIME) ? " time" : "",
-						(flags & CHECKPOINT_FLUSH_ALL) ? " flush-all" : "")));
+						(flags & CHECKPOINT_FLUSH_ALL) ? " flush-all" : "",
+						(flags & CHECKPOINT_REQUESTED) ? " requested" : "")));
 }
 
 /*
-- 
2.25.1



view thread (2+ messages)

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]
  Subject: Re: Add CHECKPOINT_REQUESTED flag to the log message in LogCheckpointStart()
  In-Reply-To: <CAMm1aWZRvUaU0KXbWNtOsNPUp1GJgJ2AL6p33p-_is+Cge_LfA@mail.gmail.com>

* 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