Skip to content

branch-4.1: [fix](filecache) fix clear_file_cache right after reboot causing file cache size percent overflow #63410#63958

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63410-branch-4.1
Jun 2, 2026
Merged

branch-4.1: [fix](filecache) fix clear_file_cache right after reboot causing file cache size percent overflow #63410#63958
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63410-branch-4.1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 1, 2026

Cherry-picked from #63410

… cache size percent overflow (#63410)

Problem Summary: When file cache LRU restore creates a block from dump
metadata and later lazy loading finds the same hash/offset with a
smaller real file size, reset_range only updated the LRU queue size and
_cur_cache_size. The FileBlock range still kept the old restored size,
so a later async clear or eviction subtracted the old block size and
could underflow _cur_cache_size, producing huge size_percent values in
need-evict-cache-in-advance logs. This change makes reset_range update
the FileBlock range as the single place that keeps the FileBlock, LRU
queue, _cur_cache_size, and TTL size accounting consistent.
FileBlock::finalize now delegates the range shrink to reset_range
instead of changing the range before calling it.
@github-actions github-actions Bot requested a review from yiguolei as a code owner June 1, 2026 08:46
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen
Copy link
Copy Markdown
Contributor

run buildall

@yiguolei
Copy link
Copy Markdown
Contributor

yiguolei commented Jun 2, 2026

skip buildall

@yiguolei yiguolei merged commit 49267a7 into branch-4.1 Jun 2, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants