Hi all, Thank you for the review and feedback for raising these points. While the checkpoint starting message already includes the reason, in practice the checkpoint completion message is what users most often look at for performance analysis since it contains the detailed timing, buffer, and WAL statistics to refer to. When extracting or aggregating logs, it is currently necessary to correlate the completion message back to the corresponding starting message to determine the checkpoint type, which is not always convenient or reliable in busy systems. Including the reason directly in the completion message avoids that extra step. I agree with your point that the checkpoint completion message should use the same terminology as the starting message ( “fast” rather than “immediate”) and I have updated the patch accordingly and have attached herewith for review. This patch aligns the checkpoint completion log wording with the existing checkpoint starting message (using “fast” instead of “immediate”) for consistency. And regarding why this information has historically only been present in the starting message, I think the completion log originally focused purely on reporting I/O and timing statistics, rather than contextual metadata. With the increasing use of log analysis for performance troubleshooting, it is reasonable to include the checkpoint reason with those statistics for the detailed analysis. Kindly review my patch and let me know the feedback.
Regards, Soumya
From 46449766f736dff9815e1aa6bea13276f7f9cea6 Mon Sep 17 00:00:00 2001 From: Soumya <[email protected]> Date: Wed, 7 Jan 2026 12:29:43 +0530 Subject: [PATCH] Expose checkpoint reason in completion log messages Signed-off-by: Soumya <[email protected]> --- src/backend/access/transam/xlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6107e5d993..2b7f44d335 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6767,7 +6767,7 @@ LogCheckpointEnd(bool restartpoint, int flags) else if (flags & CHECKPOINT_END_OF_RECOVERY) ckpt_reason = "end-of-recovery"; else if (flags & CHECKPOINT_FAST) - ckpt_reason = "immediate"; + ckpt_reason = "fast"; else if (flags & CHECKPOINT_FORCE) ckpt_reason = "forced"; -- 2.34.1
