Skip to content

Commit 46f9b96

Browse files
author
Konstantin Knizhnik
committed
Do not assign max(lsn) to maxLastWrittenLsn in SetLastWrittenLSNForBlockv
1 parent 48f3836 commit 46f9b96

File tree

1 file changed

+3
-1
lines changed
  • src/backend/access/transam

1 file changed

+3
-1
lines changed

src/backend/access/transam/xlog.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -6938,6 +6938,7 @@ SetLastWrittenLSNForBlockv(const XLogRecPtr *lsns, RelFileLocator relfilenode,
69386938
LastWrittenLsnCacheEntry* entry;
69396939
BufferTag key;
69406940
bool found;
6941+
XLogRecPtr max = InvalidXLogRecPtr;
69416942

69426943
if (lsns == NULL || nblocks == 0 || lastWrittenLsnCacheSize == 0 ||
69436944
relfilenode.relNumber == InvalidOid)
@@ -6981,11 +6982,12 @@ SetLastWrittenLSNForBlockv(const XLogRecPtr *lsns, RelFileLocator relfilenode,
69816982
}
69826983
/* Link to the end of LRU list */
69836984
dlist_push_tail(&XLogCtl->lastWrittenLsnLRU, &entry->lru_node);
6985+
max = Max(max, lsn);
69846986
}
69856987

69866988
LWLockRelease(LastWrittenLsnLock);
69876989

6988-
return lsn;
6990+
return max;
69896991
}
69906992

69916993
/*

0 commit comments

Comments
 (0)