pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix inconsistent reporting of checkpointer stats.
Date: Wed, 02 Oct 2024 02:20:14 +0000
Message-ID: <E1svoyM-001nQj-CW@gemulon.postgresql.org> (raw)

Fix inconsistent reporting of checkpointer stats.

Previously, the pg_stat_checkpointer view and the checkpoint completion
log message could show different numbers for buffers written
during checkpoints. The view only counted shared buffers,
while the log message included both shared and SLRU buffers,
causing inconsistencies.

This commit resolves the issue by updating both the view and the log message
to separately report shared and SLRU buffers written during checkpoints.
A new slru_written column is added to the pg_stat_checkpointer view
to track SLRU buffers, while the existing buffers_written column now
tracks only shared buffers. This change would help users distinguish
between the two types of buffers, in the pg_stat_checkpointer view and
the checkpoint complete log message, respectively.

Bump catalog version.

Author: Nitin Jadhav
Reviewed-by: Bharath Rupireddy, Michael Paquier, Kyotaro Horiguchi, Robert Haas
Reviewed-by: Andres Freund, vignesh C, Fujii Masao
Discussion: https://postgr.es/m/CAMm1aWb18EpT0whJrjG+-nyhNouXET6ZUw0pNYYAe+NezpvsAA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/17cc5f666f6aada21eb3237974c50681ba4814ea

Modified Files
--------------
doc/src/sgml/monitoring.sgml                     | 11 +++++++++-
src/backend/access/transam/slru.c                |  7 +++++--
src/backend/access/transam/xlog.c                | 26 +++++++++++++-----------
src/backend/catalog/system_views.sql             |  1 +
src/backend/utils/activity/pgstat_checkpointer.c |  2 ++
src/backend/utils/adt/pgstatfuncs.c              |  6 ++++++
src/include/access/xlog.h                        |  1 +
src/include/catalog/catversion.h                 |  2 +-
src/include/catalog/pg_proc.dat                  |  5 +++++
src/include/pgstat.h                             |  1 +
src/test/regress/expected/rules.out              |  1 +
11 files changed, 47 insertions(+), 16 deletions(-)



Message-ID: <E1svoyM-001nQj-CW@gemulon.postgresql.org>
Permalink:  ../E1svoyM-001nQj-CW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1svoyM-001nQj-CW@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix inconsistent reporting of checkpointer stats.
  In-Reply-To: <E1svoyM-001nQj-CW@gemulon.postgresql.org>

* 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