-
Notifications
You must be signed in to change notification settings - Fork 552
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
kafka/protocol: use frag vec for offset fetch #15918
Conversation
We've seen oversized allocations in many partition test with group fetches, switch to using frag vec to prevent that. Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
@@ -62,7 +63,8 @@ struct offset_fetch_response final { | |||
data.error_code = error_code::none; | |||
if (topics) { | |||
for (auto& topic : *topics) { | |||
std::vector<offset_fetch_response_partition> partitions; | |||
small_fragment_vector<offset_fetch_response_partition> |
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.
question: I'm probably missing some context here, but do we have a sense of what the "usual" size of this vector might be? As in, whether the small_fragment_vector
fragment size (1KiB I believe) is the best/safest choice.
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.
Yeah large_fragment_vector is the other option, which is close to 128KiB and probably fine? I'm not really sure to be honest. I'll switch
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.
fetchable_partition_response
is also small? So I guess it's expected to stay small because it's only data from this shard I believe?
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.
ya, i don't really know. I assume you could use fragmented_vector
with any arbitrary fragment size if you were so inclined (rather than one of the convenience typedefs), but it's not clear to me whether there's any special reason to do so.
Certainly the 1KiB fragment size should prevent bad_alloc
in all cases, so I don't want to hold this up. Just curious mostly.
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
/backport v23.3.x |
/backport v23.2.x |
/backport v23.1.x |
Failed to create a backport PR to v23.1.x branch. I tried:
|
We've seen oversized allocs with this field when group fetches are used.
This switches to a frag vec for partitions.
Fixes: #15909
Backports Required
Release Notes
Bug Fixes