Skip to content

Commit d56b629

Browse files
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
1 parent 0811f4f commit d56b629

File tree

1 file changed

+5
-2
lines changed
  • src/backend/access/transam

1 file changed

+5
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7155,9 +7155,12 @@ CheckRecoveryConsistency(void)
71557155
return;
71567156

71577157
/*
7158-
* Have we passed our safe starting point?
7158+
* Have we passed our safe starting point? Note that minRecoveryPoint
7159+
* is known to be incorrectly set if ControlFile->backupEndRequired,
7160+
* until the XLOG_BACKUP_RECORD arrives to advise us of the correct
7161+
* minRecoveryPoint. All we prior to that is its not consistent yet.
71597162
*/
7160-
if (!reachedConsistency &&
7163+
if (!reachedConsistency && !ControlFile->backupEndRequired &&
71617164
XLByteLE(minRecoveryPoint, EndRecPtr) &&
71627165
XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
71637166
{

0 commit comments

Comments
 (0)