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.3.x] Made storage::readers_cache size limited #16963

Conversation

mmaslankaprv
Copy link
Member

Backport of PR #16846
Fixes: #16947

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 4278057)
Added property which allows controlling maximum number of readers kept
in cache per ntp. The value was previously unbounded which may lead to
a situation in which readers cache grew and caused out of memory error.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 4399ba4)
@mmaslankaprv mmaslankaprv added this to the v23.3.7 milestone Mar 8, 2024
@mmaslankaprv mmaslankaprv linked an issue Mar 8, 2024 that may be closed by this pull request
Added size based eviction to `storage::readers_cache`. Previously the
eviction was only time based which may lead to a problem when multiple
readers were created for the same NTP. Now with the size based eviction
the readers cache size is bounded and will not grow indefinitely.

Note on backward compatibility:

Previously the size of cache was unbounded. In this commit we change the
policy to keep up to 200 readers per ntp. This number is still large
enough not cause any issues as it would mean that there are 200
concurrent readers reading a single partition at the same time.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit a494de6)
Added jitter to readers cache eviction timer to prevent all eviction
timers from firing at the same time.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit d3b07de)
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.

[v23.3.x] Made storage::readers_cache size limitted
3 participants