DEV Community

Firat Celik
Firat Celik

Posted on

PostgreSQL 19 removes the MultiXact members wall. Reclamation still waits for template0.

Between May 10 and May 17, 2025, Metronome had four outages that each lasted over an hour. Their dashboards showed "less than 50% utilization" of the configured MultiXact ID threshold (autovacuum_multixact_freeze_max_age = 400 million) on an Aurora PostgreSQL 13.18 cluster of more than 30 TB. The limit they actually hit was MultiXact member space. In their words, "PostgreSQL does not expose metrics for member space consumption". (Metronome RCA)

Member space is addressed by a 32-bit offset in every release through 18. PostgreSQL 19 widens it to 64 bits (commit bd8d9c9bd: "This eliminates MultiXactOffset wraparound and the 2^32 limit on the total number of multixid members. Multixids are still limited to 2^31").

I rebuilt the failure from scratch on PostgreSQL 18.7 and on 19.0, released on 19 November 2026, with 19 RC2 as a cross-check. 19.0 reproduced every RC2 count I reran exactly. Short version:

  • The member-offset stop is gone in 19; the 2^31 MultiXact ID stop is not. In a fast-forwarded lab cluster 18.7 refused writes with multixact "members" limit exceeded; 19.0 went past 2^32 member offsets without an error (3/3 runs on each of 18.7, 19 RC2 and 19.0).
  • The burn rate did not change. Same members per lock and the same member bytes on disk; only the offsets area doubles (8 bytes per MultiXact instead of 4).
  • pg_upgrade to 19 keeps one member per MultiXact. How much that shrinks depends on your lock pattern; in my k=64 runs on 19.0 the whole pg_multixact directory went from 107 MB to 8.2 MB (13x), the same as on RC2.
  • Reclamation did not change, and it is cluster-wide. On a fresh cluster where template0 had never been frozen, none of VACUUM, VACUUM (FREEZE) or vacuumdb --all --freeze freed a byte of member space on 18.7, 19 RC2 or 19.0, because truncation waits for the oldest datminmxid of every database and vacuumdb skips template0. One idle session that had taken a row lock before the workload, in a different database, stopped reclamation for the whole cluster.

FACT marks what I measured, INTERPRETATION what I conclude from it, and "source" what I read in the PostgreSQL code. Everything was measured on one VM; see "Method and limits" and "Reproduce". Scripts and raw data: https://github.com/firfircelik/pg-multixact-lab

1. What a MultiXact member is

When one transaction locks a row, PostgreSQL writes that transaction's ID into the row's xmax. When a second transaction locks the same row while the first is still open (SELECT ... FOR SHARE, or the FOR KEY SHARE lock that a foreign-key check takes on the parent row), the row needs to point at a set of transactions. That set is a MultiXact. Its ID goes into xmax; the list of transaction IDs (the members) is appended to pg_multixact/members. MultiXacts are immutable: when a third locker arrives, PostgreSQL creates a new MultiXact and copies in every member that is still running (plus a committed updater, if there is one), then adds the newcomer (MultiXactIdExpand in multixact.c).

So while lockers overlap, every new locker pays for all the others again.

2. Growth: member cost is quadratic in overlap

Setup. One row; k sessions lock it one after another, all transactions stay open, then all commit. 1,000 such episodes per run, 6 values of k, two lock types (explicit FOR SHARE and an FK insert into a child table), 3 repetitions, 18.7 and 19 RC2, fresh cluster per run, shuffled order (72 runs), then the same 36 cells on 19.0 the day it shipped. 108 runs.

Theory. Locker 2 creates a MultiXact with 2 members, locker 3 one with 3, ..., locker k one with k. Per episode: k-1 MultiXacts and k(k+1)/2 - 1 members. Metronome's RCA gives the same example: "locking a row with 5 transactions creates 4 MultiXacts containing a total of 14 members".

Result (FACT). The MultiXact count matched the formula exactly in 108/108 runs. The member count matched exactly in 36/36 runs on 19 RC2 and 36/36 on 19.0 (every count and file size identical to RC2), and was formula + 1 in 36/36 runs on 18.7 (18.7 skips offset 0 on the first allocation).

