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

Commit 3372f1a

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 fece13d commit 3372f1a

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
@@ -4815,6 +4815,11 @@ XLOGShmemInit(void)
48154815
{
48164816
/* both should be present or neither */
48174817
Assert(foundCFile && foundXLog);
4818+
4819+
/* Initialize local copy of WALInsertLocks and register the tranche */
4820+
WALInsertLocks = XLogCtl->Insert.WALInsertLocks;
4821+
LWLockRegisterTranche(XLogCtl->Insert.WALInsertLockTrancheId,
4822+
&XLogCtl->Insert.WALInsertLockTranche);
48184823
return;
48194824
}
48204825
memset(XLogCtl, 0, sizeof(XLogCtlData));
@@ -7595,11 +7600,6 @@ InitXLOGAccess(void)
75957600
ThisTimeLineID = XLogCtl->ThisTimeLineID;
75967601
Assert(ThisTimeLineID != 0 || IsBootstrapProcessingMode());
75977602

7598-
/* Initialize our copy of WALInsertLocks and register the tranche */
7599-
WALInsertLocks = XLogCtl->Insert.WALInsertLocks;
7600-
LWLockRegisterTranche(XLogCtl->Insert.WALInsertLockTrancheId,
7601-
&XLogCtl->Insert.WALInsertLockTranche);
7602-
76037603
/* Use GetRedoRecPtr to copy the RedoRecPtr safely */
76047604
(void) GetRedoRecPtr();
76057605
}

0 commit comments

Comments
 (0)