pgsql: Never store 0 as the nextMXact
| От | Heikki Linnakangas |
|---|---|
| Тема | pgsql: Never store 0 as the nextMXact |
| Дата | |
| Msg-id | E1vTyrt-000J4v-2U@gemulon.postgresql.org обсуждение исходный текст |
| Список | pgsql-committers |
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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/87a350e1f284bb99591f9185c0be0ae28899f38a Modified Files -------------- src/backend/access/transam/multixact.c | 79 ++++++++-------------------------- src/bin/pg_resetwal/pg_resetwal.c | 2 + src/bin/pg_resetwal/t/001_basic.pl | 15 ++----- 3 files changed, 24 insertions(+), 72 deletions(-)
В списке pgsql-committers по дате отправления: