diff --git a/cloud/src/common/config.h b/cloud/src/common/config.h index 67dbeedea53a70c..155294ed05e0887 100644 --- a/cloud/src/common/config.h +++ b/cloud/src/common/config.h @@ -225,5 +225,5 @@ CONF_Int32(max_tablet_index_num_per_batch, "1000"); CONF_mInt64(max_num_aborted_txn, "100"); CONF_Bool(enable_check_instance_id, "true"); -CONF_Bool(enable_concurrency_get_tablet_stats, "true"); +CONF_Bool(enable_concurrency_get_tablet_stats, "false"); } // namespace doris::cloud::config diff --git a/cloud/src/meta-service/meta_service.cpp b/cloud/src/meta-service/meta_service.cpp index 8eb1246a5c98c34..340ee6a33e32002 100644 --- a/cloud/src/meta-service/meta_service.cpp +++ b/cloud/src/meta-service/meta_service.cpp @@ -1619,6 +1619,7 @@ void MetaServiceImpl::get_tablet_stats(::google::protobuf::RpcController* contro } RPC_RATE_LIMIT(get_tablet_stats) + auto start = std::chrono::high_resolution_clock::now(); if (!config::enable_concurrency_get_tablet_stats) { std::unique_ptr txn; for (auto& i : request->tablet_idx()) { @@ -1659,6 +1660,7 @@ void MetaServiceImpl::get_tablet_stats(::google::protobuf::RpcController* contro std::vector tablet_idx_keys; std::string key; for (const auto& i : request->tablet_idx()) { + key.clear(); meta_tablet_idx_key({instance_id, i.tablet_id()}, &key); tablet_idx_keys.emplace_back(key); } @@ -1672,22 +1674,27 @@ void MetaServiceImpl::get_tablet_stats(::google::protobuf::RpcController* contro // batch get tablet stats std::vector tablet_stats_keys; for (const auto& idx : tablet_idx_pb_vec) { + key.clear(); stats_tablet_key({instance_id, idx.table_id(), idx.index_id(), idx.partition_id(), idx.tablet_id()}, &key); tablet_stats_keys.emplace_back(key); + key.clear(); stats_tablet_data_size_key({instance_id, idx.table_id(), idx.index_id(), idx.partition_id(), idx.tablet_id()}, &key); tablet_stats_keys.emplace_back(key); + key.clear(); stats_tablet_num_rows_key({instance_id, idx.table_id(), idx.index_id(), idx.partition_id(), idx.tablet_id()}, &key); tablet_stats_keys.emplace_back(key); + key.clear(); stats_tablet_num_rowsets_key({instance_id, idx.table_id(), idx.index_id(), idx.partition_id(), idx.tablet_id()}, &key); tablet_stats_keys.emplace_back(key); + key.clear(); stats_tablet_num_segs_key({instance_id, idx.table_id(), idx.index_id(), idx.partition_id(), idx.tablet_id()}, &key); @@ -1705,6 +1712,9 @@ void MetaServiceImpl::get_tablet_stats(::google::protobuf::RpcController* contro stat_ptr->CopyFrom(stat); } } + auto end = std::chrono::high_resolution_clock::now(); + std::chrono::duration duration = end - start; + LOG_WARNING("lyk_debug").tag("cost ms", duration.count() * 1000); } static bool check_delete_bitmap_lock(MetaServiceCode& code, std::string& msg, std::stringstream& ss,