-
Notifications
You must be signed in to change notification settings - Fork 456
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
Remove BlockReader::read_blk
in favour of BlockCursor
#5015
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arpad-m
requested review from
fprasx,
problame and
koivunej
and removed request for
a team
August 16, 2023 21:23
1624 tests run: 1551 passed, 0 failed, 73 skipped (full report)The comment gets automatically updated with the latest test results
a1f0143 at 2023-08-25T08:50:14.871Z :recycle: |
This was referenced Aug 17, 2023
arpad-m
force-pushed
the
arpad/pageserver_cursor_read_blk
branch
2 times, most recently
from
August 18, 2023 18:56
523a54e
to
7c106f7
Compare
Rebased after merge of #4994 |
arpad-m
force-pushed
the
arpad/pageserver_cursor_read_blk
branch
from
August 18, 2023 19:18
7c106f7
to
8d3b0d3
Compare
koivunej
reviewed
Aug 18, 2023
koivunej
reviewed
Aug 18, 2023
koivunej
reviewed
Aug 18, 2023
koivunej
reviewed
Aug 18, 2023
arpad-m
force-pushed
the
arpad/pageserver_cursor_read_blk
branch
from
August 23, 2023 15:47
8d3b0d3
to
d63f31d
Compare
At least in the cases where the concrete type won't be known clearly.
Also, require BlockReader implementors to impl block_cursor.
arpad-m
force-pushed
the
arpad/pageserver_cursor_read_blk
branch
from
August 24, 2023 21:00
d63f31d
to
3719b16
Compare
koivunej
reviewed
Aug 25, 2023
koivunej
reviewed
Aug 25, 2023
koivunej
approved these changes
Aug 25, 2023
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.
Adapter, DeltaLayerInner::load_keys now have extra code, but this should be ok to leave, I'll clean them up.
problame
pushed a commit
that referenced
this pull request
Aug 30, 2023
## Problem `read_blk` does I/O and thus we would like to make it async. We can't make the function async as long as the `PageReadGuard` returned by `read_blk` isn't `Send`. The page cache is called by `read_blk`, and thus it can't be async without `read_blk` being async. Thus, we have a circular dependency. ## Summary of changes Due to the circular dependency, we convert both the page cache and `read_blk` to async at the same time: We make the page cache use `tokio::sync` synchronization primitives as those are `Send`. This makes all the places that acquire a lock require async though, which we then also do. This includes also asyncification of the `read_blk` function. Builds upon #4994, #5015, #5056, and #5129. Part of #4743.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
We want to make
read_blk
an async function, but outside ofasync_trait
, which allocates, and nightly features, we can't use async fn's in traits.Summary of changes
BlockReader::read_blk
in favour of using block cursors.BlockReaderRef
enum that lists all implementors ofBlockReader::read_blk
.BlockReader::read_blk
and move its implementations into inherent functions on the types instead.We don't turn
read_blk
into an async fn yet, for that we also need to modify the page cache. So this is a preparatory PR, albeit an important one.Part of #4743.
Checklist before requesting a review
Checklist before merging