Re: 17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"
Andrey Borodin <x4mmm@yandex-team.ru>
From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Kirill Reshke <reshkekirill@gmail.com>, Sebastian Webber <sebastian@swebber.me>, pgsql-bugs@lists.postgresql.org, Andrey Borodin <amborodin@acm.org>, Álvaro Herrera <alvherre@kurilemu.de>, Dmitry Yurichev <dsy.075@yandex.ru>, Chao Li <li.evan.chao@gmail.com>, Ivan Bykov <i.bykov@modernsys.ru>
Date: 2026-02-18T08:58:03Z
Lists: pgsql-bugs
Attachments
- 0001-Test-Multixact-truncation-near-page-boundary-replay-.patch (application/octet-stream) patch 0001
> On 16 Feb 2026, at 21:01, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>
> Andrey if you can verify with your TAP test, too, that'd be great.
Here's a hand-wavy test on top of REL_17_STABLE. It modifies binaries to simulate old WAL write behavior.
I tried to hack it with -DDEMO_SIMULATE_OLD_MULTIXACT_BEHAVIOR, but gave up and just hardcoded.
We are not going to commit it, aren't we?
If we comment out this line (patch does it)
pg_atomic_write_u64(&MultiXactOffsetCtl->shared->latest_page_number,
pageno);
the test will pass.
Either way it will hang indefinitely because
2026-02-18 13:44:12.238 +05 [52360] LOG: started streaming WAL from primary at 0/3000000 on timeline 1
2026-02-18 13:44:12.250 +05 [52359] FATAL: could not access status of transaction 4096
2026-02-18 13:44:12.250 +05 [52359] DETAIL: Could not read from file "pg_multixact/offsets/0000" at offset 16384: read too few bytes.
2026-02-18 13:44:12.250 +05 [52359] CONTEXT: WAL redo at 0/30245E0 for MultiXact/CREATE_ID: 4095 offset 8189 nmembers 2: 4835 (sh) 4835 (upd)
Most hand-wavy part is test_multixact_write_truncate_wal(): truncation is synthetic.
FWIW, a lot of calculations and commenting done by LLM. Let me know if such a verbosity is not good for readability.
Best regards, Andrey Borodin.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Don't reset 'latest_page_number' when replaying multixid truncation
- 516310ed4dba 19 (unreleased) landed
- 547a8aaa7d4f 14.22 landed
- 899de38d8f3b 15.17 landed
- 23064542f8bd 16.13 landed
- 4a36c89f1657 17.9 landed
- 817f74600d0d 18.3 landed
-
Set next multixid's offset when creating a new multixid
- 8ba61bc06386 17.8 cited
-
Rework the way multixact truncations work.
- 4f627f897367 9.6.0 cited