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 <[email protected]> Discussion: https://www.postgresql.org/message-id/can4czfm8bcazgz6s1vn5tmexyixe2fi8t2rwmwxsty5gd+h...@mail.gmail.com 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(-)
