public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Warning in geqo_main.c from clang 13
3+ messages / 3 participants
[nested] [flat]

* Re: Warning in geqo_main.c from clang 13
@ 2022-01-23 00:47  Thomas Munro <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Thomas Munro @ 2022-01-23 00:47 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: pgsql-hackers

On Sun, Jan 23, 2022 at 11:34 AM Tom Lane <[email protected]> wrote:
> We're starting to see more buildfarm animals producing this warning,
> so I took another look, and thought of a slightly less invasive way to
> silence it.  I confirmed this works with clang 13.0.0 on Fedora 35.

LGTM.  Tested on bleeding edge clang 14.






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Warning in geqo_main.c from clang 13
@ 2022-01-23 16:12  Tom Lane <[email protected]>
  parent: Thomas Munro <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-01-23 16:12 UTC (permalink / raw)
  To: Thomas Munro <[email protected]>; +Cc: pgsql-hackers

Thomas Munro <[email protected]> writes:
> On Sun, Jan 23, 2022 at 11:34 AM Tom Lane <[email protected]> wrote:
>> We're starting to see more buildfarm animals producing this warning,
>> so I took another look, and thought of a slightly less invasive way to
>> silence it.  I confirmed this works with clang 13.0.0 on Fedora 35.

> LGTM.  Tested on bleeding edge clang 14.

Pushed, thanks.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Restrict data checksums entries in pg_stat_io
@ 2026-07-10 03:13  Fujii Masao <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Fujii Masao @ 2026-07-10 03:13 UTC (permalink / raw)
  To: PostgreSQL Hackers <[email protected]>

Hi,

While reviewing the data checksums docs at [1], I found that the data checksums
launcher and workers are exposed in pg_stat_io with the same broad set of
object/context combinations as general background workers.

However, several of those entries can never accumulate I/O statistics.
For example, as far as I understand correctly, the launcher never processes
relations itself, and the workers neither operate on temporary relations nor
use the bulkread or bulkwrite contexts. So I think it would be better to
restrict the reported entries to those that the data checksums processes
can actually use.

The attached patch teaches pgstat_tracks_io_object() and pgstat_tracks_io_op()
about the actual I/O paths used by these processes. After the patch,
pg_stat_io includes only:

- data checksums launcher: relation/normal, wal/init, wal/normal
- data checksums worker: relation/normal, relation/vacuum, wal/init, wal/normal

The patch also excludes WAL reads for both processes, since they emit
WAL records but never read WAL.

Thoughts?

Regards,

[1] https://postgr.es/m/CAHGQGwFsBjQs2fv7b72hxzGV_fJMh6LAg4E83pNfDOu1jVgWCA@mail.gmail.com

-- 
Fujii Masao


Attachments:

  [application/octet-stream] v1-0001-Restrict-pg_stat_io-entries-for-data-checksum-pro.patch (3.7K, ../../CAHGQGwHz_-nt+YkHDMRZNBZrnoHro8cMOgSwuXEmSYT6vxgQ=w@mail.gmail.com/2-v1-0001-Restrict-pg_stat_io-entries-for-data-checksum-pro.patch)
  download | inline diff:
From 103a54882c40304958b4a360e0ac07f6b70b8fe1 Mon Sep 17 00:00:00 2001
From: Fujii Masao <[email protected]>
Date: Fri, 10 Jul 2026 10:54:46 +0900
Subject: [PATCH v1] Restrict pg_stat_io entries for data checksum processes

The data checksums launcher and workers were exposed in pg_stat_io
with the same broad set of object/context combinations as general
background workers. However, many of those entries can never accumulate
I/O statistics for these processes, such as bulkread, bulkwrite,
relation init, and temporary relation entries.