overlapping lockers k MultiXacts / episode members / episode
2 1 2
8 7 35
32 31 527
64 63 2,079

members per episode vs k

Two more facts from the same runs:

  • Each member costs about 5.0 bytes in pg_multixact/members on both versions (2,079,000 members = 10,412,032 bytes = 10.4 MB). So 2^31 members, where 18.x starts aggressive anti-wraparound work, is about 10.7 GB (10 GiB), and the 2^32 stop is about 21.5 GB (20 GiB). The PostgreSQL 18 docs give the same scale: "about 10GB" and "about 20GB" (routine vacuuming, 18).
  • 19 (RC2 and 19.0) writes 8 bytes per MultiXact in pg_multixact/offsets instead of 4 (507,904 vs 253,952 bytes for 63,000 MultiXacts). Same member bytes; offsets double.

Source note: a backend reuses a cached MultiXact when it needs exactly the same member set again (mXactCacheGetBySet in multixact.c). Repeating the same few sessions in the same order is therefore cheap; damage needs fresh combinations, which is what concurrent short writers produce.

3. Growth under real concurrency: the pause inside your transaction

Setup. pgbench, 20 s per run, transaction = BEGIN; INSERT INTO child(parent_id) ...; [\sleep 5 ms]; COMMIT;. Factors: 8/32/64 clients, 1 or 16 hot parent rows, 0 or 5 ms pause inside the transaction, both versions, 3 reps. 72 runs, fsync off (see Method). One run (64 clients, 16 hot rows, 5 ms, 18.7, rep 1) followed a 286 s box suspension and ran at half speed; I voided it and reran it under the load rule (242,906 transactions, 4.53 members per transaction, in line with its siblings).

clients hot parents pause in txn members / committed txn (18.7, median, fsync off)
8 1 0 ms 3.0
64 1 0 ms 9.6
8 1 5 ms 7.7
64 1 5 ms 60.7
64 16 5 ms 4.6
64 16 0 ms 1.5

members per txn

Durable commits (control, FACT). I repeated the two 64-client, 1-hot-row cells with fsync, synchronous_commit and full_page_writes on (3 reps, both versions). With the 5 ms pause: 58.2 members per transaction on 18.7 and 58.3 on 19 RC2 (medians; fsync off: 60.7 and 60.6), at about 670k members/s. Without the pause: 20.8 and 21.4 (fsync off: 9.6 and 9.5), more than double. The pause cell is stable. The no-pause cell is not: commit latency itself keeps transactions open longer, which creates overlap (INTERPRETATION). Treat every number in this section as lab-relative.

FACT. With 64 clients and a 5 ms pause inside each transaction, each insert cost about 61 members. 19 RC2 was within run-to-run noise of 18.7 in every cell (one 19 RC2 run of the 64/1/5 ms cell was about 10% slower than its siblings; medians are reported). This grid, the cross-database grid (section 5) and the mitigations (section 7) ran on 18.7 and 19 RC2; nothing in multixact.c or ri_triggers.c changed between RC2 and 19.0.

INTERPRETATION. Each insert joins a MultiXact that already holds every other open inserter, so a pause inside the transaction (an HTTP call, a slow ORM flush, a sleep in a backfill) multiplies the cost. At the 741k members/s this box sustained with fsync off (about 670k with durable commits), an 18.x cluster would reach the 2^31 point in about 48 minutes and the 2^32 stop in about 1.6 hours if nothing reclaimed. Treat that as a ceiling for this box, not a production estimate; your rate is your transactions per second times members per transaction. The shape matches Metronome's description: a backfill with FK-heavy inserts on a few parent rows, running alongside other write-heavy jobs.

4. Reclamation: what actually frees member space

two floors

Two cluster-wide floors decide what can be released (source: multixact.c, vacuum.c):

  • Truncation floor. Member files are deleted only up to the minimum datminmxid over every database, template0 included.
  • Freezing floor. Vacuum cannot freeze MultiXacts newer than the oldest value in OldestMemberMXactId[] / OldestVisibleMXactId[]. A backend sets its entry when it first locks, updates or deletes a row in a transaction. The arrays have no database dimension.

