Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit eb531bc

Browse files
author
Artur Zakirov
committed
WAL delete fixes
1 parent b188a8a commit eb531bc

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

data.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
9292
}
9393

9494
/*
95-
* If an invalid data page was found, fallback to simple copy to ensure
96-
* all pages in the file don't have BackupPageHeader.
97-
*/
95+
* If an invalid data page was found, fallback to simple copy to ensure
96+
* all pages in the file don't have BackupPageHeader.
97+
*/
9898
if (!parse_page(&page, &page_lsn))
9999
{
100100
int i;
@@ -226,9 +226,6 @@ backup_data_file(const char *from_root, const char *to_root,
226226
to_path, strerror(errno_tmp));
227227
}
228228

229-
/* confirm server version */
230-
check_server_version();
231-
232229
/*
233230
* Read each page, verify checksum and write it to backup.
234231
* If page map is not empty we scan only these blocks, otherwise
@@ -244,10 +241,7 @@ backup_data_file(const char *from_root, const char *to_root,
244241
datapagemap_iterator_t *iter;
245242
iter = datapagemap_iterate(&file->pagemap);
246243
while (datapagemap_next(iter, &blknum))
247-
{
248-
elog(WARNING, "Iter bitmap. blknum %u, nblocks %u", blknum, nblocks);
249244
backup_data_page(file, lsn, blknum, nblocks, in, out, &crc);
250-
}
251245

252246
pg_free(iter);
253247
/*

delete.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ do_deletewal(time_t backup_id, bool strict)
139139
parray_walk(backup_list, pgBackupFree);
140140
parray_free(backup_list);
141141

142-
delete_walfiles(oldest_lsn, oldest_tli, false);
142+
delete_walfiles(oldest_lsn, oldest_tli, true);
143143

144144
return 0;
145145
}
@@ -349,10 +349,11 @@ delete_walfiles(XLogRecPtr oldest_lsn, TimeLineID oldest_tli, bool delete_all)
349349
* they were originally written, in case this worries you.
350350
*/
351351
if (IsXLogFileName(arcde->d_name) ||
352-
IsPartialXLogFileName(arcde->d_name))
352+
IsPartialXLogFileName(arcde->d_name) ||
353+
IsBackupHistoryFileName(arcde->d_name))
353354
{
354355
if (XLogRecPtrIsInvalid(oldest_lsn) ||
355-
strcmp(arcde->d_name + 8, oldestSegmentNeeded + 8) < 0)
356+
strncmp(arcde->d_name + 8, oldestSegmentNeeded + 8, 16) < 0)
356357
{
357358
/*
358359
* Use the original file name again now, including any

0 commit comments

Comments
 (0)