Skip to content

[v25.3.x] cluster/namespaced_cache: stop eviction loop when no entries are evictable#30015

Merged
piyushredpanda merged 1 commit into
redpanda-data:v25.3.xfrom
vbotbuildovich:backport-pr-29991-v25.3.x-938
Mar 31, 2026
Merged

[v25.3.x] cluster/namespaced_cache: stop eviction loop when no entries are evictable#30015
piyushredpanda merged 1 commit into
redpanda-data:v25.3.xfrom
vbotbuildovich:backport-pr-29991-v25.3.x-938

Conversation

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

Backport of PR #29991

…table

When all entries in the cache are pinned (unevictable), the eviction
loop in insert() would repeatedly scan the entire LRU list up to _size
times, resulting in O(n^2) behavior. With 9000+ producers this causes
reactor stalls of 400ms+.

Fix by checking the return value of evict() in the loop condition so
the loop exits immediately when no evictable entry is found.

CORE-15947

(cherry picked from commit 4a4cc90)
@vbotbuildovich vbotbuildovich added this to the v25.3.x-next milestone Mar 31, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Mar 31, 2026
@piyushredpanda piyushredpanda merged commit 081b507 into redpanda-data:v25.3.x Mar 31, 2026
19 checks passed
@piyushredpanda piyushredpanda modified the milestones: v25.3.x-next, v25.3.12 Apr 1, 2026
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.

3 participants