even if no recent WAL activity has occurred.
if (!ScanCLOGDirectory(cutoffPage, false))
return; /* nothing to remove */
- /* Perform a CHECKPOINT */
- CreateCheckPoint(false);
+ /* Perform a forced CHECKPOINT */
+ CreateCheckPoint(false, true);
/*
* Scan CLOG shared memory and remove any pages preceding the cutoff
* checkpoint to become prevCheckPoint...
*/
ControlFile->checkPoint = checkPointLoc;
- CreateCheckPoint(true);
+ CreateCheckPoint(true, true);
XLogCloseRelationCache();
}
CritSectionCount++;
CreateDummyCaches();
- CreateCheckPoint(true);
+ CreateCheckPoint(true, true);
ShutdownCLOG();
CritSectionCount--;
* Perform a checkpoint --- either during shutdown, or on-the-fly
*/
void
-CreateCheckPoint(bool shutdown)
+CreateCheckPoint(bool shutdown, bool force)
{
CheckPoint checkPoint;
XLogRecPtr recptr;
* match the end of the last checkpoint record, and its redo pointer
* must point to itself.
*/
- if (!shutdown)
+ if (!shutdown && !force)
{
XLogRecPtr curInsert;
if (IsUnderPostmaster)
InitDummyProcess(); /* needed to get LWLocks */
CreateDummyCaches();
- CreateCheckPoint(false);
+ CreateCheckPoint(false, false);
SetSavedRedoRecPtr(); /* pass redo ptr back to postmaster */
proc_exit(0); /* done */
Int_yyparse();
SetProcessingMode(NormalProcessing);
- CreateCheckPoint(true);
+ CreateCheckPoint(true, true);
SetProcessingMode(BootstrapProcessing);
/* clean up processing */
{
if (!superuser())
elog(ERROR, "permission denied");
- CreateCheckPoint(false);
+ CreateCheckPoint(false, false);
}
break;
extern void BootStrapXLOG(void);
extern void StartupXLOG(void);
extern void ShutdownXLOG(void);
-extern void CreateCheckPoint(bool shutdown);
+extern void CreateCheckPoint(bool shutdown, bool force);
extern void SetThisStartUpID(void);
extern void XLogPutNextOid(Oid nextOid);
extern void SetSavedRedoRecPtr(void);