Hi,

On 2025-07-23 10:23:53 +0000, Bertrand Drouvot wrote:
> On Wed, Jul 23, 2025 at 05:09:54PM +0900, Michael Paquier wrote:
> > so we don’t really need to mix multiple numbers; we could just have a single
> > boolean flag that any fixed-sized stats kinds can set to let the reporting 
> > know
> > that some activity has happened.
> 
> That works to say "there are pending stats" but not well to say "there are no
> pending stats".
> 
> Indeed, with a single boolean flag, then how could a stat say that it has 
> nothing
> pending anymore (when flushing) without saying "all the stats have nothing
> pending" (while some may still have pending stats)?

I don't think that's a problem - reset that global flag after checking it at
the start of pgstat_report_stat() and set it to true if partial_flush is true
at the end of pgstat_report_stat().

Greetings,

Andres Freund


Reply via email to