pengxiangyu commented on code in PR #8806:
URL: https://github.com/apache/incubator-doris/pull/8806#discussion_r855728881
##########
be/src/olap/storage_engine.cpp:
##########
@@ -839,10 +849,42 @@ OLAPStatus StorageEngine::_do_sweep(const string&
scan_root, const time_t& local
string path_name = sorted_path.string();
if (difftime(local_now, mktime(&local_tm_create)) >=
actual_expire) {
+ std::string storage_name_path = path_name + "/" + STORAGE_NAME;
+ if (scan_root_desc.is_remote() &&
FileUtils::check_exist(storage_name_path)) {
+ faststring buf;
+ if (!env_util::read_file_to_string(Env::Default(),
storage_name_path, &buf).ok()) {
+ LOG(WARNING) << "read storage_name failed: " <<
storage_name_path;
+ continue;
+ }
+ FilePathDesc remote_path_desc = scan_root_desc;
+ remote_path_desc.storage_name = buf.ToString();
+ boost::algorithm::trim(remote_path_desc.storage_name);
+ std::shared_ptr<StorageBackend> storage_backend =
StorageBackendMgr::instance()->
+ get_storage_backend(remote_path_desc.storage_name);
+ if (storage_backend != nullptr) {
Review Comment:
is storage_backend is null, remote storage is invalid, data need not to be
deleted. Only local files need to be deleted.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]