POC: make mxidoff 64 bits
Maxim Orlov <orlovmg@gmail.com>
From: Maxim Orlov <orlovmg@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-23T08:23:41Z
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
- 0001-WIP-mxidoff-to-64bit.patch (application/octet-stream) patch 0001
Hi! I've been trying to introduce 64-bit transaction identifications to Postgres for quite a while [0]. All this implies, of course, an enormous amount of change that will have to take place in various modules. Consider this, the patch set become too big to be committed “at once”. The obvious solutions was to try to split the patch set into smaller ones. But here it comes a new challenge, not every one of these parts, make Postgres better at the moment. Actually, even switching to a FullTransactionId in PGPROC will have disadvantage in increasing of WAL size [1]. In fact, I believe, we're dealing with the chicken and the egg problem here. Not able to commit full patch set since it is too big to handle and not able to commit parts of it, since they make sense all together and do not help improve Postgres at the moment. But it's not that bad. Since the commit 4ed8f0913bfdb5f, added in [3], we are capable to use 64 bits to indexing SLRUs. PROPOSAL Make multixact offsets 64 bit. RATIONALE It is not very difficult to overflow 32-bit mxidoff. Since, it is created for every unique combination of the transaction for each tuple, including XIDs and respective flags. And when a transaction is added to a specific multixact, it is rewritten with a new offset. In other words, it is possible to overflow the offsets of multixacts without overflowing the multixacts themselves and/or ordinary transactions. I believe, there was something about in the hackers mail lists, but I could not find links now. PFA, patch. Here is a WIP version. Upgrade machinery should be added later. As always, any opinions on a subject a very welcome! [0] https://www.postgresql.org/message-id/flat/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com [1] https://www.postgresql.org/message-id/flat/CACG%3DezY7msw%2Bjip%3Drtfvnfz051dRqz4s-diuO46v3rAoAE0T0g%40mail.gmail.com [3] https://postgr.es/m/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com -- Best regards, Maxim Orlov.