Setup. k=32, 4,000 episodes in database app (124,000 MultiXacts, 2,108,000 members, 10,559,488 bytes = 10.6 MB of members). Then one of seven actions. 3 reps each on 18.7, 19 RC2 and 19.0, 63 runs. In the two "locker" arms a session in the same database app took a FOR SHARE lock before the workload and stayed idle in transaction.

action after the workload members after oldestMultiXid
nothing 10.6 MB 1
VACUUM parent 10.6 MB 1
VACUUM (FREEZE) parent 10.6 MB 1
vacuumdb --all --freeze 10.6 MB 1
same, with an idle-in-transaction locker 10.6 MB, also after the locker ended and vacuumdb ran again 1
autovacuum, autovacuum_multixact_freeze_max_age = 10000 0.86 MB (at most 1.65 MB in post-workload samples) 114,391 to 116,282
same, with an idle-in-transaction locker 10.6 MB for 120 s; 74 kB at the first poll (2 s) after it ended 1, then 124,001

Identical on 18.7, 19 RC2 and 19.0. Sizes are decimal (1 MB = 10^6 bytes, 1 kB = 10^3 bytes).

reclamation

FACT (from pg_database). After vacuumdb --all --freeze, postgres, template1 and app moved to datminmxid 124,001. template0 stayed at 1, and so did oldestMultiXid.

Source. vacuumdb skips databases with datallowconn = false (vacuumdb.c), which is template0. Autovacuum does not check datallowconn and processes template0 once its MultiXact age passes the effective autovacuum_multixact_freeze_max_age. You can also do it by hand: ALTER DATABASE template0 ALLOW_CONNECTIONS true, VACUUM (FREEZE) in it, then set it back.

FACT (autovacuum arm). With the lab's 10,000 freeze age, the members directory was at most 1.65 MB in the samples taken right after the workload; there were no samples during it. All 9 runs ended at my 180 s poll limit with the oldest MultiXact about 8,000 to 10,000 behind the next one. At the end template0 held the lowest datminmxid in 5 of 9 runs, postgres in 2 (both 19 RC2), and template1 and app in one 19.0 run each. Two 19.0 runs in this section (one autovacuum, one autovacuum + locker) had a 7-minute box suspension inside the poll window. I kept them, flagged them and reran both: 0.86 MB, and 10.6 MB while pinned with 74 kB at the first poll after release, the same as every other run. INTERPRETATION: with a low freeze age, autovacuum keeps member space small during the workload, but template0 or another database still sets the floor.

INTERPRETATION. A fresh lab cluster is the extreme case: template0 had never been frozen. On a long-lived cluster template0 has been frozen before, but the rule is the same. Member files are released when the laggiest database, often template0, is processed. Manual VACUUM FREEZE on your hot table is necessary, not sufficient.

The blocker (FACT). In the "autovacuum + locker" arm, one session that took a FOR SHARE lock before the workload and went idle in transaction kept oldestMultiXid at 1 for the full 120 s while autovacuum was running. Vacuums meanwhile logged WARNING: cutoff for freezing multixacts is far in the past. In the lab that warning fired immediately because I set the freeze age to 10,000. At default settings (400 million, lowered on 18.x only once members pass 2^31) it fires only once the oldest MultiXact is past the effective freeze age, so treat it as a late alarm, not an early one.

5. Cross-database pinning

Metronome's RCA states that "even a single long-running transaction holding an old MultiXact alive prevents the vacuum from reclaiming newer, unused member spaces". It does not say whether that transaction must be in the same database. I tested that.

Setup. Same workload in app (k=32, 4,000 episodes), autovacuum on with autovacuum_multixact_freeze_max_age = 10000 so reclamation normally keeps up. Before the workload starts, a second session in a different database (other) opens one of four things. Poll for 90 s, release, poll 90 s. 5 arms, 3 reps, both versions, 30 runs.

session in database other, opened before the workload members after 90 s oldestMultiXid after release
none (control) 0.86 MB about 115,000 n/a
SELECT ... FOR SHARE on one of its own rows, then idle in transaction 10.6 MB 1 74 kB at the first poll (3 s)
open transaction with an assigned xid (pg_current_xact_id()), no row lock 0.60 to 0.86 MB about 115,000 same
REPEATABLE READ snapshot after a read, no row lock 0.60 to 0.86 MB about 115,000 same
row lock, but idle_in_transaction_session_timeout = 10s 0.60 to 0.86 MB about 115,000 the timeout ended the session about 10 s in, during the workload

