aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-12-02 13:09:55 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2012-12-02 13:09:55 +0000
commit9f98704b8229f75fb6ec6e379c23cfea51a8f1e4 (patch)
tree135560636f130aa824812e6747130cd5a8211019 /src/backend/access/transam/xlog.c
parent53edb8dc0274e0d05eb0371ce84b7fb14cb5eb5a (diff)
downloadpostgresql-9f98704b8229f75fb6ec6e379c23cfea51a8f1e4.tar.gz
postgresql-9f98704b8229f75fb6ec6e379c23cfea51a8f1e4.zip
Clarify operation of online checkpoints.
Previous comments left, but were too obscure for such an important aspect of the system.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 8b19976c685..03e711a7f4c 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6847,6 +6847,18 @@ LogCheckpointEnd(bool restartpoint)
* Note: flags contains other bits, of interest here only for logging purposes.
* In particular note that this routine is synchronous and does not pay
* attention to CHECKPOINT_WAIT.
+ *
+ * If !shutdown then we are writing an online checkpoint. This is a very special
+ * kind of operation and WAL record because the checkpoint action occurs over
+ * a period of time yet logically occurs at just a single LSN. The logical
+ * position of the WAL record (redo ptr) is the same or earlier than the
+ * physical position. When we replay WAL we locate the checkpoint via its
+ * physical position then read the redo ptr and actually start replay at the
+ * earlier logical position. Note that we don't write *anything* to WAL at
+ * the logical position, so that location could be any other kind of WAL record.
+ * All of this mechanism allows us to continue working while we checkpoint.
+ * As a result, timing of actions is critical here and be careful to note that
+ * this function will likely take minutes to execute on a busy system.
*/
void
CreateCheckPoint(int flags)