Skip to content

branch-4.1: [fix](file-cache): speed up LRU restore startup path #65174#65953

Open
github-actions[bot] wants to merge 1 commit into
branch-4.1from
auto-pick-65174-branch-4.1
Open

branch-4.1: [fix](file-cache): speed up LRU restore startup path #65174#65953
github-actions[bot] wants to merge 1 commit into
branch-4.1from
auto-pick-65174-branch-4.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #65174

## Proposed changes

- Avoid O(N^2) protobuf repeated-field erase during LRU dump restore by
reading groups and entries with parser cursors.
- Add two-phase multi-cache creation so different file cache paths
initialize and restore in parallel, then publish caches in the original
config order to keep hash routing stable.
- Keep duplicate cache path handling and ignore_broken_disk behavior
consistent with the previous startup path.

## Testing

- `git diff --check`
- `DORIS_TOOLCHAIN=clang DISABLE_BE_JAVA_EXTENSIONS=ON
ENABLE_INJECTION_POINT=ON ENABLE_CACHE_LOCK_DEBUG=0 ENABLE_PCH=0 sh
run-be-ut.sh --run
--filter=CacheLRUDumperTest.*:BlockFileCacheTest.create_file_caches_preserves_config_order`
- `DORIS_TOOLCHAIN=clang DISABLE_BE_JAVA_EXTENSIONS=ON
ENABLE_INJECTION_POINT=ON ENABLE_CACHE_LOCK_DEBUG=0 ENABLE_PCH=0 sh
run-be-ut.sh --run
--filter=BlockFileCacheTest.test_lru_log_record_replay_dump_restore:BlockFileCacheTest.test_lru_duplicate_queue_entry_restore:BlockFileCacheTest.lru_restore_size_mismatch_does_not_underflow_on_clear`
@github-actions
github-actions Bot requested a review from yiguolei as a code owner July 23, 2026 07:37
@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

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 71.57% (73/102) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.72% (28530/39230)
Line Coverage 56.21% (308665/549143)
Region Coverage 53.43% (257767/482407)
Branch Coverage 54.34% (113131/208192)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 71.57% (73/102) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.72% (28530/39230)
Line Coverage 56.21% (308666/549143)
Region Coverage 53.42% (257686/482407)
Branch Coverage 54.34% (113132/208192)

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.

2 participants