@@ -575,6 +575,7 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync)
575575 {
576576 parray * xlog_files_list ;
577577 char pg_xlog_path [MAXPGPATH ];
578+ char wal_full_path [MAXPGPATH ];
578579
579580 /* Scan backup PG_XLOG_DIR */
580581 xlog_files_list = parray_new ();
@@ -586,11 +587,13 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync)
586587 for (i = 0 ; i < parray_num (xlog_files_list ); i ++ )
587588 {
588589 pgFile * file = (pgFile * ) parray_get (xlog_files_list , i );
590+
591+ join_path_components (wal_full_path , pg_xlog_path , file -> rel_path );
592+
589593 if (S_ISREG (file -> mode ))
590594 {
591- file -> crc = pgFileGetCRC (file -> path , true, false,
592- & file -> read_size , FIO_BACKUP_HOST );
593- file -> write_size = file -> read_size ;
595+ file -> crc = pgFileGetCRC (wal_full_path , true, false);
596+ file -> write_size = file -> size ;
594597 }
595598 /* Remove file path root prefix*/
596599 if (strstr (file -> path , database_path ) == file -> path )
@@ -1805,10 +1808,11 @@ pg_stop_backup(pgBackup *backup, PGconn *pg_startbackup_conn,
18051808 {
18061809 file = pgFileNew (backup_label , PG_BACKUP_LABEL_FILE , true, 0 ,
18071810 FIO_BACKUP_HOST );
1808- file -> crc = pgFileGetCRC (file -> path , true, false,
1809- & file -> read_size , FIO_BACKUP_HOST );
1810- file -> write_size = file -> read_size ;
1811- file -> uncompressed_size = file -> read_size ;
1811+
1812+ file -> crc = pgFileGetCRC (backup_label , true, false);
1813+
1814+ file -> write_size = file -> size ;
1815+ file -> uncompressed_size = file -> size ;
18121816 free (file -> path );
18131817 file -> path = strdup (PG_BACKUP_LABEL_FILE );
18141818 parray_append (backup_files_list , file );
@@ -1854,9 +1858,8 @@ pg_stop_backup(pgBackup *backup, PGconn *pg_startbackup_conn,
18541858 FIO_BACKUP_HOST );
18551859 if (S_ISREG (file -> mode ))
18561860 {
1857- file -> crc = pgFileGetCRC (file -> path , true, false,
1858- & file -> read_size , FIO_BACKUP_HOST );
1859- file -> write_size = file -> read_size ;
1861+ file -> crc = pgFileGetCRC (tablespace_map , true, false);
1862+ file -> write_size = file -> size ;
18601863 }
18611864 free (file -> path );
18621865 file -> path = strdup (PG_TABLESPACE_MAP_FILE );
0 commit comments