Re: Inconsistency in reporting checkpointer stats - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Inconsistency in reporting checkpointer stats
Date
Msg-id 2ce3814b-572f-4b19-a585-080cb668bd4a@oss.nttdata.com
Whole thread Raw
In response to Re: Inconsistency in reporting checkpointer stats  (Nitin Jadhav <nitinjadhavpostgres@gmail.com>)
List pgsql-hackers

On 2024/07/18 16:08, Nitin Jadhav wrote:
> I apologize for not being active on this thread. However, I have now
> returned to the thread and confirmed that the inconsistency is still
> present in the latest code. I believe it’s crucial to address this
> issue, and I am currently submitting the v5 version of the patch. The
> v4 version had addressed the feedback from Bharath, Kyotaro, Andres,
> and Robert. The current version has been rebased to incorporate
> Vignesh’s suggestions. In response to Michael’s comments, I’ve moved
> the new ‘slru_written’ column from the ‘pg_stat_bgwriter’ view to the
> ‘pg_stat_checkpointer’ in the attached patch.
> 
> To summarize our discussions, we’ve reached a consensus to correct the
> mismatch between the information on buffers written as displayed in
> the ‘pg_stat_checkpointer’ view and the checkpointer log message.
> We’ve also agreed to separate the SLRU buffers data from the buffers
> written and present the SLRU buffers data in a distinct field.
> 
> I have created the new commitfest entry here
> https://commitfest.postgresql.org/49/5130/.
> Kindly share if any comments.

Thanks for updating the patch!

In pgstat_checkpointer.c, it looks like you missed adding
CHECKPOINTER_COMP(slru_written) in pgstat_checkpointer_snapshot_cb().

+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+        <structfield>slru_written</structfield> <type>bigint</type>
+      </para>
+      <para>
+        Number of SLRU buffers written during checkpoints and restartpoints
+      </para></entry>
+     </row>

This entry should be moved to the pg_stat_checkpointer documentation.

+                        CheckpointStats.ckpt_slru_written,
+                        (double) CheckpointStats.ckpt_slru_written * 100 / NBuffers,

I don't think NBuffers represents the maximum number of SLRU buffers.
We might need to calculate this based on specific GUC settings,
like transaction_buffers.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION




pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: attndims, typndims still not enforced, but make the value within a sane threshold
Next
From: Robert Haas
Date:
Subject: Re: access numeric data in module