-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
[RFC] Posix API support for Async Read and Poll APIs #9578
Conversation
3f5aeac
to
80ed59a
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 excited in seeing progress on this! Thank you for working on it.
include/rocksdb/file_system.h
Outdated
virtual IOStatus ReadAsync(const IOOptions& /*opts*/, IODebugContext* /*dbg*/, | ||
FSReadRequest* /*req*/, | ||
std::function<void(FSReadResponse* resp)> /*cb*/, | ||
IOHandle* /*io_handle*/) { |
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.
It's interesting that we are supporting both callback and polling. Is it very hard to implement? Thinking about the data race between the two, it feels not easy.
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 didn't think about this, but its an interesting idea. I guess polling and async callback initially made sense because PosixEnv requires polling the IO uring, whereas warm storage can complete an IO asynchronously. But a warm storage Poll() implementation could handle the required synchronization by itself and just return the results.
|
||
#if defined(ROCKSDB_IOURING_PRESENT) | ||
// Step 1: io_uring_queue_init | ||
struct io_uring* iu = nullptr; |
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.
A uring is not thread safe. Do we expect the caller not to make ReadAsync() call in one thread and polling in another? It feels nicer if we can provide an interface that isn't prone to misuse.
Do we consider for a user to pass a async call context that contains an IO Uring?
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.
They're supposed to be in the same thread. Do you mean a way to enforce that?The io_handle is context that the ReadAsync() implementation can allocate, and will be passed back to it in Poll(). PosixEnv can store a pointer to the IO uring in it, and compare against thread_local_io_urings_->Get() to detect if the call is being made on a different thread..
80ed59a
to
78062aa
Compare
78062aa
to
851ae95
Compare
851ae95
to
63736c3
Compare
e380387
to
35aee7e
Compare
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
35aee7e
to
421ba3e
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
1 similar comment
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
87c457d
to
ca00d4d
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
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.
LGTM. Left a few comments. They're not major, but hopefully we can address them.
Summary: Provide support for Async Read and Poll in Posix file system using IOUring. Test Plan:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
ca00d4d
to
faa3f83
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
1 similar comment
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
71c03ce
to
0c0139e
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
@akankshamahajan15 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: Provide support for Async Read and Poll in Posix file system using IOUring. Pull Request resolved: facebook#9578 Test Plan: In progress Reviewed By: anand1976 Differential Revision: D34690256 Pulled By: akankshamahajan15 fbshipit-source-id: 291cbd1380a3cb904b726c34c0560d1b2ce44a2e
Summary: Provide support for Async Read and Poll in Posix file system using IOUring. Pull Request resolved: facebook#9578 Test Plan: In progress Reviewed By: anand1976 Differential Revision: D34690256 Pulled By: akankshamahajan15 fbshipit-source-id: 291cbd1380a3cb904b726c34c0560d1b2ce44a2e
Summary: Provide support for Async Read and Poll in Posix file system using IOUring.
Test Plan: In progress