Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3efba16

Browse files
committed
If a base backup is cancelled by server shutdown or crash, throw an error
in WAL recovery when it sees the shutdown checkpoint record. It's moreuser-friendly to find out about it at that point than at the end ofrecovery, and you're not left wondering why your hot standby server neveropens up for read-only connections.
1 parent3456cf1 commit3efba16

File tree

1 file changed

+11
-1
lines changed
  • src/backend/access/transam

1 file changed

+11
-1
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.403 2010/04/23 20:21:31 sriggs Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.404 2010/04/27 09:25:18 heikki Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -7713,6 +7713,16 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
77137713
if (standbyState!=STANDBY_DISABLED)
77147714
CheckRequiredParameterValues(checkPoint);
77157715

7716+
/*
7717+
* If we see a shutdown checkpoint while waiting for an
7718+
* end-of-backup record, the backup was cancelled and the
7719+
* end-of-backup record will never arrive.
7720+
*/
7721+
if (InArchiveRecovery&&
7722+
!XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
7723+
ereport(ERROR,
7724+
(errmsg("online backup was cancelled, recovery cannot continue")));
7725+
77167726
/*
77177727
* If we see a shutdown checkpoint, we know that nothing was
77187728
* running on the master at this point. So fake-up an empty

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp