Fix race condition in XLogLogicalInfo and ProcSignal initialization.
Masahiko Sawada <msawada@postgresql.org>
Author:
Masahiko Sawada <msawada@postgresql.org>
Date: 2026-05-07T17:09:42Z
Releases:
19 (unreleased)
Fix race condition in XLogLogicalInfo and ProcSignal initialization. Previously, InitializeProcessXLogLogicalInfo() was called before ProcSignalInit(). This created a window where a process could miss a signal barrier if it was issued between these two calls. As a result, the process could fail to update its local XLogLogicalInfo cache, leading to an inconsistent logical decoding state. This commit fixes this by moving InitializeProcessXLogLogicalInfo() after ProcSignalInit(). This ensures that the process is registered to participate in signal barriers before its state is initialized, preventing it from missing any state changes propagated during the startup sequence. Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com> Discussion: https://postgr.es/m/CAD21AoBzdeSyLSSPM5E6ysN1r8qzp8u_BRmnLvuAp_S8QxS_fQ@mail.gmail.com Discussion: https://postgr.es/m/CAD21AoBj+zKvgw_Q8gjr4YbKccW_uMe3OFQ5+KT246FHUuNXSQ@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/postmaster/auxprocess.c | modified | +8 −0 |
| src/backend/utils/init/postinit.c | modified | +10 −3 |
Discussion
- Startup process deadlock: WaitForProcSignalBarriers vs aux process 13 messages · 2026-04-22 → 2026-05-27
- Fix race condition in XLogLogicalInfo and ProcSignal initialization. 7 messages · 2026-04-28 → 2026-05-07