]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix self-deadlock when replaying WAL generated by older minor version
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 27 May 2026 08:49:50 +0000 (11:49 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 27 May 2026 08:50:31 +0000 (11:50 +0300)
commit2dfe75f9844f29f8b2621ed68ee12e577f05e7f3
treedfb1b48785d4fb527313e2b45ecbfdc8e6f35ae2
parente786fb5aa7f29abaae6e912a5a417843f44c0899
Fix self-deadlock when replaying WAL generated by older minor version

Commit 77dff5d937 introduced a SimpleLruWriteAll() call when replaying
multixact WAL records generated by older minor versions. However,
SimpleLruWriteAll() acquires the SLRU lock and on v16 and below, it's
called while already holding the lock, leading to self-deadlock.
Version 17 and 18 did not have that problem, because in those versions
the lock is acquired later in the function.

To fix, acquire MultiXactOffsetSLRULock later in RecordNewMultiXact(),
at the same place where it's acquired on version 17 and 18.

Author: Andrey Borodin <x4mmm@yandex-team.ru>
Reported-by: Radim Marek <radim@boringsql.com>
Discussion: https://www.postgresql.org/message-id/19490-9c59c6a583513b99@postgresql.org
Backpatch-through: 14-16
src/backend/access/transam/multixact.c