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)
2403
2403
2404
2404
if (file -> is_datafile )
2405
2405
{
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 )
2408
2408
{
2409
2409
/* ignore ptrack if ptrack_init exists */
2410
2410
elog (VERBOSE , "Ignoring ptrack because of ptrack_init for file: %s" , file -> path );
2411
- file -> pagemap . bitmapsize = PageBitmapIsAbsent ;
2411
+ file -> pagemap_isabsent = true ;
2412
2412
continue ;
2413
2413
}
2414
2414
@@ -2461,7 +2461,7 @@ make_pagemap_from_ptrack(parray *files)
2461
2461
* - target relation was deleted.
2462
2462
*/
2463
2463
elog (VERBOSE , "Ptrack is missing for file: %s" , file -> path );
2464
- file -> pagemap . bitmapsize = PageBitmapIsAbsent ;
2464
+ file -> pagemap_isabsent = true ;
2465
2465
}
2466
2466
}
2467
2467
}
Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ backup_data_file(backup_files_args* arguments,
430
430
if ((backup_mode == BACKUP_MODE_DIFF_PAGE ||
431
431
backup_mode == BACKUP_MODE_DIFF_PTRACK ) &&
432
432
file -> pagemap .bitmapsize == PageBitmapIsEmpty &&
433
- file -> exists_in_prev )
433
+ file -> exists_in_prev && ! file -> pagemap_isabsent )
434
434
{
435
435
/*
436
436
* There are no changed blocks since last backup. We want make
@@ -494,9 +494,8 @@ backup_data_file(backup_files_args* arguments,
494
494
* If page map is empty or file is not present in previous backup
495
495
* backup all pages of the relation.
496
496
*/
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 )
500
499
{
501
500
for (blknum = 0 ; blknum < nblocks ; blknum ++ )
502
501
{
Original file line number Diff line number Diff line change @@ -161,7 +161,8 @@ pgFileInit(const char *path)
161
161
file -> is_datafile = false;
162
162
file -> linked = NULL ;
163
163
file -> pagemap .bitmap = NULL ;
164
- file -> pagemap .bitmapsize = PageBitmapIsAbsent ;
164
+ file -> pagemap .bitmapsize = PageBitmapIsEmpty ;
165
+ file -> pagemap_isabsent = false;
165
166
file -> tblspcOid = 0 ;
166
167
file -> dbOid = 0 ;
167
168
file -> relOid = 0 ;
Original file line number Diff line number Diff line change @@ -108,11 +108,12 @@ typedef struct pgFile
108
108
CompressAlg compress_alg ; /* compression algorithm applied to the file */
109
109
volatile pg_atomic_flag lock ; /* lock for synchronization of parallel threads */
110
110
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 */
111
113
} pgFile ;
112
114
113
115
/* Special values of datapagemap_t bitmapsize */
114
116
#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 */
116
117
117
118
/* Current state of backup */
118
119
typedef enum BackupStatus
You can’t perform that action at this time.
0 commit comments