-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement LFC prewarm #9197
Implement LFC prewarm #9197
Conversation
5265 tests run: 5050 passed, 0 failed, 215 skipped (full report)Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
8852e8a at 2024-10-27T17:12:02.966Z :recycle: |
endpoint.stop() | ||
endpoint.start() | ||
|
||
time.sleep(5) # give prewarm BGW some time to proceed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be best if we were able to wait for this to warming to complete, as this 5s might not be enough under a different test suite ordering. This would help with the variable load of test suite on runners.
Perhaps the most natural way would be an sql function we could select over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that some extra API function is needed for waiting until LFC is prewarmed.
The main idea of prewarm is to perform it in background.
But I agree with you that it will be better to make test more reliable and less fluky.
This is why I replace 5 seconds sleep with the loop which checking number of prewired pages until it reaches specified threshold. Also it should reduce test time.
…ow it is avoided now
Replaced by #9587 |
Problem
We periodically need to restart computes.
As far as performance of Neon critically depends on local caches (shared buffers or LFC), it is important to provide fast rewarm of restarted node.
Standard Postgres pg_prewarm extension provides autoprewarm mode in which is saves state of shared buffers and loads it after restart. But current autoscaling policy assumes small shared_buffers and large LFC. So we need to prewire LFC rather than shared_buffers.
Summary of changes
This PR implements the following:
neon.file_cache_prewarm_limit
most frequently accessed chunks) in AUX file. This AUX file is automatically included in basebackup and loaded on startupPossible concerns:
neon.file_cache_prewarm_limit
prewarm_requersted
andprewarm_started
flags to skip updates of LFC in case of possible risk of contention.TODO:
Checklist before requesting a review
Checklist before merging