public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bertrand Drouvot <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: [email protected]
Subject: Re: [BUG]: the walsender does not update its IO statistics until it exits
Date: Tue, 30 Sep 2025 10:05:43 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<erpzwxoptqhuptdrtehqydzjapvroumkhh7lc6poclbhe7jk7l@l3yfsq5q4pw7>
	<[email protected]>
	<aNuDRhb/[email protected]>
	<[email protected]>

Hi,

On Tue, Sep 30, 2025 at 04:37:25PM +0900, Michael Paquier wrote:
> On Tue, Sep 30, 2025 at 07:14:14AM +0000, Bertrand Drouvot wrote:
> > On Thu, Feb 27, 2025 at 12:09:46PM +0900, Michael Paquier wrote:
> >> Agreed that something in the lines of non-transaction update of the
> >> entries could be adapted in some cases, so +1 for the idea.  I suspect
> >> that there would be cases where a single stats kind should be able to
> >> handle both transactional and non-transactional flush cases.
> >> Splitting that across two stats kinds would lead to a lot of
> >> duplication.
> > 
> > One option could be to use 2 pending lists for the variables stats and 2 flush
> > callbacks for fixed stats. Thoughts?
> 
> Hmm.  I would have thought first about one pending area, and two
> callbacks for the variable-sized stats, called with a different
> timing because the stats to be flushed are the same aren't they?  For
> example, if we are in a long analytical query, we would flush the IO
> stats periodically, reset the pending data, repeat/rinse periodically, 
> and do a last round when we are done with the query in postgres.c.
> 
> Do we really need a second callback by the way?  It could be as well
> the same flush callback, with an option to mark stats kinds that allow
> a periodic flush.  The trick is knowing where the new reports calls
> should happen.  The executor is the primary target area.
> 
> Or perhaps you think that the pending data of a stats kind could be
> different if a kind allows transactional and non-transactional
> flushes? 

Yeah that was my thought: one stats kind could have metrics that are transactional
and some metrics that are non-transactional. This could be possible for
both variable and fixed stats, that's why I was thinking about having
2 pending lists for the variables stats and 2 flush callbacks for fixed stats.

Regards,

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





view thread (37+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [BUG]: the walsender does not update its IO statistics until it exits
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox