mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-01-07 13:40:17 +02:00
bugfix: allow restore of DELTA backup to skip unchanged non-data files
This commit is contained in:
parent
ac4ea5e731
commit
7f21f63bb0
@ -677,17 +677,23 @@ restore_files(void *arg)
|
|||||||
file->rel_path);
|
file->rel_path);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For PAGE and PTRACK backups skip files which haven't changed
|
* For PAGE and PTRACK backups skip datafiles which haven't changed
|
||||||
* since previous backup and thus were not backed up.
|
* since previous backup and thus were not backed up.
|
||||||
* We cannot do the same when restoring DELTA backup because we need information
|
* We cannot do the same when restoring DELTA backup because we need information
|
||||||
* about every file to correctly truncate them.
|
* about every datafile to correctly truncate them.
|
||||||
*/
|
*/
|
||||||
if (file->write_size == BYTES_INVALID &&
|
if (file->write_size == BYTES_INVALID)
|
||||||
(arguments->backup->backup_mode == BACKUP_MODE_DIFF_PAGE
|
|
||||||
|| arguments->backup->backup_mode == BACKUP_MODE_DIFF_PTRACK))
|
|
||||||
{
|
{
|
||||||
elog(VERBOSE, "The file didn`t change. Skip restore: \"%s\"", file->path);
|
/* data file, only PAGE and PTRACK can skip */
|
||||||
continue;
|
if (((file->is_datafile && !file->is_cfs) &&
|
||||||
|
(arguments->backup->backup_mode == BACKUP_MODE_DIFF_PAGE ||
|
||||||
|
arguments->backup->backup_mode == BACKUP_MODE_DIFF_PTRACK)) ||
|
||||||
|
/* non-data file can be skipped regardless of backup type */
|
||||||
|
!(file->is_datafile && !file->is_cfs))
|
||||||
|
{
|
||||||
|
elog(VERBOSE, "The file didn`t change. Skip restore: \"%s\"", file->path);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Directories were created before */
|
/* Directories were created before */
|
||||||
|
Loading…
Reference in New Issue
Block a user