Re: faulty error handling around pgstat_count_io_op_time()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-06-17T05:42:21Z
Lists: pgsql-hackers
On Wed, Jun 17, 2026 at 10:29:36AM +0530, Ayush Tiwari wrote:
> I agree on this change, but the original placement was also recording
> the I/O timing of the attempted write, not just byte count, so moving
> it post save_errno drops that. (But even the ordinary write/fsync
> paths ereport before reaching their pgstat_count_io_op_time() call).

FWIW, I don't understand why registering the time taken for a failure
would make sense for WAL segment inits.  :)
--
Michael

Commits

  1. Fix pgstat_count_io_op_time() calls passing incorrect information