Re: log_checkpoints: count WAL segment creations from all processes

From: Hüseyin Demir <huseyin(dot)d3r(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Xuneng Zhou <xunengzhou(at)protonmail(dot)com>
Subject: Re: log_checkpoints: count WAL segment creations from all processes
Date: 2026-05-17 09:10:36
Message-ID: 177900903603.531853.1293633810239890632.pgcf@coridan.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for the patch. The idea is good and can we introduce a new
counter to pg_stat_checkpointer ? For example, we can add
wal_segments_created to this view and it would be useful for capacity
planning and load estimations.

Additionally I have a few questions

- Should we make walSegsCreatedLastCheckpoint atomic ? In the future
we can also add this to views maybe. It's an auxiliary suggestion.
- ckpt_segs_added is defined as int but overflow threshold is 2^32 in
comments. Shouldn't we use 2^31 for int ?
- Maybe it's a bad idea but should we extend the tests with the
wal_level set to minimal ?

PS: I created a patch to expose wal_segments_created to
pg_stat_checkpointer view. You can review it and enhance your patch if
you need. I created it to explain my idea better so it can be
destroyed after your review. But I couldn't create a patch for
preceding questions.

Regards,
Demir.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2026-05-17 09:16:39 Re: [PATCH] Fix overflow and underflow in regr_r2()
Previous Message Ayush Tiwari 2026-05-17 06:24:52 pg_stash_advice: dump file with overlong stash name crashes worker in a restart loop