Uh oh!
There was an error while loading. Please reload this page.
branch-4.0: [fix](filecache) avoid BE crash when finalize misses local cache writer #62389 - #63178
Conversation
…er (#62389) ## Problem `FSFileCacheStorage::finalize()` relied on `DCHECK` to assume the writer entry always existed in `_key_to_writer`. In release builds a missing writer entry could still fall through, dereference `end()`, and crash BE. ## Root Cause When `(hash, offset)` is missing from `_key_to_writer`, the current finalize path moves and erases through an invalid iterator. The target branch already uses the newer `finalize(key, size)` signature, so this PR ports the hardening change to that path. ## Solution - return `InternalError` immediately when finalize cannot find the writer entry - include hash, offset, cache type, and expiration time in the error message for diagnosis - keep the normal finalize path unchanged when the writer exists - rely on the existing `FileBlock::set_downloaded()` cleanup path to abort the pending cache write and reset block state ## Tests - `BlockFileCacheTest.fs_file_cache_storage_finalize_missing_writer_returns_error` - `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 --clean --run --filter=BlockFileCacheTest.fs_file_cache_storage_finalize_missing_writer_returns_error -j 39` - Source patch: `selectdb/selectdb-core#8321`
hello-stephen
commented
May 12, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
hello-stephen
commented
May 12, 2026
run buildall |
1 similar comment
freemandealer
commented
May 28, 2026
run buildall |
freemandealer
commented
May 29, 2026
run buildall |
freemandealer
commented
May 29, 2026
run buildall |
hello-stephen
commented
May 29, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
May 29, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
freemandealer
commented
May 31, 2026
run cloud_p0 |
freemandealer
commented
May 31, 2026
run p0 |
freemandealer
commented
May 31, 2026
run nonConcurrent |
hello-stephen
commented
May 31, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
May 31, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
May 31, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
freemandealer
commented
Jun 1, 2026
merge after 4.0.6 release |
freemandealer
commented
Jun 1, 2026
run cloud_p0 |
Uh oh!
There was an error while loading. Please reload this page.
Cherry-picked from #62389