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

From: "Anton A(dot) Melnikov" <a(dot)melnikov(at)postgrespro(dot)ru>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
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-18 14:35:26
Message-ID: a9cbe052-7cd2-46d2-a688-c7b08919db83@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii, Alexander thanks a lot!

On 17.09.2024 05:47, Fujii Masao wrote:
>
> Regarding the patch:
>                  if (do_restartpoint)
>                      PendingCheckpointerStats.restartpoints_performed++;
> +                else
> +                    PendingCheckpointerStats.num_performed++;
>
> I expected the counter not to be incremented when a checkpoint is skipped,
> but in this code, when a checkpoint is skipped, ckpt_performed is set to true,
> triggering the counter increment. This seems wrong.

Tried to fix it via returning bool value from the CreateCheckPoint()
similarly to the CreateRestartPoint().

And slightly adjusted the patch so that it could be applied after yours.

With the best wishes,

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

Attachment Content-Type Size
v2-0002-Introduce-num_done-counter-in-the-pg_stat_checkpoint.patch text/x-patch 12.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-09-18 14:35:46 Re: attndims, typndims still not enforced, but make the value within a sane threshold
Previous Message Pavel Stehule 2024-09-18 14:31:36 Re: Get TupleDesc for extension-defined types