This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new feeda7230a [Enhancement](storage engine) avoid deleting tablets on
unused disk (#19010)
feeda7230a is described below
commit feeda7230a2d98b48f084fa9ca5a639a8d3a0f16
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 9a45616bff..f7968fc650 100644
--- a/be/src/olap/storage_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -388,12 +388,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?
@@ -499,8 +495,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;
@@ -508,7 +503,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) {
@@ -516,7 +511,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;
}
}
@@ -528,10 +522,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 481353ec0d..da42008f0d 100644
--- a/be/src/olap/storage_engine.h
+++ b/be/src/olap/storage_engine.h
@@ -215,7 +215,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]