This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit fffd4e4bc9082ad2b30ef2847ac06563d4b2038c Author: Yueyang Zhan <[email protected]> AuthorDate: Thu May 4 15:15:43 2023 +0800 [Enhancement](storage engine) avoid deleting tablets on unused disk (#19010) --- be/src/olap/storage_engine.cpp | 18 ++++-------------- be/src/olap/storage_engine.h | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp index a42f95e3e8..203ddafe0c 100644 --- a/be/src/olap/storage_engine.cpp +++ b/be/src/olap/storage_engine.cpp @@ -391,12 +391,8 @@ void StorageEngine::_start_disk_stat_monitor() { } _update_storage_medium_type_count(); - bool some_tablets_were_dropped = _delete_tablets_on_unused_root_path(); - // If some tablets were dropped, we should notify disk_state_worker_thread and - // tablet_worker_thread (see TaskWorkerPool) to make them report to FE ASAP. - if (some_tablets_were_dropped) { - notify_listeners(); - } + + _exit_if_too_many_disks_are_failed(); } // TODO(lingbin): Should be in EnvPosix? @@ -502,8 +498,7 @@ static bool too_many_disks_are_failed(uint32_t unused_num, uint32_t total_num) { (unused_num * 100 / total_num > config::max_percentage_of_error_disk)); } -bool StorageEngine::_delete_tablets_on_unused_root_path() { - std::vector<TabletInfo> tablet_info_vec; +void StorageEngine::_exit_if_too_many_disks_are_failed() { uint32_t unused_root_path_num = 0; uint32_t total_root_path_num = 0; @@ -511,7 +506,7 @@ bool StorageEngine::_delete_tablets_on_unused_root_path() { // TODO(yingchun): _store_map is only updated in main and ~StorageEngine, maybe we can remove it? std::lock_guard<std::mutex> l(_store_lock); if (_store_map.empty()) { - return false; + return; } for (auto& it : _store_map) { @@ -519,7 +514,6 @@ bool StorageEngine::_delete_tablets_on_unused_root_path() { if (it.second->is_used()) { continue; } - it.second->clear_tablets(&tablet_info_vec); ++unused_root_path_num; } } @@ -531,10 +525,6 @@ bool StorageEngine::_delete_tablets_on_unused_root_path() { << ", total_disk_count=" << total_root_path_num; exit(0); } - - _tablet_manager->drop_tablets_on_error_root_path(tablet_info_vec); - // If tablet_info_vec is not empty, means we have dropped some tablets. - return !tablet_info_vec.empty(); } void StorageEngine::stop() { diff --git a/be/src/olap/storage_engine.h b/be/src/olap/storage_engine.h index 8701fd4fca..fa8c34f969 100644 --- a/be/src/olap/storage_engine.h +++ b/be/src/olap/storage_engine.h @@ -212,7 +212,7 @@ private: Status _check_all_root_path_cluster_id(); Status _judge_and_update_effective_cluster_id(int32_t cluster_id); - bool _delete_tablets_on_unused_root_path(); + void _exit_if_too_many_disks_are_failed(); void _clean_unused_txns(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
