Re: POC: make mxidoff 64 bits
Maxim Orlov <orlovmg@gmail.com>
From: Maxim Orlov <orlovmg@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: wenhui qiu <qiuwenhuifx@gmail.com>,
Alexander Korotkov <aekorotkov@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-06T15:50:23Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix partial read handling in pg_upgrade's multixact conversion
- ac94ce8194e5 19 (unreleased) landed
-
Increase timeout in multixid_conversion upgrade test
- bd43940b02b2 19 (unreleased) landed
-
Improve sanity checks on multixid members length
- ecb553ae8211 19 (unreleased) landed
-
Clarify comment on multixid offset wraparound check
- 170361d7b869 14.21 landed
- b0b52b7123ae 15.16 landed
- 7d42e2367c6b 16.12 landed
- cd1a887fe9bf 17.8 landed
- 3fbad030a24d 18.2 landed
- 366dcdaf5779 19 (unreleased) landed
-
Never store 0 as the nextMXact
- 87a350e1f284 19 (unreleased) landed
-
Add runtime checks for bogus multixact offsets
- d4b7bde4183b 19 (unreleased) landed
-
Widen MultiXactOffset to 64 bits
- bd8d9c9bdfa0 19 (unreleased) landed
-
Move pg_multixact SLRU page format definitions to a separate header
- bb3b1c4f6462 19 (unreleased) landed
-
Convert confusing macros in multixact.c to static inline functions
- 0099b9408e8c 17.0 landed
-
Index SLRUs by 64-bit integers rather than by 32-bit integers
- 4ed8f0913bfd 17.0 cited
-
Cope with possible failure of the oldest MultiXact to exist.
- b6a3444fa635 9.4.4 cited
Attachments
- v23-0006-TEST-bump-catversion.patch.txt (text/plain)
- v23-0001-Use-64-bit-multixact-offsets.patch (application/octet-stream) patch v23-0001
- v23-0005-Handle-wraparound-of-next-new-multi-in-pg_upgrad.patch (application/octet-stream) patch v23-0005
- v23-0002-Add-pg_upgarde-for-64-bit-multixact-offsets.patch (application/octet-stream) patch v23-0002
- v23-0003-Remove-oldestOffset-oldestOffsetKnown-from-multi.patch (application/octet-stream) patch v23-0003
- v23-0004-Add-test-for-64-bit-mxoff-in-pg_resetwal.patch (application/octet-stream) patch v23-0004
- v23-0007-TEST-Add-test-for-64-bit-mxoff-in-pg_upgrade.patch.txt (text/plain)
On Wed, 5 Nov 2025 at 18:38, Heikki Linnakangas <hlinnaka@iki.fi> wrote: > > Remaining issues: > > - There's one more refactoring I'd like to do before merging this: Move > the definitions that are now duplicated between > src/bin/pg_upgrade/multixact_new.c and > src/backend/access/transam/multixact.c into a new header file, > multixact_internal.h. One complication with that is that it needs > SLRU_PAGES_PER_SEGMENT ... Done. Also put SLRU_PAGES_PER_SEGMENT in pg_config_manual.h In my opinion, this constant perfectly aligns the description in the file header. In any case, feel free to move it anywhere you like. - Have you done any performance testing of the pg_upgrade code? How long > does the conversion take if you have e.g. 1 billion multixids? > Unfortunately, not yet. I'd like to do this soon. Currently, the bulk of the testing time is spent generating multi-transactions. - Is the !oldestOffsetKnown case in the code still reachable? I left one > FIXME comment about that. Needs a comment update at least. > Yep, no longer needed. A separate commit has been added. - The new pg_upgrade test fails on my system with this error in the log: Unfortunately, I don't face this issue. I think this can be fixed by providing an explicit path to the utility. - The new pg_ugprade test is very slow. I would love to include that > test permanently in the test suite, but it's too slow for that currently. Yes, unfortunately. The majority of the time is spent on tests that produce multiple segments. These are cases numbered 4-th and higher. If we remove these, the testing should be relatively fast. I also add commit "Handle wraparound of next new multi in pg_upgrade". Per BUG #18863 and BUG #18865 The issue is that pg_upgrade neglects to handle the wraparound of mxact/mxoff. We'll obviously resolve the issue with mxoff wraparound by moving to 64-bits. And the mxact bug can be easily solved with two lines of code. Or five if you count indents and comments. Test also provided. This commit is totally optional. If you think it deserves to be treated as a different issue, feel free to discard it. -- Best regards, Maxim Orlov.