[Bugfix] Fall back to T1 when ARC cannot reclaim enough entries from T2 (#55461)

Signed-off-by: Wang Zupeng <zupenwang@gmail.com>
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zupeng Wang
2026-09-06 13:28:19 +03:00
committed by GitHub
co-authored by Codex
parent 9afb878a55
commit dd0760165c
2 changed files with 62 additions and 1 deletions
+7 -1
View File
@@ -145,9 +145,15 @@ class ARCCachePolicy(CachePolicy):
if candidate is None:
entry = next_candidate(t2_iter)
if entry is not None:
candidate = (*entry, False)
if candidate is None:
entry = next_candidate(t1_iter)
if entry is None:
return None
candidate = (*entry, False)
candidate = (*entry, True)
virtual_t1_size -= 1
candidates.append(candidate)