Identical on 18.7 and 19 RC2 (6/6 runs per arm).

cross-database

FACT. A session that took a FOR SHARE row lock in another database before the workload pinned MultiXact reclamation for the whole cluster. A plain open xid or a repeatable-read snapshot in another database did not pin it in my runs. With the 10 s timeout the session was killed during the workload and member space never accumulated.

Source-based extension. MultiXactIdSetOldestMember is called when a transaction first locks, updates or deletes a row (heapam.c), and records the next MultiXact ID at that moment in a shared array with no database dimension. By that code, any row lock, UPDATE or DELETE sets the same pin, and the pin covers every MultiXact created after the session took it. I only measured FOR SHARE.

INTERPRETATION. On a shared cluster, a forgotten psql session in a reporting database that ran SELECT ... FOR SHARE (or, by the source, FOR UPDATE) and stayed open can stall member reclamation for the busy OLTP database next to it. idle_in_transaction_session_timeout ended that in 6/6 runs. It does not cover prepared transactions, which keep their pin across restarts until COMMIT PREPARED or ROLLBACK PREPARED.

6. The danger zone: 18.7 vs 19 at the members stop

Reaching 2^32 real members takes about 21 GB and hours. I used a lab shortcut, so weigh the result accordingly:

  1. Pin the oldest MultiXact with an orphaned prepared transaction (prepared transactions survive restarts).
  2. Clean shutdown, then pg_resetwal -O moves the next member offset to 4,274,017,280, a segment boundary 20,897,664 members below the 18.7 stop point (2^32 - 52,352). The skipped range holds no data, but the server's limit arithmetic sees about 4.27 billion members in use.
  3. Run k=64 hot-row episodes on fresh rows until error, or until 24M members past 2^32.
18.7 (3 runs + 1 control) 19.0 (3 runs) 19 RC2 (3 runs)
outcome ERROR: multixact "members" limit exceeded after 20,897,624 members no error; next offset 4,319,755,280, past 2^32 same as 19.0
warnings before the error 31,729 occurrences of must be vacuumed before N more multixact members are used none of that kind none of that kind
vacuumdb --all --freeze while the pin is held (control) exit code 0, writes still failing n/a n/a
after ROLLBACK PREPARED + vacuumdb --all --freeze exit code 0, writes still failing, template0 datminmxid still 1 n/a n/a
writes back 12.2 to 15.3 s later in the 3 runs, 6.2 s in the control, once autovacuum had processed template0 n/a n/a

Details:

  • 18.7 stopped 40 members before the source-derived stop point (20,897,664): the next MultiXact needed 57 members and only 39 were left. The DETAIL line reads "This command would create a multixact with 57 members, but the remaining space is only enough for 39 members". After the first error the next offset still advanced by 35 members, so smaller MultiXacts kept being created. INTERPRETATION: small lockers keep working while the FK-heavy batch fails, which can make the incident look intermittent.
  • The warnings start 20 segments (1,047,040 members) before the stop and repeat for every new MultiXact. With k=64 that is about 1,047,040 / 2,079 x 63 = 31,728 MultiXacts, so the count depends on MultiXact size, not on time.
  • On 19, pg_get_multixact_stats() (new in 19, commit 97b101776) reported num_members = 4,319,755,279 and members_size of 21.6 GB, while the directory held 229 MB: only about 45.7 million members were really written, the rest is the fast-forward gap. On a real cluster that function is the metric Metronome said they did not have.

Fast-forward artifact. In the first runs on both versions the gap made MultiXact 1 look like it had about 4.27 billion members. Every VACUUM of the table holding it failed (18.7: invalid memory alloc request size; 19 RC2 and 19.0: MultiXact 1 has too many members), so those runs say nothing about vacuum behaviour under a pin. The control run fixed that: the gap sits behind MultiXact 2 on a table that is dropped before the test, all probes use fresh rows, and vacuumdb exit codes are recorded. The control logged 0 artifact errors and reproduced the same stop point, the same 31,729 warnings, and writes failing until template0 was processed.

