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

Commitacd907b

Browse files
committed
Add cross-check that current timeline of pg_control is an ancestor of
recovery_target_timeline --- otherwise there is no path from the backupto the requested timeline. This check was foreseen in the originaldiscussion but I forgot to implement it.
1 parent3dba9cb commitacd907b

File tree

1 file changed

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

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, 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.151 2004/07/2220:18:40 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.152 2004/07/2221:09:37 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -4008,6 +4008,18 @@ StartupXLOG(void)
40084008
/* Now we can determine the list of expected TLIs */
40094009
expectedTLIs=readTimeLineHistory(recoveryTargetTLI);
40104010

4011+
/*
4012+
* If pg_control's timeline is not in expectedTLIs, then we cannot
4013+
* proceed: the backup is not part of the history of the requested
4014+
* timeline.
4015+
*/
4016+
if (!list_member_int(expectedTLIs,
4017+
(int)ControlFile->checkPointCopy.ThisTimeLineID))
4018+
ereport(FATAL,
4019+
(errmsg("requested timeline %u is not a child of database system timeline %u",
4020+
recoveryTargetTLI,
4021+
ControlFile->checkPointCopy.ThisTimeLineID)));
4022+
40114023
/*
40124024
* Get the last valid checkpoint record. If the latest one according
40134025
* to pg_control is broken, try the next-to-last one.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp