PostgreSQL standby WAL replay deadlocks in RecordNewMultiXact when the primary is on an older minor version

A streaming replica on PostgreSQL 14.23 stops replaying WAL coming from a primary on 14.17. The startup process self-deadlocks acquiring MultiXactOffsetSLRULock inside RecordNewMultiXactSimpleLruWriteAll. The bug is in the back-patched compatibility code introduced by commit 789d65364c (“Set next multixid’s offset when creating a new multixid”) and partially addressed by c60a58204435 in 14.22. This post documents the symptoms, diagnosis, and a workaround.

Read More