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

[v24.3.x] [CORE-7257] cloud_storage: Remove assertion in remote_segment #24292

Open
wants to merge 2 commits into
base: v24.3.x
Choose a base branch
from

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #24265

Signed-off-by: Evgeny Lazin <[email protected]>
(cherry picked from commit b3ce4e1)
Previously, the remote_segment was assuming that there is no concurrency
and we are creating only one instance of it per segment. The
'remote_segment' depends on cloud storage cache which acts as a shared
global state for all 'remote_segment' instances. If two segments are
created in parallel there is a slight chance that they could interact
through this global state. If one segment starts download the cache will
be in the 'in-progress' state for this key. Then another segment may try
to trigger download and see the 'in-progress' state and trigger
assertion.

Normally, we're not creating two instancess of the same segment in TS.
But there is a slight chance that under very high contention when the
materialized segments are churning rapidly we will evict the segment and
immediately recreate it. If both of them are in the right state they may
trigger the assertion. The segments are evicted by the
'remote_partition' which moves them to the eviction queue. So basically,
the segment may exist in the eviction queue for very short time. But
under hight contention it could be enough.

This commit fixes this issue by turning the assertion into the
exception. The exception is propagated to the 'data_stream' call and
then to the client.

Signed-off-by: Evgeny Lazin <[email protected]>
(cherry picked from commit c2039dd)
@vbotbuildovich vbotbuildovich added this to the v24.3.x-next milestone Nov 25, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Nov 25, 2024
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