Re: Show WAL write and fsync stats in pg_stat_io

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nazir Bilal Yavuz <byavuz81@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, Melanie Plageman <melanieplageman@gmail.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers <pgsql-hackers@postgresql.org>, "bharath.rupireddyforpostgres@gmail.com" <bharath.rupireddyforpostgres@gmail.com>, Thomas Munro <thomas.munro@gmail.com>
Date: 2025-02-06T02:06:24Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix copy-paste error related to the autovacuum launcher in pgstat_io.c

  2. Move SQL tests of pg_stat_io for WAL data to recovery test 029_stats_restart

  3. Add data for WAL in pg_stat_io and backend statistics

  4. Improve comment on top of pgstat_count_io_op_time()

  5. Refactor pgstat_prepare_io_time() with an input argument instead of a GUC

Nazir Bilal Yavuz <byavuz81@gmail.com> writes:
> On Wed, 5 Feb 2025 at 21:32, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Locally, the test added by this commit fails like so:

> My thoughts when adding this test was that startup process must do the
> WAL read I/O while server is starting, i.e.:

Oh!  The problem is much simpler than I thought, then, and not
particularly related to configure options.  I was misled by
not trying repeated tests, but:

$ ./configure ...
$ make; make install
$ initdb ...; pg_ctl start
$ make installcheck
... all OK ...
$ make installcheck
... fails ...
$ make installcheck
... fails ...
$ make installcheck
... fails ...
$ make installcheck
... fails ...

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.

			regards, tom lane