Teach pgstat_tracks_io_object() and pgstat_tracks_io_op() about the
actual I/O performed by the data checksum processes. Keep the entries
needed for catalog scans, worker relation processing with a vacuum
access strategy, and WAL writes and initialization, while excluding WAL
reads and other object/context combinations that can never be used.
---
 src/backend/utils/activity/pgstat_io.c | 31 ++++++++++++++++++++++++++
 src/test/regress/expected/stats.out    | 11 +--------
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/backend/utils/activity/pgstat_io.c b/src/backend/utils/activity/pgstat_io.c
index 38bae7b15d2..4f862c961c5 100644
--- a/src/backend/utils/activity/pgstat_io.c
+++ b/src/backend/utils/activity/pgstat_io.c
@@ -464,6 +464,35 @@ pgstat_tracks_io_object(BackendType bktype, IOObject io_object,
 		io_context == IOCONTEXT_BULKWRITE)
 		return false;
 
+	/*
+	 * The data checksums launcher only scans catalogs and emits WAL records
+	 * for checksum state changes.
+	 */
+	if (bktype == B_DATACHECKSUMSWORKER_LAUNCHER)
+	{
+		if (io_object == IOOBJECT_WAL ||
+			(io_object == IOOBJECT_RELATION &&
+			 io_context == IOCONTEXT_NORMAL))
+			return true;
+
+		return false;
+	}
+
+	/*
+	 * The worker also scans catalogs, then processes relations using a vacuum
+	 * access strategy.
+	 */
+	if (bktype == B_DATACHECKSUMSWORKER_WORKER)
+	{
+		if (io_object == IOOBJECT_WAL ||
+			(io_object == IOOBJECT_RELATION &&
+			 (io_context == IOCONTEXT_NORMAL ||
+			  io_context == IOCONTEXT_VACUUM)))
+			return true;
+
+		return false;
+	}
+
 	return true;
 }
 
@@ -507,6 +536,8 @@ pgstat_tracks_io_op(BackendType bktype, IOObject io_object,
 	if (io_object == IOOBJECT_WAL && io_op == IOOP_READ &&
 		(bktype == B_WAL_RECEIVER || bktype == B_BG_WRITER ||
 		 bktype == B_AUTOVAC_LAUNCHER || bktype == B_AUTOVAC_WORKER ||
+		 bktype == B_DATACHECKSUMSWORKER_LAUNCHER ||
+		 bktype == B_DATACHECKSUMSWORKER_WORKER ||
 		 bktype == B_WAL_WRITER))
 		return false;
 
diff --git a/src/test/regress/expected/stats.out b/src/test/regress/expected/stats.out
index 03cbc1cdef5..ccb716c7c10 100644
--- a/src/test/regress/expected/stats.out
+++ b/src/test/regress/expected/stats.out
@@ -51,20 +51,11 @@ client backend|relation|vacuum
 client backend|temp relation|normal
 client backend|wal|init
 client backend|wal|normal
-datachecksums launcher|relation|bulkread
-datachecksums launcher|relation|bulkwrite
-datachecksums launcher|relation|init
 datachecksums launcher|relation|normal
-datachecksums launcher|relation|vacuum
-datachecksums launcher|temp relation|normal
 datachecksums launcher|wal|init
 datachecksums launcher|wal|normal
-datachecksums worker|relation|bulkread
-datachecksums worker|relation|bulkwrite
-datachecksums worker|relation|init
 datachecksums worker|relation|normal
 datachecksums worker|relation|vacuum
-datachecksums worker|temp relation|normal
 datachecksums worker|wal|init
 datachecksums worker|wal|normal
 io worker|relation|bulkread
@@ -111,7 +102,7 @@ walsummarizer|wal|init
 walsummarizer|wal|normal
 walwriter|wal|init
 walwriter|wal|normal
-(95 rows)
+(86 rows)
 \a
 -- List of registered statistics kinds.
 SELECT id, name, fixed_amount,
-- 
2.55.0



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-07-10 03:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23 00:47 Re: Warning in geqo_main.c from clang 13 Thomas Munro <[email protected]>
2022-01-23 16:12 ` Tom Lane <[email protected]>
2026-07-10 03:13 Restrict data checksums entries in pg_stat_io Fujii Masao <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox