*** a/src/backend/access/transam/xlog.c --- b/src/backend/access/transam/xlog.c *************** *** 7051,7060 **** LogCheckpointEnd(bool restartpoint) --- 7051,7064 ---- if (restartpoint) elog(LOG, "restartpoint complete: wrote %d buffers (%.1f%%); " + "%d transaction log file(s) added, %d removed, %d recycled; " "write=%ld.%03d s, sync=%ld.%03d s, total=%ld.%03d s; " "sync files=%d, longest=%ld.%03d s, average=%ld.%03d s", CheckpointStats.ckpt_bufs_written, (double) CheckpointStats.ckpt_bufs_written * 100 / NBuffers, + CheckpointStats.ckpt_segs_added, + CheckpointStats.ckpt_segs_removed, + CheckpointStats.ckpt_segs_recycled, write_secs, write_usecs / 1000, sync_secs, sync_usecs / 1000, total_secs, total_usecs / 1000, *************** *** 7681,7696 **** CreateRestartPoint(int flags) SpinLockRelease(&xlogctl->info_lck); LWLockRelease(WALInsertLock); ! if (log_checkpoints) ! { ! /* ! * Prepare to accumulate statistics. ! */ ! MemSet(&CheckpointStats, 0, sizeof(CheckpointStats)); ! CheckpointStats.ckpt_start_t = GetCurrentTimestamp(); LogCheckpointStart(flags, true); - } CheckPointGuts(lastCheckPoint.redo, flags); --- 7685,7702 ---- SpinLockRelease(&xlogctl->info_lck); LWLockRelease(WALInsertLock); ! /* ! * Prepare to accumulate statistics. ! * ! * Note: because it is possible for log_checkpoints to change while a ! * checkpoint proceeds, we always accumulate stats, even if ! * log_checkpoints is currently off. ! */ ! MemSet(&CheckpointStats, 0, sizeof(CheckpointStats)); ! CheckpointStats.ckpt_start_t = GetCurrentTimestamp(); + if (log_checkpoints) LogCheckpointStart(flags, true); CheckPointGuts(lastCheckPoint.redo, flags);