7. Mitigations, measured

Setup. The worst cell from section 3 (64 clients, 1 hot parent, 5 ms pause inside the transaction) against four changes, one at a time. 20 s, 3 reps, both versions, 30 runs, fsync off. For a backfill of fixed size the useful metric is members per inserted row: total member cost = rows x members per row.

change members / row (18.7, median) rows / s members / s
baseline 59.7 12,076 721,155
cap the pool at 16 clients 14.9 2,979 44,489
no pause inside the transaction 10.6 71,299 750,496
10 child rows per transaction 6.1 118,457 727,444
spread over 16 hot parent keys 4.6 12,032 55,693

The baseline is a separate run set of the section 3 worst cell (59.7 here vs 60.7 there). 19 RC2 was within 1% of 18.7 on members per row in every arm; on members per second the largest gap was 2.05% (batch10: 727,444 vs 742,350).

mitigations

FACT. Every change cut member cost per row by 4x to 13x in this lab. Batching and removing the pause also made the job faster, so the member rate stayed at about 0.72 to 0.75 million per second. Spreading the hot key was the only change that cut both cost per row and rate without costing throughput. The no-pause arm is the one most sensitive to fsync (in section 3 its members per transaction doubled with durable commits), so its advantage here is likely overstated; read all of these as lab-relative.

INTERPRETATION. A backfill of 100 million rows costs about 6.0 billion members at baseline and 0.6 billion batched. If reclamation is pinned, the batched job still reaches the stop after a similar wall-clock time; it just gets about 10x more rows done first. For a backfill: batch children per parent, keep slow work out of the transaction, and rate-limit on members, not on rows. On 18.x, next_multi_offset growth per minute is the number to throttle on.

8. Upgrading 18 to 19: pg_upgrade compacts member space

19 stores offsets as 64-bit, so pg_upgrade rewrites pg_multixact (multixact_rewrite.c at REL_19_0). It reads "only one member from each multixid: the one updating one, or if there was no update, arbitrarily the first locking xid", because lock-only members do not matter once no transaction can be running across the upgrade.

Setup. 18.7 cluster, k=64 hot-row episodes (1,000 / 10,000 / 30,000), no vacuum. The upgrade rewrites every MultiXact in the old cluster's [oldest, next) range; in these runs only the last MultiXact of each episode is still referenced by a row. pg_upgrade --link to 19 RC2 (and, for 10,000 episodes, to 19.0), then re-lock up to 2,000 of the old rows on 19 with 4 sessions (all 1,000 in the smallest run) and compare row counts and sums. 3 reps. Controls: 18.7 to 18.7 with 1,000 episodes, 18.7 to 19 RC2 with an empty cluster, and one 10,000-episode run with amcheck.

episodes members before (18.7) members before members after (19) members after pg_upgrade --link time
0 (control) 0 8 kB 0 8 kB 1.58 to 1.62 s
1,000 2,079,000 10.4 MB 63,000 0.32 MB 1.62 to 1.66 s
10,000 20,790,000 104 MB 630,000 3.2 MB 1.67 to 1.77 s
30,000 62,370,000 312 MB 1,890,000 9.5 MB 1.95 to 2.01 s
10,000, to 19.0 20,790,000 104 MB 630,000 3.2 MB 1.86 to 1.97 s

Rows without a version label are 18.7 to 19 RC2. All reps gave identical member counts and sizes, and 19.0 matched RC2 byte for byte (members 3,162,112 bytes, offsets 5,046,272 bytes, 10,010 rows matched after re-locking). The 19.0 upgrades took about 0.2 s longer than RC2 at the same size; I ran no 19.0 empty-cluster baseline and these runs were not load-gated, so I do not attribute that to the version.

FACT.

  • After the upgrade the member count equals the MultiXact count. For this workload that is a 33x reduction in members, which is (k+2)/2 at k=64, the members per MultiXact of a staircase episode. Your ratio is your own members per MultiXact; in my concurrent runs (section 3) the per-cell median ranged from 2.1 to 60.7.
  • The offsets area doubles (8 bytes per MultiXact), so the whole pg_multixact directory shrank less than members alone: 319.9 MB to 24.6 MB (13x) at 30,000 episodes on RC2, and 106.6 MB to 8.2 MB (13x) at 10,000 episodes on both RC2 and 19.0.
  • 18.7 to 18.7 kept all 2,079,001 members (1.55 to 1.58 s): the compaction comes from the 18 to 19 rewrite, not from pg_upgrade as such.
  • The rewrite added 0.0 to 0.4 s over the empty-cluster baseline, growing with size.
  • Re-locking worked and row counts and sums matched (1,010 / 10,010 / 30,010 rows). In the 10,000-episode control, amcheck (verify_heapam and bt_index_check) reported no corruption before the upgrade, after it, and after all 10,010 rows were re-locked by 4 sessions.

INTERPRETATION. If you are on 18.x with a large pg_multixact/members, the upgrade resets member usage to one per MultiXact in the retained range. It is not an emergency tool (it needs downtime and a clean shutdown), but it is worth knowing when you plan the 19 migration.

9. What I would do on Monday

Three monitoring queries (not benchmarked; on managed platforms, check privileges first):

-- Which database holds the MultiXact floor (template0 included)
SELECT datname, datallowconn, datminmxid, mxid_age(datminmxid) AS mxid_age
FROM pg_database ORDER BY mxid_age(datminmxid) DESC;

-- PostgreSQL 19+: returns NULLs unless the role has pg_read_all_stats
SELECT num_mxids, num_members, members_size, oldest_multixact FROM pg_get_multixact_stats();

-- Pinning candidates, cluster-wide (pg_stat_activity cannot show who holds a row lock)
SELECT pid, datname, usename, state, now() - xact_start AS xact_age, backend_xid, left(query, 80)
FROM pg_stat_activity WHERE state LIKE 'idle in transaction%' ORDER BY xact_start;
SELECT gid, database, owner, prepared FROM pg_prepared_xacts ORDER BY prepared;
Enter fullscreen mode Exit fullscreen mode

The full set of seven queries, including per-table MultiXact age, member consumption since the last checkpoint and the members directory size, is in monitoring.sql.

On 18.x and earlier:

  1. Monitor member space, not just MultiXact age: the members directory size or next_multi_offset (about 5 bytes per member; 10.7 GB is the aggressive-vacuum point, 21.5 GB the stop), plus mxid_age(datminmxid) for every database including template0. [measured: sections 2, 4]
  2. Alert on long idle-in-transaction sessions and orphaned prepared transactions in every database, not just the busy one. Set idle_in_transaction_session_timeout; it does not end prepared transactions. [measured: section 5]
  3. Grep for cutoff for freezing multixacts is far in the past and must be vacuumed before ... multixact members. [source: vacuum.c, multixact.c; a late signal at default settings]
  4. Shape writes: no network calls or sleeps inside transactions that insert children of hot parents; batch children per transaction; spread hot keys. In my runs these cut members per row by 4x to 13x. [measured: section 7]
  5. Recovery order when it hits: end the pinning session or ROLLBACK PREPARED, then get every database including template0 past the old MultiXacts: wait for autovacuum, or temporarily ALTER DATABASE template0 ALLOW_CONNECTIONS true, run VACUUM (FREEZE) in it, and set it back. In my 18.7 runs autovacuum alone restored writes 6 to 15 s after the pin was released. [measured on 18.7: section 6; manual template0 path documented, not run]
symptom check action
multixact "members" limit exceeded (18.x) pg_prepared_xacts, idle-in-transaction sessions in every database end the pin, then freeze every database including template0
members directory keeps growing after VACUUM (FREEZE) mxid_age(datminmxid) per database the lowest database (often template0) needs processing
oldest_multi_xid does not move while autovacuum runs sessions open since before the growth started end them or set idle_in_transaction_session_timeout
high member rate during a backfill members per inserted row batch, remove pauses inside transactions, spread hot keys

