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.2.x] cloud_storage: fix segment materialisation race #13823

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #13796

In order to create a new materialised segment, one needs to grab units
from `materialized_resources` first. This is an async operation. By the
time units are acquired, said segment might have already been via a
different code path, resulting in the assertion in
`remote_partition::materialize_segment` triggering.
`remote_partition::aborted_transactions` was particularly susceptible to
this.

This patch fixes the issue by checking for the existence of the segment
and creating a segment (if needed) in the same scheduling task.
Functionally, for the read path, nothing should change.

(cherry picked from commit 3100f40)
@vbotbuildovich vbotbuildovich added this to the v23.2.x-next milestone Sep 29, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Sep 29, 2023
@piyushredpanda piyushredpanda marked this pull request as ready for review September 29, 2023 18:26
@piyushredpanda piyushredpanda merged commit bdcf384 into redpanda-data:v23.2.x Sep 29, 2023
19 of 23 checks passed
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.

None yet

2 participants