This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 732f0c1e5 [tserver] limit number of trace metrics for TabletCopyClient
732f0c1e5 is described below
commit 732f0c1e51bca04091431859918a3b84866373a0
Author: Alexey Serbin <[email protected]>
AuthorDate: Thu May 2 18:48:50 2024 -0700
[tserver] limit number of trace metrics for TabletCopyClient
The trace metrics registry assumes that the number of entries is quite
small, with the current threshold of 100. In its turn, a thread pool
unconditionally registers and updates its trace metrics while executing
submitted tasks. Since a tablet server might host thousands of tablet
replicas, it's not a good idea to include the UUID of the tablet into
the name of the download thread pool spawned by every TabletCopyClient
instance.
This is a follow-up to 0d95304fa46ee5d96bcaa934c7660369f2860e06.
Change-Id: I334aa81aaed2378e7cae558bd8bb9e0f0c970fec
Reviewed-on: http://gerrit.cloudera.org:8080/21393
Tested-by: Marton Greber <[email protected]>
Reviewed-by: Marton Greber <[email protected]>
---
src/kudu/tserver/tablet_copy_client.cc | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/kudu/tserver/tablet_copy_client.cc
b/src/kudu/tserver/tablet_copy_client.cc
index d5c114675..fc49f42a1 100644
--- a/src/kudu/tserver/tablet_copy_client.cc
+++ b/src/kudu/tserver/tablet_copy_client.cc
@@ -232,9 +232,17 @@ TabletCopyClient::TabletCopyClient(
if (dst_tablet_copy_metrics_) {
dst_tablet_copy_metrics_->open_client_sessions->Increment();
}
- CHECK_OK(ThreadPoolBuilder("tablet-download-pool-" + tablet_id_)
+
+ // These thread pools are ephemeral, and there might be multiple pools with
+ // the same name "tablet-download-pool" running at the same time. They are
not
+ // differentiated by 'tablet_id' or other dynamic information -- that's to
+ // avoid registering too many entries in the trace metrics dictionary
+ // (see trace_metrics.{h,cc} for details). So, all the trace metrics for
+ // these thread pools will be accumulated under a few thread pool metrics
+ // for all the tablet copying clients ever spawned.
+ CHECK_OK(ThreadPoolBuilder("tablet-download-pool")
+ .set_min_threads(1)
.set_max_threads(FLAGS_tablet_copy_download_threads_nums_per_session)
-
.set_min_threads(FLAGS_tablet_copy_download_threads_nums_per_session)
.Build(&tablet_download_pool_));
}