]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
pg_stat_io: Don't flag extends by autovacuum launcher
authorMelanie Plageman <melanieplageman@gmail.com>
Wed, 24 Jun 2026 18:51:31 +0000 (14:51 -0400)
committerMelanie Plageman <melanieplageman@gmail.com>
Wed, 24 Jun 2026 18:51:31 +0000 (14:51 -0400)
pg_stat_io asserts on unexpected combinations of backend type and IOOp.
These combinations were meant to help detect bugs given our current
understanding of the system -- not serve as a set of rules for what is
allowed. The autovacuum launcher scans catalog tables and may on-access
prune them. This previously wouldn't have led to any extends of the
relation, but now that on-access pruning may pin a page of the
visibility map (4f7ecca84ddacbce27), scanning tables may lead to
extending the visibility map. This would cause the launcher to trip an
assert. Since there is no reason to forbid the launcher from doing
extends, remove it from the list of backend type pgstat_tracks_io_op
flags for doing IOOP_EXTEND.

Read-only catalog scans still don't let pruning set the VM; doing so
needs table AM API changes and is left for the future.

Reported-by: Ewan Young <kdbase.hack@gmail.com>
Discussion: https://postgr.es/m/CAON2xHNOyaN9MCZohhD_NL6as3QVhGA0SOn2Hyi9w6+Y-_1bFA@mail.gmail.com

src/backend/utils/activity/pgstat_io.c

index 13a5d8e644000b1b07866ca50ce8d6c659b2e28a..38bae7b15d2ed89115f2c0c86630e537073cff80 100644 (file)
@@ -497,8 +497,8 @@ pgstat_tracks_io_op(BackendType bktype, IOObject io_object,
                 (io_op == IOOP_EVICT || io_op == IOOP_HIT)))
                return false;
 
-       if ((bktype == B_AUTOVAC_LAUNCHER || bktype == B_BG_WRITER ||
-                bktype == B_CHECKPOINTER) && io_op == IOOP_EXTEND)
+       if ((bktype == B_BG_WRITER || bktype == B_CHECKPOINTER) &&
+               io_op == IOOP_EXTEND)
                return false;
 
        /*