From d5826273662543f4bc487882b3893df1dd98b269 Mon Sep 17 00:00:00 2001 From: Yura Sokolov Date: Mon, 12 Dec 2022 10:36:06 +0300 Subject: [PATCH] cleanup xlogreader in SwitchThreadtoNextWal so we don't need to seek back --- src/parsexlog.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/parsexlog.c b/src/parsexlog.c index 71a49458..e05f5656 100644 --- a/src/parsexlog.c +++ b/src/parsexlog.c @@ -1461,10 +1461,7 @@ XLogThreadWorker(void *arg) */ strncmp(errormsg, "missing contrecord", 18) == 0)) { - if (SwitchThreadToNextWal(xlogreader, thread_arg)) - continue; - else - break; + continue; } /* @@ -1649,6 +1646,8 @@ SwitchThreadToNextWal(XLogReaderState *xlogreader, xlog_thread_arg *arg) PrintXLogCorruptionMsg(reader_data, ERROR); } arg->startpoint = found; + /* Reset xlog reader therefore we don't have to seek back */ + CleanupXLogPageRead(xlogreader); elog(VERBOSE, "Thread [%d]: Switched to LSN %X/%X", reader_data->thread_num,