Re: Flush some statistics within running transactions

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Subject: Re: Flush some statistics within running transactions
Date: 2026-01-22 07:43:07
Message-ID: aXHVC6NxERhcThZV@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Jan 22, 2026 at 10:56:48AM +0900, Fujii Masao wrote:
> On Thu, Jan 22, 2026 at 10:41 AM Sami Imseih <samimseih(at)gmail(dot)com> wrote:
> >
> > Sure, Bertrand mentioned early in the thread that the anytime flushes
> > could be made configurable. Perhaps that is a good idea where we can
> > default with something large like 10s intervals for anytime flushes, but allow
> > the user to configure a more frequent flushes ( although I would think
> > that 1 sec is the minimum we should allow ).
>
> +1 on adding an option to control the interval. With a fixed interval
> (for example, 1s), log_lock_waits messages could be emitted that frequently,
> which may be annoying for some users.
>
> Of course, it would be even better if these periodic wakeups did not trigger
> log_lock_waits messages at all, though.

pgstat_report_anytime_stat() is called with the force parameter set to false,
means that the flushes are done with nowait = true means that LWLockConditionalAcquire()
is used. In that case, do you still see cases where log_lock_waits messages could
be triggered due to the new flush?

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-01-22 08:02:01 Re: Flush some statistics within running transactions
Previous Message Zsolt Parragi 2026-01-22 07:40:38 Re: Periodic authorization expiration checks using GoAway message