1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-02-08 14:28:36 +02:00

remove prev_seg flag from extractPageMap(), make doExtractPageMap() more greedy

This commit is contained in:
Grigory Smolkin 2018-08-16 09:23:02 +03:00
parent 06ac24dd44
commit 0de51e579c
2 changed files with 3 additions and 13 deletions

View File

@ -650,12 +650,7 @@ do_backup_instance(void)
* where this backup has started.
*/
extractPageMap(arclog_path, prev_backup->start_lsn, current.tli,
current.start_lsn,
/*
* For backup from master wait for previous segment.
* For backup from replica wait for current segment.
*/
!current.from_replica, backup_files_list);
current.start_lsn, backup_files_list);
}
else if (current.backup_mode == BACKUP_MODE_DIFF_PTRACK)
{

View File

@ -260,7 +260,7 @@ doExtractPageMap(void *arg)
XLByteToSeg(xlogreader->EndRecPtr, nextSegNo);
} while (nextSegNo <= extract_arg->endSegNo &&
xlogreader->EndRecPtr < extract_arg->endpoint);
xlogreader->ReadRecPtr < extract_arg->endpoint);
CleanupXLogPageRead(xlogreader);
XLogReaderFree(xlogreader);
@ -274,15 +274,12 @@ doExtractPageMap(void *arg)
* Read WAL from the archive directory, from 'startpoint' to 'endpoint' on the
* given timeline. Collect data blocks touched by the WAL records into a page map.
*
* If **prev_segno** is true then read all segments up to **endpoint** segment
* minus one. Else read all segments up to **endpoint** segment.
*
* Pagemap extracting is processed using threads. Eeach thread reads single WAL
* file.
*/
void
extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
XLogRecPtr endpoint, bool prev_seg, parray *files)
XLogRecPtr endpoint, parray *files)
{
int i;
int threads_need = 0;
@ -303,8 +300,6 @@ extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
(uint32) (endpoint >> 32), (uint32) (endpoint));
XLByteToSeg(endpoint, endSegNo);
if (prev_seg)
endSegNo--;
nextSegNoToRead = 0;
time(&start_time);