pg_resetwal: do not allow zero next multixact offset
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 27 Jul 2026 12:29:51 +0000 (15:29 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 27 Jul 2026 12:29:51 +0000 (15:29 +0300)
commit2cad308cb8f1c88f97f617ef9281f08c2f722277
tree3aba94161f2fb881fe9b111a55a7dd6160094ae7
parentb8d9cf512c1259f97f9896593cc1c8352c1118ac
pg_resetwal: do not allow zero next multixact offset

Offset 0 is the "invalid" marker in pg_multixact/offsets since offsets
went 64-bit and the allocator stopped skipping it. pg_resetwal could
still produce it via -O 0 or guessed control values, breaking the first
multixact created after the reset ("MultiXact n has invalid offset",
and vacuum of the affected table fails from then on). Reject -O 0 like
-m and -o already do, and guess 1 like initdb does.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://www.postgresql.org/message-id/CAN4CZFNoO6MUkg526TmA=mC_RjY2gp4VKCnvK6y12v3ppOkhJA@mail.gmail.com
Backpatch-through: 19
src/bin/pg_resetwal/pg_resetwal.c
src/bin/pg_resetwal/t/001_basic.pl