mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-02 13:36:08 +02:00
Do not create recovery.conf only if backup-ID was passed and only if destination backup is not stream backup
This commit is contained in:
parent
733cf37195
commit
faae29739e
@ -16,7 +16,7 @@
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
const char *PROGRAM_VERSION = "1.0.1";
|
||||
const char *PROGRAM_VERSION = "1.0.2";
|
||||
const char *PROGRAM_URL = "https://github.com/postgrespro/pg_probackup";
|
||||
const char *PROGRAM_EMAIL = "https://github.com/postgrespro/pg_probackup/issues";
|
||||
|
||||
|
@ -91,7 +91,7 @@ do_restore(time_t backup_id,
|
||||
pgBackup *base_backup = NULL;
|
||||
pgBackup *dest_backup = NULL;
|
||||
pgRecoveryTarget *rt = NULL;
|
||||
bool need_recovery_conf = false;
|
||||
bool need_recovery_conf = true;
|
||||
|
||||
/* PGDATA and ARCLOG_PATH are always required */
|
||||
if (pgdata == NULL)
|
||||
@ -200,16 +200,16 @@ base_backup_found:
|
||||
/* Tablespace directories checking */
|
||||
check_tablespace_mapping((pgBackup *) parray_get(backups, last_diff_index));
|
||||
|
||||
if (dest_backup && dest_backup->stream)
|
||||
need_recovery_conf = target_time != NULL || target_xid != NULL;
|
||||
|
||||
/* Restore backups from base_index to last_diff_index */
|
||||
need_recovery_conf = target_time != NULL || target_xid != NULL;
|
||||
for (i = base_index; i >= last_diff_index; i--)
|
||||
{
|
||||
pgBackup *backup = (pgBackup *) parray_get(backups, i);
|
||||
|
||||
if (backup->status == BACKUP_STATUS_OK)
|
||||
{
|
||||
need_recovery_conf = need_recovery_conf || !backup->stream;
|
||||
|
||||
print_backup_lsn(backup);
|
||||
restore_database(backup);
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
pg_probackup 1.0
|
||||
pg_probackup 1.0.2
|
||||
|
10
validate.c
10
validate.c
@ -39,7 +39,7 @@ do_validate(time_t backup_id,
|
||||
pgBackup *base_backup = NULL;
|
||||
pgBackup *dest_backup = NULL;
|
||||
bool success_validate,
|
||||
need_validate_wal = false;
|
||||
need_validate_wal = true;
|
||||
|
||||
catalog_lock(false);
|
||||
|
||||
@ -128,20 +128,18 @@ base_backup_found:
|
||||
|
||||
Assert(last_diff_index <= base_index);
|
||||
|
||||
if (dest_backup && dest_backup->stream)
|
||||
need_validate_wal = target_time != NULL || target_xid != NULL;
|
||||
|
||||
/* Validate backups from base_index to last_diff_index */
|
||||
need_validate_wal = target_time != NULL || target_xid != NULL;
|
||||
for (i = base_index; i >= last_diff_index; i--)
|
||||
{
|
||||
pgBackup *backup = (pgBackup *) parray_get(backups, i);
|
||||
|
||||
if (backup->status == BACKUP_STATUS_OK ||
|
||||
backup->status == BACKUP_STATUS_CORRUPT)
|
||||
{
|
||||
need_validate_wal = need_validate_wal || !backup->stream;
|
||||
|
||||
success_validate = pgBackupValidate(backup, false, false) &&
|
||||
success_validate;
|
||||
}
|
||||
}
|
||||
|
||||
/* and now we must check WALs */
|
||||
|
Loading…
x
Reference in New Issue
Block a user