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-19 10:16:38
Message-ID: a7f75d42-3a2e-4d70-a1b1-27c8706d2897@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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

Attachment Content-Type Size
v3-0001-Introduce-num_done-counter-in-the-pg_stat_checkpoint.patch text/x-patch 12.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2024-09-19 10:17:40 Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
Previous Message Laurenz Albe 2024-09-19 09:58:33 Re: Restrict EXPLAIN (ANALYZE) for RLS and security_barrier views