-
Notifications
You must be signed in to change notification settings - Fork 385
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
refactor(LayerManager): resident layers query #6634
Conversation
2430 tests run: 2319 passed, 0 failed, 111 skipped (full report)Flaky tests (3)Postgres 16
Postgres 15
Code coverage (full report)
The comment gets automatically updated with the latest test results
c66553e at 2024-02-12T14:28:11.599Z :recycle: |
I had not expected heatmap be using the same API we explicitly named |
d082519
to
2bfb450
Compare
If we contend for the lock, then won't we be missing out on evictions in a situation when there is high contention? In the worst case we'd not evict at all, right? |
Correct for both. This is however for a single timeline. It is thought to be unlikely that we could have more than 8 timelines in critical sections, or at least I thought so before starting to write this, earlier had noted the following:
There is of course one more additional source for why the try_read would fail: ingestion. We would have to be hitting the lock very precisely when walreceiver is committing, page requests would similarly wait then. This was not my idea, nor am I sure if this works. Seems however the unluckyness cases would have to be really unlucky. In the meantime, we should still evict from other tenants. |
previous version was piggybacking on get_local_layers_for_disk_usage_eviction AND joining the data over to RemoteTimelineClient. this was strictly worse than just iterating over the (new) resident_layers query results because at best RemoteTimelineClient is up to date, but at worst it is missing a layer we have just flushed. Layer otherwise has all of the information needed.
not building the intermediate vec might have an impact with full pageserver.
ca98971
to
5d4d636
Compare
we lose on the layer name logging, but no one was really looking at those loggings either. we still have the ratelimited warn.
5d4d636
to
b4ef056
Compare
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'm still not really convinced that the new behaviour on contention --- us skipping eviction entirely --- is the right call. If there is no contention, there is no real difference either as in that instance the blocking wait just immediately yields the result.
But @koivunej has told me on slack that there is future work building on this, so I'm approving.
Yes, it is unclear so I'll just drop the option returning for now. |
…wlock" This reverts commit 68054b0.
Refactor out layer accesses so that we can have easy access to resident layers, which are needed for number of cases instead of layers for eviction. Simplifies the heatmap building by only using Layers, not RemoteTimelineClient. Cc: #5331
Refactor out layer accesses so that we can have easy access to resident layers, which are needed for number of cases instead of layers for eviction. Simplifies the heatmap building by only using Layers, not RemoteTimelineClient.
Cc: #5331