mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-12-13 11:53:59 +02:00
PBCKP-36: Do not write 'latest' into recovery.conf
This commit is contained in:
parent
eb767ed0ad
commit
fff9318401
@ -328,7 +328,6 @@ help_restore(void)
|
|||||||
|
|
||||||
printf(_(" --recovery-target=immediate|latest\n"));
|
printf(_(" --recovery-target=immediate|latest\n"));
|
||||||
printf(_(" end recovery as soon as a consistent state is reached or as late as possible\n"));
|
printf(_(" end recovery as soon as a consistent state is reached or as late as possible\n"));
|
||||||
printf(_(" (default: immediate)\n"));
|
|
||||||
printf(_(" --recovery-target-name=target-name\n"));
|
printf(_(" --recovery-target-name=target-name\n"));
|
||||||
printf(_(" the named restore point to which recovery will proceed\n"));
|
printf(_(" the named restore point to which recovery will proceed\n"));
|
||||||
printf(_(" --recovery-target-action=pause|promote|shutdown\n"));
|
printf(_(" --recovery-target-action=pause|promote|shutdown\n"));
|
||||||
|
@ -772,10 +772,12 @@ create_recovery_conf(time_t backup_id,
|
|||||||
char path[MAXPGPATH];
|
char path[MAXPGPATH];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
bool need_restore_conf;
|
bool need_restore_conf;
|
||||||
|
bool target_latest;
|
||||||
|
|
||||||
|
target_latest = rt->target_stop != NULL &&
|
||||||
|
strcmp(rt->target_stop, "latest") == 0;
|
||||||
need_restore_conf = !backup->stream ||
|
need_restore_conf = !backup->stream ||
|
||||||
(rt->time_string || rt->xid_string || rt->lsn_string) ||
|
(rt->time_string || rt->xid_string || rt->lsn_string) || target_latest;
|
||||||
(rt->target_stop != NULL && strcmp(rt->target_stop, "latest") == 0);
|
|
||||||
|
|
||||||
/* No need to generate recovery.conf at all. */
|
/* No need to generate recovery.conf at all. */
|
||||||
if (!(need_restore_conf || restore_as_replica))
|
if (!(need_restore_conf || restore_as_replica))
|
||||||
@ -816,7 +818,7 @@ create_recovery_conf(time_t backup_id,
|
|||||||
if (rt->lsn_string)
|
if (rt->lsn_string)
|
||||||
fprintf(fp, "recovery_target_lsn = '%s'\n", rt->lsn_string);
|
fprintf(fp, "recovery_target_lsn = '%s'\n", rt->lsn_string);
|
||||||
|
|
||||||
if (rt->target_stop)
|
if (rt->target_stop && !target_latest)
|
||||||
fprintf(fp, "recovery_target = '%s'\n", rt->target_stop);
|
fprintf(fp, "recovery_target = '%s'\n", rt->target_stop);
|
||||||
|
|
||||||
if (rt->inclusive_specified)
|
if (rt->inclusive_specified)
|
||||||
|
Loading…
Reference in New Issue
Block a user