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

[v22.3.x] storage: fix race between rolls and readers cache #9708

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #9676

This commit fixes a race between segment rolls (releasing the appender,
more specifically) and `puts` to the `readers_cache` from the read path.

Previously, `segment::release_appender_in_background` did not hold on to
the readers cache lock while acquiring the segment write lock. If the
entry was inserted into the cache before the write lock request was
registered into the waiters list, then the write lock would only be
granted after the the new entry was evicted from the `readers_cache` (30
seconds is the default eviction timeout).

Having a write lock sit in the waiters list also blocks all read lock
requests that come in after it. This had knock-on effects to the cloud
storage upload path, which expects to be able to acquire segment read
locks within 30 seconds.

(cherry picked from commit 0c32f72)
@vbotbuildovich vbotbuildovich added this to the v22.3.x-next milestone Mar 29, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Mar 29, 2023
@VladLazar VladLazar self-assigned this Mar 29, 2023
@VladLazar VladLazar marked this pull request as ready for review March 30, 2023 11:39
@VladLazar VladLazar merged commit 0a24969 into redpanda-data:v22.3.x Mar 30, 2023
@vshtokman vshtokman modified the milestones: v22.3.x-next, v22.3.16 Apr 11, 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.

4 participants