-
Notifications
You must be signed in to change notification settings - Fork 635
k/generator: do not use standard vectors for offset commit protocol #26280
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
base: dev
Are you sure you want to change the base?
k/generator: do not use standard vectors for offset commit protocol #26280
Conversation
Implementation of `then()` uses a `std::forward<Func>` when creating continuation. Passing in an lvalue ref to `fut.then(...)` forces the copy. Replaced it with lambda capturing the reference to `func` not to have to copy the whole `func` Signed-off-by: Michał Maślanka <michal@redpanda.com>
ca99c81
to
dc94b03
Compare
Retry command for Build#66564please wait until all jobs are finished before running the slash command
|
CI test resultstest results on build#66564
|
In transactional and standard offset commit request and replies topic partition offsets are stored as a vectors. The number of partitions/topics in a single request may grow large, therefore we should use a fragmented vector when handling those requests. Changed the Kafka protocol generator overrides for offset commit requests and responses to use default `chunked_vector` Signed-off-by: Michał Maślanka <michal@redpanda.com>
dc94b03
to
50cf97b
Compare
return fut.then(func).handle_exception( | ||
[&eptr](std::exception_ptr ex) mutable { | ||
return fut.then([&func] { return func(); }) | ||
.handle_exception([&eptr](std::exception_ptr ex) mutable { |
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.
this looks ok, but i'm having trouble determining if this is safe w.r.t. to guarnateeing that the retry function will always execute with a fresh version of it's original captures. i think that is true if func
is the user provided function, but i'm less sure that is true for gated_retry_with_mitigation_impl
which wraps the user function and how the const-ness of operator()()
propogates to the captured function.
maybe @BenPope knows. i've seen this exact function have similar proposals made recently and I'm not sure where things stand with those changes and if there are footguns here.
--
more broadly, though, and not necessarily blocking this PR: do we want to optimize for large captures? it seems like the caller could always arrange for a large object to be captured as a reference, shared pointer, etc...?
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.
relevant? #26215 (comment)
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.
the static assert pass, i.e. it should not be possible to do std::move()
in the body of operator()()
of the func
In transactional and standard offset commit request and replies topic partition offsets are stored as a vectors. The number of partitions/topics in a single request may grow large, therefore we should use a fragmented vector when handling those requests.
Changed the Kafka protocol generator overrides for offset commit requests and responses to use default
chunked_vector
Backports Required
Release Notes
Improvements