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

Commit3cc9d81

Browse files
committed
[Issue#104] consider only OK and DONE backups as candidates for PITR validation if backup ID is not specified
1 parent6da6318 commit3cc9d81

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

‎src/restore.c‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,16 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
9191
/*
9292
* [PGPRO-1164] If BACKUP_ID is not provided for restore command,
9393
* we must find the first valid(!) backup.
94+
95+
* If target_backup_id is not provided, we can be sure that
96+
* PITR for restore or validate is requested.
97+
* So we can assume that user is more interested in recovery to specific point
98+
* in time and NOT interested in revalidation of invalid backups.
99+
* So based on that assumptions we should choose only OK and DONE backups
100+
* as candidates for validate and restore.
94101
*/
95102

96-
if (is_restore&&
97-
target_backup_id==INVALID_BACKUP_ID&&
103+
if (target_backup_id==INVALID_BACKUP_ID&&
98104
(current_backup->status!=BACKUP_STATUS_OK&&
99105
current_backup->status!=BACKUP_STATUS_DONE))
100106
{
@@ -1033,7 +1039,7 @@ parseRecoveryTargetOptions(const char *target_time,
10331039
if (parse_time(target_time,&dummy_time, false))
10341040
rt->target_time=dummy_time;
10351041
else
1036-
elog(ERROR,"Invalid value for --recovery-target-time option %s",
1042+
elog(ERROR,"Invalid value for'--recovery-target-time' option %s",
10371043
target_time);
10381044
}
10391045

@@ -1051,7 +1057,7 @@ parseRecoveryTargetOptions(const char *target_time,
10511057
#endif
10521058
rt->target_xid=dummy_xid;
10531059
else
1054-
elog(ERROR,"Invalid value for --recovery-target-xid option %s",
1060+
elog(ERROR,"Invalid value for'--recovery-target-xid' option %s",
10551061
target_xid);
10561062
}
10571063

@@ -1064,7 +1070,7 @@ parseRecoveryTargetOptions(const char *target_time,
10641070
if (parse_lsn(target_lsn,&dummy_lsn))
10651071
rt->target_lsn=dummy_lsn;
10661072
else
1067-
elog(ERROR,"Invalid value of --recovery-target-lsn option %s",
1073+
elog(ERROR,"Invalid value of'--recovery-target-lsn' option %s",
10681074
target_lsn);
10691075
}
10701076

@@ -1074,7 +1080,7 @@ parseRecoveryTargetOptions(const char *target_time,
10741080
if (parse_bool(target_inclusive,&dummy_bool))
10751081
rt->target_inclusive=dummy_bool;
10761082
else
1077-
elog(ERROR,"Invalid value for --recovery-target-inclusive option %s",
1083+
elog(ERROR,"Invalid value for'--recovery-target-inclusive' option %s",
10781084
target_inclusive);
10791085
}
10801086

@@ -1083,7 +1089,7 @@ parseRecoveryTargetOptions(const char *target_time,
10831089
{
10841090
if ((strcmp(target_stop,"immediate")!=0)
10851091
&& (strcmp(target_stop,"latest")!=0))
1086-
elog(ERROR,"Invalid value for --recovery-target option %s",
1092+
elog(ERROR,"Invalid value for'--recovery-target' option %s",
10871093
target_stop);
10881094

10891095
recovery_target_specified++;
@@ -1103,7 +1109,7 @@ parseRecoveryTargetOptions(const char *target_time,
11031109
if ((strcmp(target_action,"pause")!=0)
11041110
&& (strcmp(target_action,"promote")!=0)
11051111
&& (strcmp(target_action,"shutdown")!=0))
1106-
elog(ERROR,"Invalid value for --recovery-target-action option %s",
1112+
elog(ERROR,"Invalid value for'--recovery-target-action' option %s",
11071113
target_action);
11081114

11091115
rt->target_action=target_action;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp