pg_gather icon indicating copy to clipboard operation
pg_gather copied to clipboard

Future bug: postgres 17 breaks pg_stat_bgwriter

Open ylacancellera opened this issue 9 months ago • 1 comments

from https://www.postgresql.org/docs/devel/release-17.html

Create system view pg_stat_checkpointer (Bharath Rupireddy, Anton A. Melnikov, Alexander Korotkov) Relevant columns have been removed from pg_stat_bgwriter and added to this new system view.

ylacancellera avatar May 10 '24 13:05 ylacancellera

Thank you, @ylacancellera, for reporting this. Yes, this is really a "Future Bug." I think it might be a good idea to wait for the release. What do you think?

jobinau avatar May 10 '24 16:05 jobinau

Unfortunately, PostgreSQL 17 removed the functions like pg_stat_get_buf_written_backend() This makes the task more difficult. A commit https://github.com/jobinau/pg_gather/commit/c750d2955e411c400f10f2316361976da711d6c1 could be temporary fix for data collection and importing. However, analysis and report generation needs improvements to get data from other parts and stitch them together.

jobinau avatar Jun 06 '24 10:06 jobinau

Missed your initial update sorry!

I think it might be a good idea to wait for the release. What do you think?

Yes definitely it will be easier then. I just filed in so that it does not come as a surprise when it releases

Unfortunately, PostgreSQL 17 removed the functions like pg_stat_get_buf_written_backend()

Maybe pg_stat_get_checkpointer_buffers_written is good enough ? It seems close to the previous fields used. checkpointer and backend "buffer written" seem merged now

ylacancellera avatar Jun 06 '24 11:06 ylacancellera

pg_stat_get_checkpointer_buffers_written() returns the number of buffers written by the checkpointer. (It is already part of commit https://github.com/jobinau/pg_gather/commit/c750d2955e411c400f10f2316361976da711d6c1) pg_stat_get_buf_written_backend() is different. It is the buffers written by individual client backends, which no longer exists in PG17

jobinau avatar Jun 06 '24 11:06 jobinau

The analysis / Report part is modified to have PG 17 compatibility https://github.com/jobinau/pg_gather/commit/9b7fc52c2ff9f437b4930bef497b2acc3624c926 If everything goes well, this will be part of release 27

jobinau avatar Jun 18 '24 12:06 jobinau