]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix stale comment in parallel_vacuum_main().
authorMasahiko Sawada <msawada@postgresql.org>
Wed, 29 Jul 2026 16:52:10 +0000 (09:52 -0700)
committerMasahiko Sawada <msawada@postgresql.org>
Wed, 29 Jul 2026 16:52:10 +0000 (09:52 -0700)
commit4ee0ccfd55f973160a2ab013bc96488715221270
tree1de5404affde3c47647a20d640071f0b5efd2900
parentbef46aed394917be95f6572f64af90e24b1c0652
Fix stale comment in parallel_vacuum_main().

The comment claimed that a parallel vacuum worker has only the
PROC_IN_VACUUM flag because parallel vacuum is not supported for
autovacuum, but commit 1ff3180ca01 allowed autovacuum to use parallel
vacuum workers.

The assertion itself still holds: the leader, whether a backend
running VACUUM or an autovacuum worker, sets PROC_IN_VACUUM before
taking its snapshot, and a parallel worker inherits the flag when
importing the leader's snapshot. The leader's other flags don't reach
the worker, since the snapshot import copies only the PROC_XMIN_FLAGS
bits and PROC_IS_AUTOVACUUM is never set on parallel workers, which
run as regular background workers. Reword the comment to explain that.

Oversight in commit 1ff3180ca01.

Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CALj2ACVwQ4WABqq8Lnf+VZEJ45jcTFhyFLFr_ctfS4=QLL-r5w@mail.gmail.com
Backpatch-through: 19
src/backend/commands/vacuumparallel.c