Skip to content

Commit ae71684

Browse files
committed
Fix bug: In parallel WAL reading we may not close previous file, close it manually
1 parent c22b3e4 commit ae71684

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/parsexlog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ switchToNextWal(XLogReaderState *xlogreader, xlog_thread_arg *arg)
161161

162162
/* Adjust next record position */
163163
XLogSegNoOffsetToRecPtr(private_data->xlogsegno, 0, arg->startpoint);
164+
/* We need to close previously opened file if it wasn't closed earlier */
165+
CleanupXLogPageRead(xlogreader);
164166
/* Skip over the page header and contrecord if any */
165167
found = XLogFindNextRecord(xlogreader, arg->startpoint);
166168

0 commit comments

Comments
 (0)