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: maybe_yield when building a batch in kvstore::save_snapshot #11927

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #11809

The function passed to `for_each_record_async` might not return a future.

This is the case when for_each_record_async` is used primary for the
purpose of yeilding, rather than to accept an async function.

`futurize_invoke` the passed function so that the call site doesn't have
to be modified.

Signed-off-by: Ben Pope <[email protected]>
(cherry picked from commit e24eb39)
This is necessary for the next commit.

Signed-off-by: Ben Pope <[email protected]>
(cherry picked from commit 68d951b)
54c0a3f made the
serialization of the batch async, but it's possible for the
batch builder to also cause reactor stalls, as seen on
a live system running v23.1.12 (of about 150ms)

Add a mutex to protect _db and _next_offset
* `maybe_yield` in the builder loop to avoid reactor stalls whilst saving
* Use `for_each_record_async` to avoid reactor stalls whilst loading
* Use `for_each_record_async` to avoid reactor stalls whilst replaying

Signed-off-by: Ben Pope <[email protected]>
(cherry picked from commit 310fb33)
@vbotbuildovich vbotbuildovich added this to the v23.1.x-next milestone Jul 6, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jul 6, 2023
@vbotbuildovich vbotbuildovich requested a review from jcsp July 6, 2023 18:14
@BenPope BenPope marked this pull request as ready for review July 6, 2023 18:40
@BenPope BenPope modified the milestones: v23.1.x-next, v23.1.14 Jul 6, 2023
@BenPope BenPope self-assigned this Jul 6, 2023
@BenPope BenPope removed the request for review from jcsp July 6, 2023 18:41
@BenPope BenPope merged commit 4548db5 into redpanda-data:v23.1.x Jul 6, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants