Skip to content
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

[v23.1.x] storage/record_batch_builder: Avoid intermediate std::vector #11854

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #11837
Fixes: #11853,

BenPope added 3 commits July 4, 2023 02:28
Use `= default` for destructor

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 8b1726e)
Move `add_raw_kv` definition to implementation file

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 030f8d5)
Some uses of `record_batch_builder` build very large batches,
resulting in oversize allocations in `std::vector _records`.

Remove the `std::vector` by serializing into an `iobuf` at the
point of `add_raw_kv`. This requires storing an `int32_t` for
the record count.

Fixes redpanda-data#10744
Fixes redpanda-data#10749

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit 9c6e1ee)
@vbotbuildovich vbotbuildovich added this to the v23.1.x-next milestone Jul 4, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jul 4, 2023
@vbotbuildovich vbotbuildovich requested a review from dotnwat July 4, 2023 02:28
@BenPope BenPope marked this pull request as ready for review July 4, 2023 09:50
@BenPope BenPope merged commit 85f9595 into redpanda-data:v23.1.x Jul 4, 2023
@BenPope BenPope modified the milestones: v23.1.x-next, v23.1.14 Jul 4, 2023
@BenPope BenPope self-assigned this Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants