| From: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
|---|---|
| To: | Maxim Orlov <orlovmg(at)gmail(dot)com> |
| Cc: | wenhui qiu <qiuwenhuifx(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: POC: make mxidoff 64 bits |
| Date: | 2025-11-14 17:48:39 |
| Message-ID: | 4a9dda70-0af7-41a4-9636-b168f2fc48ef@iki.fi |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 14/11/2025 17:40, Maxim Orlov wrote:
> On Wed, 12 Nov 2025 at 16:00, Heikki Linnakangas <hlinnaka(at)iki(dot)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
| Attachment | Content-Type | Size |
|---|---|---|
| v26-0001-Move-pg_multixact-SLRU-page-format-definitions-t.patch | text/x-patch | 10.3 KB |
| v26-0002-Use-64-bit-multixact-offsets.patch | text/x-patch | 37.9 KB |
| v26-0003-TEST-bump-catversion.patch | text/x-patch | 798 bytes |
| v26-0004-Add-pg_upgrade-for-64-bit-multixact-offsets.patch | text/x-patch | 42.9 KB |
| v26-0005-Remove-oldestOffset-oldestOffsetKnown-from-multi.patch | text/x-patch | 6.1 KB |
| v26-0006-Reintroduce-MultiXactMemberFreezeThreshold.patch | text/x-patch | 17.0 KB |
| v26-0007-TEST-Add-test-for-64-bit-mxoff-in-pg_resetwal.patch | text/x-patch | 4.9 KB |
| v26-0008-TEST-Add-test-for-wraparound-of-next-new-multi-i.patch | text/x-patch | 5.2 KB |
| v26-0009-TEST-add-consume_multixids-function.patch | text/x-patch | 5.0 KB |
| v26-0010-TEST-Original-pg_upgrade-test-case.patch | text/x-patch | 12.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Geier | 2025-11-14 18:04:57 | Re: tuple radix sort |
| Previous Message | David Geier | 2025-11-14 17:37:33 | Re: Use merge-based matching for MCVs in eqjoinsel |