Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed Nov 22, 2024
1 parent 377adbd commit af07574
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cloud/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions cloud/src/meta-service/meta_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Transaction> txn;
for (auto& i : request->tablet_idx()) {
Expand Down Expand Up @@ -1659,6 +1660,7 @@ void MetaServiceImpl::get_tablet_stats(::google::protobuf::RpcController* contro
std::vector<std::string> 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);
}
Expand All @@ -1672,22 +1674,27 @@ void MetaServiceImpl::get_tablet_stats(::google::protobuf::RpcController* contro
// batch get tablet stats
std::vector<std::string> 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);
Expand All @@ -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<double> 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,
Expand Down

0 comments on commit af07574

Please sign in to comment.