common/async: spawn_group and parallel_for_each()#50005
Closed
cbodley wants to merge 32 commits intoceph:wip-coro-after-reeffrom
Closed
common/async: spawn_group and parallel_for_each()#50005cbodley wants to merge 32 commits intoceph:wip-coro-after-reeffrom
cbodley wants to merge 32 commits intoceph:wip-coro-after-reeffrom
Conversation
adamemerson
approved these changes
Feb 13, 2023
Needed to fix coroutine detection under Clang TODO: update boost package sha1 in install-deps.sh when we have packages uploaded Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Previously we had versions of all the calls that took an int64_t and optional key and namespace. This didn't really offer much benefit and doubled the maintenance burden for changing anything. As such just make the IOContext constructor non-explicit, and make all its mutators return the same IOContext so people can supply them builder-style if they want to. Also don't wrap things in 'optional' when the underlying library doesn't. The callers just end up having to wrap and unwrap with value-or repeatedly. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This form of completion handling is compatible with C++20 Completions and generally more flexible stuff. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
The lock will continue to be held over the 'dispatch' with C++20 coroutines. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Apparently in some cases we were using references to objects on the caller stack that happen to no longer exist if the caller's stack goes away. C++20 Coroutines tickled this bug. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Use `min` rather than `max` when deciding how much we need to read in `read()`. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Just as a demonstration to see how well they work and how to put things together with them. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
In the `destroy_` functions of `CompletionImpl` we were getting the associated allocator after moving out of the handler into the call to `bind_and_forward`. This was triggering a crash on null-pointer access in operations made with `co_composed`. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Since reading CLS values in a friendly way requires calling out to RADOS then decoding the returned structure, make a function to help with that. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Google Test does not support C++ coroutines, so kludge together a test harness that supports coroutines reasonably well. Also add a couple utility functions. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
…utines Signed-off-by: Casey Bodley <cbodley@redhat.com>
We should not be using std::list everywhere, and this is an excellent time to switch. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
If our decoder function returns a tuple of multiple values, flatten it so our signature is `void(error_code, T, U, V)` not `void(error_code, std::tuple<T, U, V>)`. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
And return them to the client by setting the error cod and result in the vector and returning an error from the operation as a whole. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Since they can be reported now, report them Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
27c3c39 to
9ceab5f
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
c74ea5a to
90a6bc7
Compare
9ceab5f to
88c6d6d
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Contributor
Author
|
merged into #49737 |
This was referenced Apr 26, 2024
This file contains hidden or 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
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.
adds a
spawn_grouptemplate class for fork-join parallelism withboost::asio::awaitable<void>coroutines, and builds aparallel_for_each()algorithm (modeled after seastar::parallel_for_each) on topthe main use for rgw multisite is where we spawn a coroutine for each log shard, then wait for all of them to complete
the existing
ceph::async::co_throttlefrom #49720 can be used for this, but it's interface was designed for bounded concurrency, so is less convenient to use in the unbounded fork-join case: the caller has to co_await each spawn separately and handle potential errors from other coroutines. withspawn_group, errors are reported through a single co_await on thewait()member functionasio provides a generic fork-join algorithm in asio::experimental::make_parallel_group(), but it requires the group size to be known at compile time. for multisite, the shard counts are variable and come from ceph.conf
spawn_group example
parallel_for_each() example
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows