Re: POC: make mxidoff 64 bits
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Maxim Orlov <orlovmg@gmail.com>
Cc: wenhui qiu <qiuwenhuifx@gmail.com>,
Alexander Korotkov <aekorotkov@gmail.com>,
Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-14T17:48:39Z
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
- v26-0001-Move-pg_multixact-SLRU-page-format-definitions-t.patch (text/x-patch) patch v26-0001
- v26-0002-Use-64-bit-multixact-offsets.patch (text/x-patch) patch v26-0002
- v26-0003-TEST-bump-catversion.patch (text/x-patch) patch v26-0003
- v26-0004-Add-pg_upgrade-for-64-bit-multixact-offsets.patch (text/x-patch) patch v26-0004
- v26-0005-Remove-oldestOffset-oldestOffsetKnown-from-multi.patch (text/x-patch) patch v26-0005
- v26-0006-Reintroduce-MultiXactMemberFreezeThreshold.patch (text/x-patch) patch v26-0006
- v26-0007-TEST-Add-test-for-64-bit-mxoff-in-pg_resetwal.patch (text/x-patch) patch v26-0007
- v26-0008-TEST-Add-test-for-wraparound-of-next-new-multi-i.patch (text/x-patch) patch v26-0008
- v26-0009-TEST-add-consume_multixids-function.patch (text/x-patch) patch v26-0009
- v26-0010-TEST-Original-pg_upgrade-test-case.patch (text/x-patch) patch v26-0010
On 14/11/2025 17:40, Maxim Orlov wrote: > On Wed, 12 Nov 2025 at 16:00, Heikki Linnakangas <hlinnaka@iki.fi> >> I kept all the new test cases for now. We need to decide which >> ones are worth keeping, and polish and speed up the ones we decide >> to keep. Attached is a new patch version, with more work on the tests. The pg_upgrade patch (v26-0004-Add-pg_upgrade-for-64-bit-multixact-offsets.patch) now includes a test case. I'm proposing to commit that test along with these patches. It's a heavily-modified version of the test cases you wrote. I tested that test using old installations, all the way down to version 9.4. That required a bunch of changes to the test perl modules, to make them work with such old versions. Without any extra changes, the test works down to v11. Later patches in the patch set add more tests, labelled with the TEST: prefix. Those are the tests you posted earlier, with little to no modifications. I'm just carrying those around, so that I can easily run them now during development. But I don't think they're adding much value and I plan to leave them out of the final commit. > I think of two cases here. > A) Upgrade from "new cluster": > * created cluster with pre 32-bit overflow mxoff > * consume around of 2k of mxacts (1k before 32-bit overflow > and 1k after) > * run pg_upgrade > * check upgraded cluster is working > * check data invariant > B) Same as A), but for an "old cluster" with oldinstall env. Makes sense. The 007_multixact_conversion.pl test in the attached patches includes two test scenarios: "basic" and "wraparound" test. In the basic scenario there's no overflow or wraparound involved, but it can be run without an old installation, i.e. in a "new -> new upgrade". The "wraparound" scenario is the same, but the old cluster is reset with pg_resetwal so that the mxoff wraps around. The "wraparound" requires a pre-19 old installation, because the pg_resetwal logic requires pre-v19 layout. If we enhance the reset_mxoff() perl function in the test so that it also works with v19, we could run the "wraparound" scenario in new->new upgrades too. That would essentially the case A) that you listed above. I think it's already pretty good as it is though. I don't expect the point where we cross offset 2^32 in the new version to be very interesting now that we use 64-bit offsets everywhere. - Heikki