pgsql: Fix self-deadlock when replaying WAL generated by older minor ve

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix self-deadlock when replaying WAL generated by older minor ve
Date: 2026-05-27 09:06:36
Message-ID: E1wSADk-001JyR-0P@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)yandex-team(dot)ru>
Reported-by: Radim Marek <radim(at)boringsql(dot)com>
Discussion: https://www.postgresql.org/message-id/19490-9c59c6a583513b99@postgresql.org
Backpatch-through: 14-16

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2bb60eb4feab76ac5ea2ea6f15111b569ea48b62

Modified Files
--------------
src/backend/access/transam/multixact.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-05-27 12:33:57 pgsql: Remove incorrect OpenSSL feature guards
Previous Message Michael Paquier 2026-05-27 08:20:29 pgsql: Fix procLatch ownership race in ProcKill()