public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Bertrand Drouvot <[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: Wed, 1 Oct 2025 07:43:31 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<erpzwxoptqhuptdrtehqydzjapvroumkhh7lc6poclbhe7jk7l@l3yfsq5q4pw7>
	<[email protected]>
	<aNuDRhb/[email protected]>
	<[email protected]>
	<[email protected]>

On Tue, Sep 30, 2025 at 10:05:43AM +0000, Bertrand Drouvot wrote:
> On Tue, Sep 30, 2025 at 04:37:25PM +0900, Michael Paquier wrote:
>> 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.

Okay.  The first use case that comes into mind here is pgstat_io.c, to
offer periodic reports on analytics (please extend that to the backend
stats for WAL and I/O).  In this case, it seems that it would be good
to know about all the stats fields, meaning that a single pending list
is OK.  My feeling would be to reuse pgstat_report_stat() and plant a
new argument for the transactional state (or just a bits32 that works
along the force option) with the same threshold for reports, combined
with a new option to allow non-transactional reports (don't see a
point in forcing these and wait on locks, 1-min reports not happening
would not matter if an analytical query takes a few hours).

It would be better to determine a list of the stats we'd be
interesting in seeing updated without waiting for a query or a 
transaction to finish, then design the needs around these
requirements, with a new thread to discuss the matter.  The IO stats
are just the first case coming into mind.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

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