gavinchou commented on code in PR #50726:
URL: https://github.com/apache/doris/pull/50726#discussion_r2096028982


##########
be/src/io/cache/fs_file_cache_storage.cpp:
##########
@@ -102,11 +104,33 @@ size_t FDCache::file_reader_cache_size() {
 
 Status FSFileCacheStorage::init(BlockFileCache* _mgr) {
     _cache_base_path = _mgr->_cache_base_path;
-    RETURN_IF_ERROR(upgrade_cache_dir_if_necessary());
     _cache_background_load_thread = std::thread([this, mgr = _mgr]() {
+        auto mem_tracker = 
MemTrackerLimiter::create_shared(MemTrackerLimiter::Type::OTHER,
+                                                            
fmt::format("FileCacheVersionReader"));
+        SCOPED_ATTACH_TASK(mem_tracker);
+        Status st = upgrade_cache_dir_if_necessary();
+        
TEST_SYNC_POINT_CALLBACK("FSFileCacheStorage::upgrade_cache_dir_if_necessary", 
&st);
+        if (!st.ok()) {
+            std::string msg = fmt::format(
+                    "file cache {} lazy load done with error. upgrade version 
failed. st={}",
+                    _cache_base_path, st.to_string());
+            if (doris::config::ignore_file_cache_dir_upgrade_failure) {
+                LOG(WARNING) << msg << "be conf: 
`ignore_file_cache_dir_upgrade_failure = true`"
+                             << " so we are ignoring the error (unsuccessful 
cache files will be "
+                                "removed)";
+                remove_old_version_directories();
+            } else {
+                LOG(WARNING) << msg << ". please fix error and restart BE or"
+                             << " use be conf: 
`ignore_file_cache_dir_upgrade_failure = true`"
+                             << " to skip the error (unsuccessful cache files 
will be removed)";
+                throw doris::Exception(Status::InternalError(

Review Comment:
   why not just return error?



-- 
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

Reply via email to