diff --git a/src/backend/postmaster/auxprocess.c b/src/backend/postmaster/auxprocess.c index ba8c9add67a..9803a0ee2a1 100644 --- a/src/backend/postmaster/auxprocess.c +++ b/src/backend/postmaster/auxprocess.c @@ -98,6 +98,14 @@ AuxiliaryProcessMainCommon(void) RESUME_INTERRUPTS(); + /* + * Initialize the process-local logical info WAL logging state. + * + * This must be called after ProcSignalInit() so that the process can + * participate in procsignal-based barriers that update this state. + */ + InitializeProcessXLogLogicalInfo(); + /* * Auxiliary processes don't run transactions, but they may need a * resource owner anyway to manage buffer pins acquired outside diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index ecf78b9a986..2460e550f96 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -662,9 +662,6 @@ BaseInit(void) /* Initialize lock manager's local structs */ InitLockManagerAccess(); - /* Initialize logical info WAL logging state */ - InitializeProcessXLogLogicalInfo(); - /* * Initialize replication slots after pgstat. The exit hook might need to * drop ephemeral slots, which in turn triggers stats reporting. @@ -833,6 +830,16 @@ InitPostgres(const char *in_dbname, Oid dboid, before_shmem_exit(ShutdownXLOG, 0); } + /* + * Initialize the process-local logical info WAL logging state. + * + * This must be called after ProcSignalInit() so that the process can + * participate in procsignal-based barriers that update this state. + * Furthermore, in !IsUnderPostmaster cases, this must occur after + * StartupXLOG() where the shared state is first established. + */ + InitializeProcessXLogLogicalInfo(); + /* * Initialize the relation cache and the system catalog caches. Note that * no catalog access happens here; we only set up the hashtable structure.