On 19:

  • The member-offset stop is gone, so a member blow-up turns from "writes rejected" into "disk keeps growing at about 5 bytes per member". MultiXact IDs are still limited to 2^31, and that wraparound stop still exists. Points 1 to 4 still apply, and pg_get_multixact_stats() makes point 1 a single query.
  • Member pressure no longer launches anti-wraparound vacuum in 19 (commit 6aa2cefe11). It only makes vacuums that run anyway freeze more aggressively, scaled linearly from 2,000,000,000 members (MULTIXACT_MEMBER_LOW_THRESHOLD) to 4,000,000,000 (MULTIXACT_MEMBER_HIGH_THRESHOLD). With autovacuum disabled, nothing comes to clean up members for you.
  • 19 raises the MultiXact and XID wraparound warning distance to 100 million (commit 48f11bfa0).

Method and limits

  • Native builds of 18.7, 19 RC2 and 19.0 from the official tarballs, sha256 verified; gcc 14.2, Debian, Linux 6.12, 8 vCPU (the hypervisor reports "Intel(R) Xeon(R) Processor"), 15 GiB RAM, virtio disk of unknown media, single VM, no Docker.
  • fsync, synchronous_commit and full_page_writes off; autovacuum off unless the arm says otherwise. These settings do not affect deterministic counts (sections 2, 4, 5, 6 and 8 member and MultiXact counts, bytes per member). They can affect concurrency-dependent results (sections 3 and 7: members per transaction or row, and every rate), because commit latency changes how long lockers overlap. The fsync-on control in section 3 shows how much.
  • Counts come from pg_controldata after CHECKPOINT, file sizes in pg_multixact/, and pg_get_multixact_stats() on 19. Sizes are decimal (MB = 10^6 bytes) unless marked GiB.
  • Fresh cluster per run, shuffled run order with recorded seeds, 3 repetitions. The cross-database, mitigation and upgrade grids, and the control runs, were added after the original protocol; the upgrade and limit runs used a fixed order.
  • A load and suspension rule (load average below 2 before each run, void and rerun if wall-clock time and VM uptime disagree by more than 5%) was applied to the control runs only. Earlier runs had no such gate; I voided one run that followed a suspension (section 3).
  • The VM was reset once during the study. One limit-test attempt was cut off and discarded (raw file kept); the reclamation results were restored from a checksummed backup written before the reset.
  • The members-limit test fast-forwards the counter with pg_resetwal. The limit logic is real; the 4 billion members are not.
  • PostgreSQL 19.0 (tarball on ftp.postgresql.org on 19 Nov 2026, sha256 a89fd70e...e692d verified) was built and rerun the same afternoon for sections 2, 4, 6 and 8. Sections 3, 5 and 7 and the fsync-on control are from 19 RC2 (released 2026-11-12); between RC2 and 19.0 nothing changed in multixact.c, ri_triggers.c or the pg_upgrade MultiXact code. The 19.0 limit runs took 196 to 214 s for the same 22,000 episodes that took 176 to 179 s on RC2; that is wall time on a shared, ungated box, not a measured version difference.

Reproduce

Everything above comes from Python scripts that build fresh clusters on unix sockets, run one cell, and append one JSON line per run. The layout is:

scripts/      lab.py (cluster harness), grid_*.py, limit_ff.py, upgrade_rewrite.py, controls.py, analyze.py
results/      one .jsonl per grid, results/controls/ for the control runs
PROTOCOL.md   design, seeds, deviations, load rule, reset timeline
Enter fullscreen mode Exit fullscreen mode

To rerun on your own machine: clone the repo, build PostgreSQL 18.7 and 19.0 (and 19 RC2 for the comparison) into install/pg-<version> with scripts/build_pg.sh (it includes contrib/amcheck for the upgrade control), create a Python venv with psycopg and matplotlib, then run for example python scripts/grid_growth.py g1 18.7,19.0, the other grid_*.py scripts, and python scripts/analyze.py. PROTOCOL.md lists every grid, its seed and its arguments.

Scripts, raw JSONL, charts and PROTOCOL.md: https://github.com/firfircelik/pg-multixact-lab (MIT; snapshot used for this article: commit 45f8d9d). Build steps, tarball checksums and the per-grid commands are in its README.

Sources

All accessed 2026-11-19. Code links are pinned to tags REL_18_7 (f5c41f6681c9) and REL_19_0 (5c839a2a08b9).

Top comments (0)