aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index ed16f279b1f..f436471b276 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6298,6 +6298,14 @@ CreateCheckPoint(int flags)
CheckpointStats.ckpt_start_t = GetCurrentTimestamp();
/*
+ * Let smgr prepare for checkpoint; this has to happen outside the
+ * critical section and before we determine the REDO pointer. Note that
+ * smgr must not do anything that'd have to be undone if we decide no
+ * checkpoint is needed.
+ */
+ SyncPreCheckpoint();
+
+ /*
* Use a critical section to force system panic if we have trouble.
*/
START_CRIT_SECTION();
@@ -6310,13 +6318,6 @@ CreateCheckPoint(int flags)
LWLockRelease(ControlFileLock);
}
- /*
- * Let smgr prepare for checkpoint; this has to happen before we determine
- * the REDO pointer. Note that smgr must not do anything that'd have to
- * be undone if we decide no checkpoint is needed.
- */
- SyncPreCheckpoint();
-
/* Begin filling in the checkpoint WAL record */
MemSet(&checkPoint, 0, sizeof(checkPoint));
checkPoint.time = (pg_time_t) time(NULL);