aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-12-05 13:28:03 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2012-12-05 13:28:03 +0000
commit6aa2e49a878d28fbbbe8efe53c3a729a51a01090 (patch)
treef93606520a74935c0616da1ac1a414288f2cb025 /src/backend/access/transam/xlog.c
parent357cbaaeae5bc1f385828be97345e7ea24235f92 (diff)
downloadpostgresql-6aa2e49a878d28fbbbe8efe53c3a729a51a01090.tar.gz
postgresql-6aa2e49a878d28fbbbe8efe53c3a729a51a01090.zip
Must not reach consistency before XLOG_BACKUP_RECORD
When waiting for an XLOG_BACKUP_RECORD the minRecoveryPoint will be incorrect, so we must not declare recovery as consistent before we have seen the record. Major bug allowing recovery to end too early in some cases, allowing people to see inconsistent db. This patch to HEAD and 9.2, other fix required for 9.1 and 9.0 Simon Riggs and Andres Freund, bug report by Jeff Janes
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 5a97edf50fc..90069196f5c 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6332,9 +6332,12 @@ CheckRecoveryConsistency(void)
return;
/*
- * Have we passed our safe starting point?
+ * Have we passed our safe starting point? Note that minRecoveryPoint
+ * is known to be incorrectly set if ControlFile->backupEndRequired,
+ * until the XLOG_BACKUP_RECORD arrives to advise us of the correct
+ * minRecoveryPoint. All we prior to that is its not consistent yet.
*/
- if (!reachedConsistency &&
+ if (!reachedConsistency && !ControlFile->backupEndRequired &&
XLByteLE(minRecoveryPoint, EndRecPtr) &&
XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
{