static void exitArchiveRecovery(TimeLineID endTLI,
uint32 endLogId, uint32 endLogSeg);
static bool recoveryStopsHere(XLogRecord *record, bool *includeThis);
+static void LocalSetXLogInsertAllowed(void);
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
static bool XLogCheckBuffer(XLogRecData *rdata, bool doPageWrites,
{
int rmid;
+ /*
+ * Resource managers might need to write WAL records, eg, to record
+ * index cleanup actions. So temporarily enable XLogInsertAllowed in
+ * this process only.
+ */
+ LocalSetXLogInsertAllowed();
+
/*
* Allow resource managers to do any required cleanup.
*/
RmgrTable[rmid].rm_cleanup();
}
+ /* Disallow XLogInsert again */
+ LocalXLogInsertAllowed = -1;
+
/*
* Check to see if the XLOG sequence contained any unresolved
* references to uninitialized pages.