1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-18 21:28:07 +02:00

Fix bug: Sometimes we may miss WAL segments and threads

This commit is contained in:
Arthur Zakirov 2018-08-09 19:02:38 +03:00
parent ff739835f3
commit 3fe942f97b
2 changed files with 8 additions and 9 deletions

View File

@ -305,6 +305,8 @@ extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
/* By default there is some error */
thread_args[i].ret = 1;
threads_need++;
/* Adjust startpoint to the next thread */
if (nextSegNoToRead == 0)
XLByteToSeg(startpoint, nextSegNoToRead);
@ -317,10 +319,6 @@ extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
if (nextSegNoToRead > endSegNo)
break;
XLogSegNoOffsetToRecPtr(nextSegNoToRead, 0, startpoint);
/* Skip over the page header */
startpoint += SizeOfXLogLongPHD;
threads_need++;
}
/* Run threads */

View File

@ -255,11 +255,6 @@ class PageBackupTest(ProbackupTest, unittest.TestCase):
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
repr(self.output), self.cmd))
# GET RESTORED PGDATA AND COMPARE
if self.paranoia:
pgdata_restored = self.pgdata_content(node.data_dir)
self.compare_pgdata(pgdata, pgdata_restored)
node.slow_start()
full_result_new = node.execute("postgres", "SELECT * FROM t_heap")
@ -278,6 +273,12 @@ class PageBackupTest(ProbackupTest, unittest.TestCase):
"--recovery-target-action=promote"]),
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
repr(self.output), self.cmd))
# GET RESTORED PGDATA AND COMPARE
if self.paranoia:
pgdata_restored = self.pgdata_content(node.data_dir)
self.compare_pgdata(pgdata, pgdata_restored)
node.slow_start()
page_result_new = node.execute("postgres", "SELECT * FROM t_heap")