postgresql/src/bin/pg_resetwal
Heikki Linnakangas 87a350e1f2 Never store 0 as the nextMXact
Before this commit, when multixid wraparound happens,
MultiXactState->nextMXact goes to 0, which is invalid. All the readers
need to deal with that possibility and skip over the 0. That's
error-prone and we've missed it a few times in the past. This commit
changes the responsibility so that all the writers of
MultiXactState->nextMXact skip over the zero already, and readers can
trust that it's never 0.

We were already doing that for MultiXactState->oldestMultiXactId; none
of its writers would set it to 0. ReadMultiXactIdRange() was
nevertheless checking for that possibility. For clarity, remove that
check.

Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Maxim Orlov <orlovmg@gmail.com>
Discussion: https://www.postgresql.org/message-id/3624730d-6dae-42bf-9458-76c4c965fb27@iki.fi
2025-12-12 10:47:34 +02:00
..
po Translation updates 2025-05-05 12:04:49 +02:00
t Never store 0 as the nextMXact 2025-12-12 10:47:34 +02:00
.gitignore pg_resetwal: Add simple test suite 2018-03-23 08:42:25 -04:00
Makefile Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls.mk Add missing source files to nls.mk 2024-06-13 10:17:36 +02:00
pg_resetwal.c Never store 0 as the nextMXact 2025-12-12 10:47:34 +02:00