-
Notifications
You must be signed in to change notification settings - Fork 579
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
Incremental fetch support #168
Incremental fetch support #168
Conversation
can you rebase w/ dev |
0a57652
to
f8297f2
Compare
@mmaslankaprv merge conflict |
f8297f2
to
9c43c12
Compare
@senior7515 @dotnwat rebased. |
src/v/model/fundamental.h
Outdated
topic_partition() = default; | ||
topic_partition(model::topic t, model::partition_id i) | ||
: topic(std::move(t)) | ||
, partition(i) {} | ||
|
||
topic_partition(model::topic_partition_view view) // NOLINT |
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.
why nolint? does clang tidy want explcit?
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.
exactly, it is complaining about explicit
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.
from what type are we taking implicit conversions?
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.
When I think of it this conversion i.e. topic_partition_view
-> topic_partition
as it involves copying.
src/v/kafka/fetch_session.h
Outdated
+ partitions.size() * sizeof(fetch_partition); | ||
} | ||
|
||
underlying_t::iterator begin() { return partitions.begin(); } |
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.
use type alias at the top.
also define begin() const
and end() const
see iobuf for alias examples.
clang-release ci on google cloud build
|
b953d42
to
ab1ffc4
Compare
ff998bc
to
4d8b90b
Compare
Introduced `model::topic_partition_view` to avoid excessive topic_partition copying. Signed-off-by: Michal Maslanka <michal@vectorized.io>
Introduced `kafka::fetch_session` type. The `fetch_session` represents a single session maintained in memory on server for a consumer. Maintaining a list of partition that consumer is interested in on the server sides allow to reduce overhead of transmitting the whole partitions list between server and consumer every time the consumer fetches data. Signed-off-by: Michal Maslanka <michal@vectorized.io>
Added configuration option for controlling fetch session eviction timeout. i.e. the time after inactive session is being evicted. Signed-off-by: Michal Maslanka <michal@vectorized.io>
Implemented fetch session cache. Fetch session cache is a core local cache holding incremental fetch sessions. Each core local cache instance assigns session ids that are unique for the node (non overlapping ranges of ids are assigned to each core). The cache evicts not used sessions after configurable period of inactivity. Fetch session cache will stop adding new sessions after its max memory usage is reached. Signed-off-by: Michal Maslanka <michal@vectorized.io>
When processing the fetch request we have to be able to access core local fetch sessions cache. Added the sessions cache to `kafka::request_context`. Signed-off-by: Michal Maslanka <michal@vectorized.io>
Using the fetch sessions cache to implement incremental fetch requests handling. Caching fetch sessions allow to reduce overhead of sending whole list of partitions every time consumer issues the fetch request. Signed-off-by: Michal Maslanka <michal@vectorized.io>
Signed-off-by: Michal Maslanka <michal@vectorized.io>
4d8b90b
to
838e887
Compare
Incremental fetch handing in redpanda.
Fixes #25
Checklist
When referencing a related issue, remember to migrate duplicate stories from the
external tracker. This is not relevant for most users.