summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorSimon Riggs2013-01-29 00:06:15 +0000
committerSimon Riggs2013-01-29 00:06:15 +0000
commitfd4ced5230162b50a5c9d33b4bf9cfb1231aa62e (patch)
tree2885c42307d960d313165dc1faa5cb34ff59eb5f /src/include
parentee22c55f5ad2e7b7032cd6c0243254d84d4496c7 (diff)
Fast promote mode skips checkpoint at end of recovery.
pg_ctl promote -m fast will skip the checkpoint at end of recovery so that we can achieve very fast failover when the apply delay is low. Write new WAL record XLOG_END_OF_RECOVERY to allow us to switch timeline correctly for downstream log readers. If we skip synchronous end of recovery checkpoint we request a normal spread checkpoint so that the window of re-recovery is low. Simon Riggs and Kyotaro Horiguchi, with input from Fujii Masao. Review by Heikki Linnakangas
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/xlog_internal.h6
-rw-r--r--src/include/catalog/pg_control.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index 43e1e60f9bf..ce9957e618f 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -217,6 +217,12 @@ typedef struct xl_restore_point
char rp_name[MAXFNAMELEN];
} xl_restore_point;
+/* End of recovery mark, when we don't do an END_OF_RECOVERY checkpoint */
+typedef struct xl_end_of_recovery
+{
+ TimestampTz end_time;
+ TimeLineID ThisTimeLineID;
+} xl_end_of_recovery;
/*
* XLogRecord is defined in xlog.h, but we avoid #including that to keep
diff --git a/src/include/catalog/pg_control.h b/src/include/catalog/pg_control.h
index e4a9abe7bc5..ec8cea7c86e 100644
--- a/src/include/catalog/pg_control.h
+++ b/src/include/catalog/pg_control.h
@@ -64,6 +64,7 @@ typedef struct CheckPoint
#define XLOG_PARAMETER_CHANGE 0x60
#define XLOG_RESTORE_POINT 0x70
#define XLOG_FPW_CHANGE 0x80
+#define XLOG_END_OF_RECOVERY 0x90
/*