From 93d59367dd30ad5b9b8b5eebb38ec85969418190 Mon Sep 17 00:00:00 2001 From: Takashi Menjo Date: Tue, 8 Dec 2020 17:25:10 +0900 Subject: [PATCH v3 10/10] Revert "Speculative-map WAL segments" This reverts commit ca00a5c6faca758faa9e386cb980eb8ead9900db. --- src/backend/access/transam/xlog.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index b4fa70aa2f..f9a3716006 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -1029,8 +1029,6 @@ XLogInsertRecord(XLogRecData *rdata, info == XLOG_SWITCH); XLogRecPtr StartPos; XLogRecPtr EndPos; - XLogRecPtr ProbablyInsertPos; - XLogSegNo ProbablyInsertSegNo; bool prevDoPageWrites = doPageWrites; /* we assume that all of the record header is in the first chunk */ @@ -1040,23 +1038,6 @@ XLogInsertRecord(XLogRecData *rdata, if (!XLogInsertAllowed()) elog(ERROR, "cannot make new WAL entries during recovery"); - /* Speculatively map a segment we probably need */ - ProbablyInsertPos = GetInsertRecPtr(); - XLByteToSeg(ProbablyInsertPos, ProbablyInsertSegNo, wal_segment_size); - if (ProbablyInsertSegNo != openLogSegNo) - { - if (mappedPages != NULL) - { - Assert(beingUnmappedPages == NULL); - Assert(beingClosedLogSegNo == 0); - beingUnmappedPages = mappedPages; - beingClosedLogSegNo = openLogSegNo; - } - mappedPages = XLogFileMap(ProbablyInsertSegNo, &pmemMapped); - Assert(mappedPages != NULL); - openLogSegNo = ProbablyInsertSegNo; - } - /*---------- * * We have now done all the preparatory work we can without holding a -- 2.25.1