pageserver: finish vectored get early #7490
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
If the previous step of the vectored left no further keyspace to investigate
(i.e. keyspace remains empty after removing keys completed in the previous step),
then we'd still grab the layers lock, potentially add an in-mem layer to the fringe and
at some further point read its index without reading any values from it.
Summary of changes
If there's nothing left in the current keyspace, then skip the search and just select
the next item from the fringe as usual.
When running
test_pg_regress[release-pg16]
with the vectored read path for singulargets this improved perf drastically:
Legend:
blue - without this patch
orange - with this patch
Correctness
Since no keys remained from the previous range (i.e. we are on a leaf node) there's nothing
that search can find in deeper nodes.
Checklist before requesting a review
Checklist before merging