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

Anton A. Melnikov <a.melnikov@postgrespro.ru>

From: "Anton A. Melnikov" <a.melnikov@postgrespro.ru>
To: Fujii Masao <masao.fujii@oss.nttdata.com>, Alexander Korotkov <aekorotkov@gmail.com>
Cc: Magnus Hagander <magnus@hagander.net>, "Anton A. Melnikov" <aamelnikov@inbox.ru>, Andres Freund <andres@anarazel.de>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2024-09-19T10:16:38Z
Lists: pgsql-hackers

Attachments

On 18.09.2024 21:04, Fujii Masao wrote:
> 
> -                CreateCheckPoint(flags);
> -                ckpt_performed = true;
> +                ckpt_performed = CreateCheckPoint(flags);
> 
> This change could result in the next scheduled checkpoint being
> triggered in 15 seconds if a checkpoint is skipped, which isn’t
> the intended behavior.

Thanks for pointing this out! This is really bug.
Rearranged the logic a bit to save the previous behavior
in the v3 attached.

> -void
> +bool
>   CreateCheckPoint(int flags)
> 
> It would be helpful to explain the new return value in the comment
> at the top of this function.

Sure. Added an info about return value to the comment.

> -{ oid => '2769',
> +{ oid => '6347',
> 
> I don't think that the existing functions need to be reassigned new OIDs.

Ok. Left oids as is in the v3. Just added a new one for
pg_stat_get_checkpointer_num_performed().


With the best regards!

-- 
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Improve descriptions of some pg_stat_checkpoints functions in pg_proc.dat.

  2. docs: Enhance the pg_stat_checkpointer view documentation.

  3. Add num_done counter to the pg_stat_checkpointer view.

  4. docs: Improve the description of num_timed column in pg_stat_checkpointer.

  5. Improve documentation for pg_stat_checkpointer fields

  6. Enhance checkpointer restartpoint statistics

  7. Introduce pg_stat_checkpointer