mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-04-16 12:18:38 +02:00
Add pagemap_isabsent instead of PageBitmapIsAbsent define
This commit is contained in:
parent
6b539ad59a
commit
7f87c1cebe
@ -2403,12 +2403,12 @@ make_pagemap_from_ptrack(parray *files)
|
|||||||
|
|
||||||
if (file->is_datafile)
|
if (file->is_datafile)
|
||||||
{
|
{
|
||||||
if (file->tblspcOid == tblspcOid_with_ptrack_init
|
if (file->tblspcOid == tblspcOid_with_ptrack_init &&
|
||||||
&& file->dbOid == dbOid_with_ptrack_init)
|
file->dbOid == dbOid_with_ptrack_init)
|
||||||
{
|
{
|
||||||
/* ignore ptrack if ptrack_init exists */
|
/* ignore ptrack if ptrack_init exists */
|
||||||
elog(VERBOSE, "Ignoring ptrack because of ptrack_init for file: %s", file->path);
|
elog(VERBOSE, "Ignoring ptrack because of ptrack_init for file: %s", file->path);
|
||||||
file->pagemap.bitmapsize = PageBitmapIsAbsent;
|
file->pagemap_isabsent = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2461,7 +2461,7 @@ make_pagemap_from_ptrack(parray *files)
|
|||||||
* - target relation was deleted.
|
* - target relation was deleted.
|
||||||
*/
|
*/
|
||||||
elog(VERBOSE, "Ptrack is missing for file: %s", file->path);
|
elog(VERBOSE, "Ptrack is missing for file: %s", file->path);
|
||||||
file->pagemap.bitmapsize = PageBitmapIsAbsent;
|
file->pagemap_isabsent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -430,7 +430,7 @@ backup_data_file(backup_files_args* arguments,
|
|||||||
if ((backup_mode == BACKUP_MODE_DIFF_PAGE ||
|
if ((backup_mode == BACKUP_MODE_DIFF_PAGE ||
|
||||||
backup_mode == BACKUP_MODE_DIFF_PTRACK) &&
|
backup_mode == BACKUP_MODE_DIFF_PTRACK) &&
|
||||||
file->pagemap.bitmapsize == PageBitmapIsEmpty &&
|
file->pagemap.bitmapsize == PageBitmapIsEmpty &&
|
||||||
file->exists_in_prev)
|
file->exists_in_prev && !file->pagemap_isabsent)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* There are no changed blocks since last backup. We want make
|
* There are no changed blocks since last backup. We want make
|
||||||
@ -494,9 +494,8 @@ backup_data_file(backup_files_args* arguments,
|
|||||||
* If page map is empty or file is not present in previous backup
|
* If page map is empty or file is not present in previous backup
|
||||||
* backup all pages of the relation.
|
* backup all pages of the relation.
|
||||||
*/
|
*/
|
||||||
if (file->pagemap.bitmapsize == PageBitmapIsEmpty
|
if (file->pagemap.bitmapsize == PageBitmapIsEmpty ||
|
||||||
|| file->pagemap.bitmapsize == PageBitmapIsAbsent
|
file->pagemap_isabsent || !file->exists_in_prev)
|
||||||
|| !file->exists_in_prev)
|
|
||||||
{
|
{
|
||||||
for (blknum = 0; blknum < nblocks; blknum++)
|
for (blknum = 0; blknum < nblocks; blknum++)
|
||||||
{
|
{
|
||||||
|
@ -161,7 +161,8 @@ pgFileInit(const char *path)
|
|||||||
file->is_datafile = false;
|
file->is_datafile = false;
|
||||||
file->linked = NULL;
|
file->linked = NULL;
|
||||||
file->pagemap.bitmap = NULL;
|
file->pagemap.bitmap = NULL;
|
||||||
file->pagemap.bitmapsize = PageBitmapIsAbsent;
|
file->pagemap.bitmapsize = PageBitmapIsEmpty;
|
||||||
|
file->pagemap_isabsent = false;
|
||||||
file->tblspcOid = 0;
|
file->tblspcOid = 0;
|
||||||
file->dbOid = 0;
|
file->dbOid = 0;
|
||||||
file->relOid = 0;
|
file->relOid = 0;
|
||||||
|
@ -108,11 +108,12 @@ typedef struct pgFile
|
|||||||
CompressAlg compress_alg; /* compression algorithm applied to the file */
|
CompressAlg compress_alg; /* compression algorithm applied to the file */
|
||||||
volatile pg_atomic_flag lock; /* lock for synchronization of parallel threads */
|
volatile pg_atomic_flag lock; /* lock for synchronization of parallel threads */
|
||||||
datapagemap_t pagemap; /* bitmap of pages updated since previous backup */
|
datapagemap_t pagemap; /* bitmap of pages updated since previous backup */
|
||||||
|
bool pagemap_isabsent; /* Used to mark files with unknown state of pagemap,
|
||||||
|
* i.e. datafiles without _ptrack */
|
||||||
} pgFile;
|
} pgFile;
|
||||||
|
|
||||||
/* Special values of datapagemap_t bitmapsize */
|
/* Special values of datapagemap_t bitmapsize */
|
||||||
#define PageBitmapIsEmpty 0 /* Used to mark unchanged datafiles */
|
#define PageBitmapIsEmpty 0 /* Used to mark unchanged datafiles */
|
||||||
#define PageBitmapIsAbsent 0 /* Used to mark files with unknown state of pagemap, i.e. datafiles without _ptrack */
|
|
||||||
|
|
||||||
/* Current state of backup */
|
/* Current state of backup */
|
||||||
typedef enum BackupStatus
|
typedef enum BackupStatus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user