Skip to content

Conversation

@knizhnik
Copy link

No description provided.

Comment on lines -6988 to -6989
if (max > XLogCtl->maxLastWrittenLsn)
XLogCtl->maxLastWrittenLsn = max;
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.

github-merge-queue bot pushed a commit to neondatabase/neon that referenced this pull request Jan 24, 2025
…okv (#10474)

## Problem

See #10281

`SetLastWrittenLSNForBlockv` is assigning max(lsn) to
`maxLastWrittenLsn` while its should contain only max LSN not present in
LwLSN cache. It case unnecessary waits in PS.

## Summary of changes

Restore status-quo for pg17.

Related Postgres PR: neondatabase/postgres#563

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
@knizhnik knizhnik merged commit 46f9b96 into REL_17_STABLE_neon Jan 24, 2025
1 check passed
@knizhnik knizhnik deleted the fix_set_lwlsnv branch January 24, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants