pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_upgrade: Fix last multixid ending at offset wraparound
2+ messages / 1 participants
[nested] [flat]

* pgsql: pg_upgrade: Fix last multixid ending at offset wraparound
@ 2026-10-16 14:38 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2026-10-16 14:38 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_upgrade: Fix last multixid ending at offset wraparound

On v18 and below, if the newest multixid's members end exactly at the
the 32-bit offset wraparound point, the next offset in the control
file is 0.  GetOldMultiXactIdSingleMember() treated that as an invalid
entry and dropped the multixid's members, so after upgrade accessing
the tuple failed with "MultiXact N has invalid offset".

To fix, only check for zero offset when it was read from the next
multixid's slot, like GetMultiXactIdMembers() did in v18.  This is
unlikely to happen in practice, but better to get it right.

The bug came with commit bd8d9c9bdfa in v19.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://www.postgresql.org/message-id/CAN4CZFM8BCazGz6s1Vn5tMEXYiXE2fi8T2rwmwXSty5gD+h9rA@mail.gmail...
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2323f03a1789bc52bee980c56b8057470458701a

Modified Files
--------------
src/bin/pg_upgrade/multixact_read_v18.c          | 17 +++++----
src/bin/pg_upgrade/t/007_multixact_conversion.pl | 44 ++++++++++++++++++++++++
2 files changed, 55 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: pg_upgrade: Fix last multixid ending at offset wraparound
@ 2026-10-16 14:38 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2026-10-16 14:38 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_upgrade: Fix last multixid ending at offset wraparound

On v18 and below, if the newest multixid's members end exactly at the
the 32-bit offset wraparound point, the next offset in the control
file is 0.  GetOldMultiXactIdSingleMember() treated that as an invalid
entry and dropped the multixid's members, so after upgrade accessing
the tuple failed with "MultiXact N has invalid offset".

To fix, only check for zero offset when it was read from the next
multixid's slot, like GetMultiXactIdMembers() did in v18.  This is
unlikely to happen in practice, but better to get it right.

The bug came with commit bd8d9c9bdfa in v19.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://www.postgresql.org/message-id/CAN4CZFM8BCazGz6s1Vn5tMEXYiXE2fi8T2rwmwXSty5gD+h9rA@mail.gmail...
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bf4f086c6fdd945b176a7179da1d31bb43269fbc

Modified Files
--------------
src/bin/pg_upgrade/multixact_read_v18.c          | 17 +++++----
src/bin/pg_upgrade/t/007_multixact_conversion.pl | 44 ++++++++++++++++++++++++
2 files changed, 55 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-10-16 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 14:38 pgsql: pg_upgrade: Fix last multixid ending at offset wraparound Heikki Linnakangas <heikki.linnakangas@iki.fi>
2026-10-16 14:38 pgsql: pg_upgrade: Fix last multixid ending at offset wraparound Heikki Linnakangas <heikki.linnakangas@iki.fi>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox