Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 250c26b

Browse files
committed
Fix checkpointer crash in EXEC_BACKEND builds.
Nothing in the checkpointer calls InitXLOGAccess(), so WALInsertLocks never got initialized there. Without EXEC_BACKEND, it works anyway because the correct value is inherited from the postmaster, but with EXEC_BACKEND we've got a problem. The problem appears to have been introduced by commit 68a2e52. To fix, move the relevant initialization steps from InitXLOGAccess() to XLOGShmemInit(), making this more parallel to what we do elsewhere. Amit Kapila
1 parent 93a028f commit 250c26b

File tree

1 file changed

+5
-5
lines changed
  • src/backend/access/transam

1 file changed

+5
-5
lines changed

src/backend/access/transam/xlog.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -4841,6 +4841,11 @@ XLOGShmemInit(void)
48414841
{
48424842
/* both should be present or neither */
48434843
Assert(foundCFile && foundXLog);
4844+
4845+
/* Initialize local copy of WALInsertLocks and register the tranche */
4846+
WALInsertLocks = XLogCtl->Insert.WALInsertLocks;
4847+
LWLockRegisterTranche(XLogCtl->Insert.WALInsertLockTrancheId,
4848+
&XLogCtl->Insert.WALInsertLockTranche);
48444849
return;
48454850
}
48464851
memset(XLogCtl, 0, sizeof(XLogCtlData));
@@ -7619,11 +7624,6 @@ InitXLOGAccess(void)
76197624
ThisTimeLineID = XLogCtl->ThisTimeLineID;
76207625
Assert(ThisTimeLineID != 0 || IsBootstrapProcessingMode());
76217626

7622-
/* Initialize our copy of WALInsertLocks and register the tranche */
7623-
WALInsertLocks = XLogCtl->Insert.WALInsertLocks;
7624-
LWLockRegisterTranche(XLogCtl->Insert.WALInsertLockTrancheId,
7625-
&XLogCtl->Insert.WALInsertLockTranche);
7626-
76277627
/* Use GetRedoRecPtr to copy the RedoRecPtr safely */
76287628
(void) GetRedoRecPtr();
76297629
}

0 commit comments

Comments
 (0)