Re: Show WAL write and fsync stats in pg_stat_io

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "bharath(dot)rupireddyforpostgres(at)gmail(dot)com" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Show WAL write and fsync stats in pg_stat_io
Date: 2025-02-06 07:32:01
Message-ID: Z6RlccDRXY6McJyN@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Feb 06, 2025 at 12:35:28PM +0900, Michael Paquier wrote:
> On Wed, Feb 05, 2025 at 09:52:14PM -0500, Tom Lane wrote:
> > Michael Paquier <michael(at)paquier(dot)xyz> writes:
> > Yeah, if we want to assume we can see stats counts left over from
> > initdb, we have to put this in a TAP test, though I dunno if that is
> > the most appropriate one.
>
> A second option I can think of for the reads is a SQL query in
> pg_walinspect. We are sure that we have a xlogreader context there,
> forcing reads.
>
> Anyway, I would just stick all that to TAP, like the attached in 027,
> where we would rely on the startup process to read data, and the
> checkpointer to initialize a segment for the primary. Perhaps not the
> best position, but we already have similar queries in this test, and
> these two are cheap. Thoughts about the attached?

That sounds ok, but I wonder if that's the best appropriate place. I could
think of the checkpointer test in 029_stats_restart.pl and the startup/standby
one in one related to standby (030_stats_cleanup_replica.pl?). Though that's
probably just a matter of taste.

s/and the primary WAL some writes/and the primary some WAL writes/

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 Evgeniy Gorbanyov 2025-02-06 07:38:30 Buffer overflow in zic
Previous Message Bertrand Drouvot 2025-02-06 06:55:54 Re: Failed assertion with jit enabled