Re: Show WAL write and fsync stats in pg_stat_io

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(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 02:28:52
Message-ID: Z6QeZKQya09lMNaY@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 05, 2025 at 09:06:24PM -0500, Tom Lane wrote:
> Basically, this test is broken because it assumes that the server
> is freshly started. That's not a scenario the buildfarm runs
> the core tests under, unfortunately, but it is one commonly
> used in hand testing.

Right. You are pointing at a stability issue related to the reads.
While looking at your case, I am also able to see two additional
failures with io_sum_wal_init_writes and io_sum_wal_init_fsyncs with
the initial context.

The queries for the normal context are not going to have this problem
even if we have a pg_stat_reset_shared('io'), but the init context
gets unstable, unfortunately. I don't see a way through here in the
main regression test suite, so how about moving these into
027_stream_regress.pl. It is possible to query the WAL read on the
standby of this test, and the write part for the init context on the
primary. The syncs are not relevant as TAP usually runs with
fsync=off, so better to remove this part entirely.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2025-02-06 02:32:07 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Hayato Kuroda (Fujitsu) 2025-02-06 02:07:16 RE: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.