Skip to content
Merged
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
5 changes: 1 addition & 4 deletions src/backend/access/transam/xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -6954,7 +6954,6 @@ SetLastWrittenLSNForBlockv(const XLogRecPtr *lsns, RelFileLocator relfilenode,
for (int i = 0; i < nblocks; i++)
{
XLogRecPtr lsn = lsns[i];
max = Max(max, lsn);

key.blockNum = blockno + i;
entry = hash_search(lastWrittenLsnCache, &key, HASH_ENTER, &found);
Expand Down Expand Up @@ -6983,11 +6982,9 @@ SetLastWrittenLSNForBlockv(const XLogRecPtr *lsns, RelFileLocator relfilenode,
}
/* Link to the end of LRU list */
dlist_push_tail(&XLogCtl->lastWrittenLsnLRU, &entry->lru_node);
max = Max(max, lsn);
}

if (max > XLogCtl->maxLastWrittenLsn)
XLogCtl->maxLastWrittenLsn = max;
Comment on lines -6988 to -6989
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if XLogCtl->maxLastWrittenLsn isn't the maximum of all lastWrittenLsns, then what is it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is maximal last written LSN of pages not present in the cache.
So this value is used for page not found in the LwLSN cache.


LWLockRelease(LastWrittenLsnLock);

return max;
Expand Down