mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-03-05 16:07:35 +02:00
Fix remote delta backup
This commit is contained in:
parent
3b144bbe2b
commit
be78ca6ee2
@ -819,7 +819,7 @@ do_backup_instance(void)
|
||||
{
|
||||
pgFile *file = (pgFile *) parray_get(xlog_files_list, i);
|
||||
if (S_ISREG(file->mode))
|
||||
calc_file_checksum(file);
|
||||
calc_file_checksum(file, FIO_BACKUP_HOST);
|
||||
/* Remove file path root prefix*/
|
||||
if (strstr(file->path, database_path) == file->path)
|
||||
{
|
||||
@ -2029,7 +2029,7 @@ pg_stop_backup(pgBackup *backup)
|
||||
if (backup_files_list)
|
||||
{
|
||||
file = pgFileNew(backup_label, true, FIO_BACKUP_HOST);
|
||||
calc_file_checksum(file);
|
||||
calc_file_checksum(file, FIO_BACKUP_HOST);
|
||||
free(file->path);
|
||||
file->path = strdup(PG_BACKUP_LABEL_FILE);
|
||||
parray_append(backup_files_list, file);
|
||||
@ -2073,7 +2073,7 @@ pg_stop_backup(pgBackup *backup)
|
||||
{
|
||||
file = pgFileNew(tablespace_map, true, FIO_BACKUP_HOST);
|
||||
if (S_ISREG(file->mode))
|
||||
calc_file_checksum(file);
|
||||
calc_file_checksum(file, FIO_BACKUP_HOST);
|
||||
free(file->path);
|
||||
file->path = strdup(PG_TABLESPACE_MAP_FILE);
|
||||
parray_append(backup_files_list, file);
|
||||
@ -2319,7 +2319,7 @@ backup_files(void *arg)
|
||||
if (prev_file && file->exists_in_prev &&
|
||||
buf.st_mtime < current.parent_backup)
|
||||
{
|
||||
calc_file_checksum(file);
|
||||
calc_file_checksum(file, FIO_DB_HOST);
|
||||
/* ...and checksum is the same... */
|
||||
if (EQ_TRADITIONAL_CRC32(file->crc, (*prev_file)->crc))
|
||||
skip = true; /* ...skip copying file. */
|
||||
|
@ -1414,11 +1414,11 @@ get_wal_file(const char *from_path, const char *to_path)
|
||||
* PG_TABLESPACE_MAP_FILE and PG_BACKUP_LABEL_FILE.
|
||||
*/
|
||||
void
|
||||
calc_file_checksum(pgFile *file)
|
||||
calc_file_checksum(pgFile *file, fio_location location)
|
||||
{
|
||||
Assert(S_ISREG(file->mode));
|
||||
|
||||
file->crc = pgFileGetCRC(file->path, true, false, &file->read_size, FIO_BACKUP_HOST);
|
||||
file->crc = pgFileGetCRC(file->path, true, false, &file->read_size, location);
|
||||
file->write_size = file->read_size;
|
||||
}
|
||||
|
||||
|
@ -555,7 +555,7 @@ extern void push_wal_file(const char *from_path, const char *to_path,
|
||||
bool is_compress, bool overwrite);
|
||||
extern void get_wal_file(const char *from_path, const char *to_path);
|
||||
|
||||
extern void calc_file_checksum(pgFile *file);
|
||||
extern void calc_file_checksum(pgFile *file, fio_location location);
|
||||
|
||||
extern bool check_file_pages(pgFile *file, XLogRecPtr stop_lsn,
|
||||
uint32 checksum_version, uint32 backup_version);
|
||||
|
Loading…
x
Reference in New Issue
Block a user