yangzhg commented on code in PR #11959: URL: https://github.com/apache/doris/pull/11959#discussion_r952221072
########## be/src/io/cache/file_cache_manager.cpp: ########## @@ -29,18 +32,110 @@ void FileCacheManager::add_file_cache(const Path& cache_path, FileCachePtr file_ } void FileCacheManager::remove_file_cache(const Path& cache_path) { - std::lock_guard<std::shared_mutex> wrlock(_cache_map_lock); - _file_cache_map.erase(cache_path.native()); + bool cache_path_exist = false; + { + std::shared_lock<std::shared_mutex> rdlock(_cache_map_lock); + if (_file_cache_map.find(cache_path) == _file_cache_map.end()) { + bool cache_dir_exist = false; + if (global_local_filesystem()->exists(cache_path, &cache_dir_exist).ok()) { + if (cache_dir_exist) { Review Comment: redundant if stmt and var `cache_dir_exist` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org