You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here code has something wrong,and i add one line code.
static void
backup_files(const char *from_root,
const char *to_root,
parray *files,
parray *prev_files,
const XLogRecPtr *lsn,
bool compress,
const char *prefix)
{
int i;
int num_skipped = 0;
struct timeval tv;
bool prev_file_not_found = false;
/* sort pathname ascending */
parray_qsort(files, pgFileComparePath);
gettimeofday(&tv, NULL);
/* backup a file or create a directory */
for (i = 0; i < parray_num(files); i++)
{
int ret;
struct stat buf;
pgFile *file = (pgFile *) parray_get(files, i);
///////////////////////////////////////////////////////////////////
//I add code here
prev_file_not_found = false;
...
...
...
}
}
If not do this change, it may backup a lot of files which is nothing useful change when a table is more than 100G. It is due to PostgreSQL may change tuple header data without change SLN.
The text was updated successfully, but these errors were encountered:
Dear lchch.
Thank you for finding a bug.
I had reproduced the problem in this way.
Input 500mb data to table A
Input 1mb data to table B
Run to full backup
Add to 1 gb data to table A
Add to 1mb data to table B
Run to incremental backup
-> It works the same as a full backup(2mb), not 1mb data which is incremental data for table B
This problem is that did not initialize the value of bool(prev_file_not_found) as you said.
I'll check if there's any other problem and try to fix the source-code.
That is the bug.
It is dangerous for table A too because of it's sort.
Example:
Relfilenode of table A is 16384
Due to sort,16384.2 is backuped after16384.120,so if 16384.120 is a new file, 16384.2 may be copied too.
Luckily,we can solve the problems by initialize the value of bool(prev_file_not_found)
In backup_files(), we forgot to reset prev_file_not_found, which once set, causes subsequent files to assume the same value resulting in redundant copying of data.
pg_rman/backup.c
Line 1426 in 4abebbe
Here code has something wrong,and i add one line code.
If not do this change, it may backup a lot of files which is nothing useful change when a table is more than 100G. It is due to PostgreSQL may change tuple header data without change SLN.
The text was updated successfully, but these errors were encountered: