Fix assertion failure in parallel vacuum with minimal maintenance_work_mem setting.
authorMasahiko Sawada <msawada@postgresql.org>
Tue, 18 Mar 2025 23:37:02 +0000 (16:37 -0700)
committerMasahiko Sawada <msawada@postgresql.org>
Tue, 18 Mar 2025 23:37:02 +0000 (16:37 -0700)
commitf4290f20dd4d6f75e01fbb87304c3b8f31d1cfea
treed931cecf2880b3035ec2d504ab23da383380bcfd
parent6d3ea48ff1aea5fb1ccfed69424bf93a8643b4a4
Fix assertion failure in parallel vacuum with minimal maintenance_work_mem setting.

bbf668d66fbf lowered the minimum value of maintenance_work_mem to
64kB. However, in parallel vacuum cases, since the initial underlying
DSA size is 256kB, it attempts to perform a cycle of index vacuuming
and table vacuuming with an empty TID store, resulting in an assertion
failure.

This commit ensures that at least one page is processed before index
vacuuming and table vacuuming begins.

Backpatch to 17, where the minimum maintenance_work_mem value was
lowered.

Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAD21AoCEAmbkkXSKbj4dB+5pJDRL4ZHxrCiLBgES_g_g8mVi1Q@mail.gmail.com
Backpatch-through: 17
src/backend/access/heap/vacuumlazy.c
src/test/regress/expected/vacuum.out
src/test/regress/sql/vacuum.sql