Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be78ca6

Browse files
committed
Fix remote delta backup
1 parent 3b144bb commit be78ca6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/backup.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ do_backup_instance(void)
819819
{
820820
pgFile *file = (pgFile *) parray_get(xlog_files_list, i);
821821
if (S_ISREG(file->mode))
822-
calc_file_checksum(file);
822+
calc_file_checksum(file, FIO_BACKUP_HOST);
823823
/* Remove file path root prefix*/
824824
if (strstr(file->path, database_path) == file->path)
825825
{
@@ -2029,7 +2029,7 @@ pg_stop_backup(pgBackup *backup)
20292029
if (backup_files_list)
20302030
{
20312031
file = pgFileNew(backup_label, true, FIO_BACKUP_HOST);
2032-
calc_file_checksum(file);
2032+
calc_file_checksum(file, FIO_BACKUP_HOST);
20332033
free(file->path);
20342034
file->path = strdup(PG_BACKUP_LABEL_FILE);
20352035
parray_append(backup_files_list, file);
@@ -2073,7 +2073,7 @@ pg_stop_backup(pgBackup *backup)
20732073
{
20742074
file = pgFileNew(tablespace_map, true, FIO_BACKUP_HOST);
20752075
if (S_ISREG(file->mode))
2076-
calc_file_checksum(file);
2076+
calc_file_checksum(file, FIO_BACKUP_HOST);
20772077
free(file->path);
20782078
file->path = strdup(PG_TABLESPACE_MAP_FILE);
20792079
parray_append(backup_files_list, file);
@@ -2319,7 +2319,7 @@ backup_files(void *arg)
23192319
if (prev_file && file->exists_in_prev &&
23202320
buf.st_mtime < current.parent_backup)
23212321
{
2322-
calc_file_checksum(file);
2322+
calc_file_checksum(file, FIO_DB_HOST);
23232323
/* ...and checksum is the same... */
23242324
if (EQ_TRADITIONAL_CRC32(file->crc, (*prev_file)->crc))
23252325
skip = true; /* ...skip copying file. */

src/data.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1414,11 +1414,11 @@ get_wal_file(const char *from_path, const char *to_path)
14141414
* PG_TABLESPACE_MAP_FILE and PG_BACKUP_LABEL_FILE.
14151415
*/
14161416
void
1417-
calc_file_checksum(pgFile *file)
1417+
calc_file_checksum(pgFile *file, fio_location location)
14181418
{
14191419
Assert(S_ISREG(file->mode));
14201420

1421-
file->crc = pgFileGetCRC(file->path, true, false, &file->read_size, FIO_BACKUP_HOST);
1421+
file->crc = pgFileGetCRC(file->path, true, false, &file->read_size, location);
14221422
file->write_size = file->read_size;
14231423
}
14241424

src/pg_probackup.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ extern void push_wal_file(const char *from_path, const char *to_path,
555555
bool is_compress, bool overwrite);
556556
extern void get_wal_file(const char *from_path, const char *to_path);
557557

558-
extern void calc_file_checksum(pgFile *file);
558+
extern void calc_file_checksum(pgFile *file, fio_location location);
559559

560560
extern bool check_file_pages(pgFile *file, XLogRecPtr stop_lsn,
561561
uint32 checksum_version, uint32 backup_version);

0 commit comments

Comments
 (0)