Re: per backend I/O statistics

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: per backend I/O statistics
Date: 2024-12-19 04:21:54
Message-ID: Z2OfYh3QJ7M5D0i-@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 18, 2024 at 08:11:55AM +0000, Bertrand Drouvot wrote:
> I think I prefer pg_stat_io_build_tuples() and used that name in v11
> attached.

I'll rely to your naming sense than mine, then :D

> I think that this comment is now confusing since the extra loop would be
> done in pg_stat_io_build_tuples() and not where the comment is written. One
> option could have been to move the assert and the comment in pg_stat_io_build_tuples()
> but I think it's better to have the assert before the pgstat_tracks_io_bktype()
> call in pg_stat_get_io(), so modified the comment a bit instead.
>
> 0002 is the per-backend stats I/O with yours tweaks.

While doing more tests with backends exiting concurrently with their
stats scanned, I have detected one path in pg_stat_get_backend_io()
after calling pgstat_get_beentry_by_proc_number() where we should also
check that it does not return NULL, or we would crash on a pointer
dereference when reading the backend type.

Fixed that, bumped the two version counters, and done.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-12-19 05:44:53 Re: Back-patch of: avoid multiple hard links to same WAL file after a crash
Previous Message Kirill Reshke 2024-12-19 04:13:25 Re: log_min_messages per backend type