Skip to content

[PBCKP-354] fixing stuck test validate.ValidateTest.test_validate_wal… #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/parsexlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2015-2019, Postgres Professional
* Portions Copyright (c) 2015-2022, Postgres Professional
*
*-------------------------------------------------------------------------
*/
Expand Down Expand Up @@ -1424,26 +1424,19 @@ XLogThreadWorker(void *arg)
elog(ERROR, "Thread [%d]: Interrupted during WAL reading",
reader_data->thread_num);

/*
* We need to switch to the next WAL segment after reading previous
* record. It may happen if we read contrecord.
*/
if (reader_data->need_switch &&
!SwitchThreadToNextWal(xlogreader, thread_arg))
break;

record = WalReadRecord(xlogreader, thread_arg->startpoint, &errormsg);

if (record == NULL)
{
XLogRecPtr errptr;

/*
* There is no record, try to switch to the next WAL segment.
* We need to switch to the next WAL segment after reading previous
* record. It may happen if we read contrecord.
* Usually SimpleXLogPageRead() does it by itself. But here we need
* to do it manually to support threads.
*/
if (reader_data->need_switch && errormsg == NULL)
if (reader_data->need_switch)
{
if (SwitchThreadToNextWal(xlogreader, thread_arg))
continue;
Expand Down