diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index d5ac2d87380..08a1d08b547 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -3577,7 +3577,6 @@ multixact_redo(XLogReaderState *record) else if (info == XLOG_MULTIXACT_TRUNCATE_ID) { xl_multixact_truncate xlrec; - int64 pageno; memcpy(&xlrec, XLogRecGetData(record), SizeOfMultiXactTruncate); @@ -3602,15 +3601,6 @@ multixact_redo(XLogReaderState *record) SetMultiXactIdLimit(xlrec.endTruncOff, xlrec.oldestMultiDB, false); PerformMembersTruncation(xlrec.startTruncMemb, xlrec.endTruncMemb); - - /* - * During XLOG replay, latest_page_number isn't necessarily set up - * yet; insert a suitable value to bypass the sanity test in - * SimpleLruTruncate. - */ - pageno = MultiXactIdToOffsetPage(xlrec.endTruncOff); - pg_atomic_write_u64(&MultiXactOffsetCtl->shared->latest_page_number, - pageno); PerformOffsetsTruncation(xlrec.startTruncOff, xlrec.endTruncOff); LWLockRelease(MultiXactTruncationLock); diff --git a/src/include/access/slru.h b/src/include/access/slru.h index d5ca3447208..f8bf1f1430f 100644 --- a/src/include/access/slru.h +++ b/src/include/access/slru.h @@ -110,7 +110,9 @@ typedef struct SlruSharedData /* * latest_page_number is the page number of the current end of the log; * this is not critical data, since we use it only to avoid swapping out - * the latest page. + * the latest page. (An exception: an accurate latest_page_number is + * needed on pg_multixact/offsets to replay WAL generated with older minor + * versions correctly. See RecordNewMultiXact().) */ pg_atomic_uint64 latest_page_number;