Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, "Anton A(dot) Melnikov" <a(dot)melnikov(at)postgrespro(dot)ru>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, "Anton A(dot) Melnikov" <aamelnikov(at)inbox(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.
Date: 2024-09-13 15:20:46
Message-ID: 9ea77f40-818d-4841-9dee-158ac8f6e690@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024/03/14 9:19, Alexander Korotkov wrote:
> On Mon, Mar 11, 2024 at 11:48 AM Alexander Korotkov
> <aekorotkov(at)gmail(dot)com> wrote:
>>
>> On Mon, Mar 11, 2024 at 5:43 AM Anton A. Melnikov
>> <a(dot)melnikov(at)postgrespro(dot)ru> wrote:
>>> On 11.03.2024 03:39, Alexander Korotkov wrote:
>>>> Now that we distinguish stats for checkpoints and
>>>> restartpoints, we need to update the docs. Please, check the patch
>>>> attached.
>>>
>>> Maybe bring the pg_stat_get_checkpointer_buffers_written() description in consistent with these changes?
>>> Like that:
>>>
>>> --- a/src/include/catalog/pg_proc.dat
>>> +++ b/src/include/catalog/pg_proc.dat
>>> @@ -5740 +5740 @@
>>> - descr => 'statistics: number of buffers written by the checkpointer',
>>> + descr => 'statistics: number of buffers written during checkpoints and restartpoints',
>>
>> This makes sense. I've included this into the revised patch.
>
> Pushed.

If I understand correctly, restartpoints_timed and restartpoints_done were
separated because a restartpoint can be skipped. restartpoints_timed counts
when a restartpoint is triggered by a timeout, whether it runs or not,
while restartpoints_done only tracks completed restartpoints.

Similarly, I believe checkpoints should be handled the same way.
Checkpoints can also be skipped when the system is idle, but currently,
num_timed counts even the skipped ones, despite its documentation stating
it's the "Number of scheduled checkpoints that have been performed."

Why not separate num_timed into something like checkpoints_timed and
checkpoints_done to reflect these different counters?

Regards,

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-09-13 15:21:21 Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch
Previous Message Noah Misch 2024-09-13 14:56:21 Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible