diff --git a/be/src/io/cache/block_file_cache.h b/be/src/io/cache/block_file_cache.h index a64d339d081be6..c12b03cc998792 100644 --- a/be/src/io/cache/block_file_cache.h +++ b/be/src/io/cache/block_file_cache.h @@ -496,7 +496,6 @@ class BlockFileCache { size_t _max_query_cache_size = 0; mutable std::mutex _mutex; - std::unique_ptr _storage; bool _close {false}; std::mutex _close_mtx; std::condition_variable _close_cv; @@ -575,6 +574,11 @@ class BlockFileCache { std::shared_ptr _evict_in_advance_latency_us; std::shared_ptr _recycle_keys_length_recorder; std::shared_ptr _ttl_gc_latency_us; + // keep _storage last so it will deconstruct first + // otherwise, load_cache_info_into_memory might crash + // coz it will use other members of BlockFileCache + // so join this async load thread first + std::unique_ptr _storage; }; } // namespace doris::io