Commit 7351e182 authored by Tom Lane's avatar Tom Lane

Add more chattiness in server shutdown.

Early returns from the buildfarm show that there's a bit of a gap in the
logging I added in 3971f648: the portion of CreateCheckPoint()
after CheckPointGuts() can take a fair amount of time.  Add a few more
log messages in that section of code.  This too shall be reverted later.
parent 3971f648
......@@ -8436,6 +8436,9 @@ CreateCheckPoint(int flags)
XLogFlush(recptr);
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"checkpoint WAL record flushed at %s", current_time_as_str());
/*
* We mustn't write any new WAL after a shutdown checkpoint, or it will be
* overwritten at next startup. No-one should even try, this just allows
......@@ -8491,6 +8494,9 @@ CreateCheckPoint(int flags)
UpdateControlFile();
LWLockRelease(ControlFileLock);
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"pg_control updated at %s", current_time_as_str());
/* Update shared-memory copy of checkpoint XID/epoch */
SpinLockAcquire(&XLogCtl->info_lck);
XLogCtl->ckptXidEpoch = checkPoint.nextXidEpoch;
......@@ -8508,6 +8514,9 @@ CreateCheckPoint(int flags)
*/
smgrpostckpt();
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"smgrpostckpt() done at %s", current_time_as_str());
/*
* Delete old log files (those no longer needed even for previous
* checkpoint or the standbys in XLOG streaming).
......@@ -8523,6 +8532,9 @@ CreateCheckPoint(int flags)
KeepLogSeg(recptr, &_logSegNo);
_logSegNo--;
RemoveOldXlogFiles(_logSegNo, PriorRedoPtr, recptr);
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"RemoveOldXlogFiles() done at %s", current_time_as_str());
}
/*
......@@ -8540,7 +8552,11 @@ CreateCheckPoint(int flags)
* StartupSUBTRANS hasn't been called yet.
*/
if (!RecoveryInProgress())
{
TruncateSUBTRANS(GetOldestXmin(NULL, false));
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"TruncateSUBTRANS() done at %s", current_time_as_str());
}
/* Real work is done, but log and update stats before releasing lock. */
LogCheckpointEnd(false);
......
......@@ -1314,6 +1314,11 @@ mdpostckpt(void)
if (entry->cycle_ctr == mdckpt_cycle_ctr)
break;
if ((list_length(pendingUnlinks) % 1024) == 0)
elog(IsPostmasterEnvironment ? LOG : NOTICE,
"in mdpostckpt, %d unlinks remain to do at %s",
list_length(pendingUnlinks), current_time_as_str());
/* Unlink the file */
path = relpathperm(entry->rnode, MAIN_FORKNUM);
if (unlink(path) < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment