File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed
Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -2403,12 +2403,12 @@ make_pagemap_from_ptrack(parray *files)
24032403
24042404 if (file -> is_datafile )
24052405 {
2406- if (file -> tblspcOid == tblspcOid_with_ptrack_init
2407- && file -> dbOid == dbOid_with_ptrack_init )
2406+ if (file -> tblspcOid == tblspcOid_with_ptrack_init &&
2407+ file -> dbOid == dbOid_with_ptrack_init )
24082408 {
24092409 /* ignore ptrack if ptrack_init exists */
24102410 elog (VERBOSE , "Ignoring ptrack because of ptrack_init for file: %s" , file -> path );
2411- file -> pagemap . bitmapsize = PageBitmapIsAbsent ;
2411+ file -> pagemap_isabsent = true ;
24122412 continue ;
24132413 }
24142414
@@ -2461,7 +2461,7 @@ make_pagemap_from_ptrack(parray *files)
24612461 * - target relation was deleted.
24622462 */
24632463 elog (VERBOSE , "Ptrack is missing for file: %s" , file -> path );
2464- file -> pagemap . bitmapsize = PageBitmapIsAbsent ;
2464+ file -> pagemap_isabsent = true ;
24652465 }
24662466 }
24672467 }
Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ backup_data_file(backup_files_args* arguments,
430430 if ((backup_mode == BACKUP_MODE_DIFF_PAGE ||
431431 backup_mode == BACKUP_MODE_DIFF_PTRACK ) &&
432432 file -> pagemap .bitmapsize == PageBitmapIsEmpty &&
433- file -> exists_in_prev )
433+ file -> exists_in_prev && ! file -> pagemap_isabsent )
434434 {
435435 /*
436436 * There are no changed blocks since last backup. We want make
@@ -494,9 +494,8 @@ backup_data_file(backup_files_args* arguments,
494494 * If page map is empty or file is not present in previous backup
495495 * backup all pages of the relation.
496496 */
497- if (file -> pagemap .bitmapsize == PageBitmapIsEmpty
498- || file -> pagemap .bitmapsize == PageBitmapIsAbsent
499- || !file -> exists_in_prev )
497+ if (file -> pagemap .bitmapsize == PageBitmapIsEmpty ||
498+ file -> pagemap_isabsent || !file -> exists_in_prev )
500499 {
501500 for (blknum = 0 ; blknum < nblocks ; blknum ++ )
502501 {
Original file line number Diff line number Diff line change @@ -161,7 +161,8 @@ pgFileInit(const char *path)
161161 file -> is_datafile = false;
162162 file -> linked = NULL ;
163163 file -> pagemap .bitmap = NULL ;
164- file -> pagemap .bitmapsize = PageBitmapIsAbsent ;
164+ file -> pagemap .bitmapsize = PageBitmapIsEmpty ;
165+ file -> pagemap_isabsent = false;
165166 file -> tblspcOid = 0 ;
166167 file -> dbOid = 0 ;
167168 file -> relOid = 0 ;
Original file line number Diff line number Diff line change @@ -108,11 +108,12 @@ typedef struct pgFile
108108 CompressAlg compress_alg ; /* compression algorithm applied to the file */
109109 volatile pg_atomic_flag lock ; /* lock for synchronization of parallel threads */
110110 datapagemap_t pagemap ; /* bitmap of pages updated since previous backup */
111+ bool pagemap_isabsent ; /* Used to mark files with unknown state of pagemap,
112+ * i.e. datafiles without _ptrack */
111113} pgFile ;
112114
113115/* Special values of datapagemap_t bitmapsize */
114116#define PageBitmapIsEmpty 0 /* Used to mark unchanged datafiles */
115- #define PageBitmapIsAbsent 0 /* Used to mark files with unknown state of pagemap, i.e. datafiles without _ptrack */
116117
117118/* Current state of backup */
118119typedef enum BackupStatus
You can’t perform that action at this time.
0 commit comments