diff --git a/be/src/io/cache/fs_file_cache_storage.cpp b/be/src/io/cache/fs_file_cache_storage.cpp index 0860265e181bb3..caf30678439f37 100644 --- a/be/src/io/cache/fs_file_cache_storage.cpp +++ b/be/src/io/cache/fs_file_cache_storage.cpp @@ -877,9 +877,9 @@ void FSFileCacheStorage::load_cache_info_into_memory(BlockFileCache* _mgr) const // If the difference is more than threshold, load from filesystem as well if (estimated_file_count > 100) { - double difference_ratio = - (static_cast(estimated_file_count) - static_cast(db_block_count)) / - static_cast(estimated_file_count); + double absolute_difference = std::abs(static_cast(estimated_file_count) - + static_cast(db_block_count)); + double difference_ratio = absolute_difference / static_cast(estimated_file_count); if (difference_ratio > config::file_cache_meta_store_vs_file_system_diff_num_threshold) { LOG(WARNING) << "Significant difference between DB blocks (" << db_block_count