[hbase-site] branch asf-site updated: INFRA-10751 Empty commit
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/hbase-site.git The following commit(s) were added to refs/heads/asf-site by this push: new d578283 INFRA-10751 Empty commit d578283 is described below commit d57828383afd16cd3e57645e2b66101419ad8708 Author: jenkins AuthorDate: Fri Aug 27 20:20:17 2021 + INFRA-10751 Empty commit
[hbase] branch branch-2.4 updated: HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a commit to branch branch-2.4 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.4 by this push: new 21e2c1b HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) 21e2c1b is described below commit 21e2c1b7c6f2ff55ca137964cb7e46f9e2cb7bc1 Author: Andrew Purtell AuthorDate: Fri Aug 27 10:13:34 2021 -0700 HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) Signed-off-by: Bharath Vissapragada Signed-off-by: Duo Zhang Signed-off-by: Nick Dimiduk --- .../hadoop/hbase/regionserver/compactions/CompactionProgress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java index 577276e..942cc4f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java @@ -77,8 +77,8 @@ public class CompactionProgress { */ public long getTotalCompactingKVs() { if (totalCompactingKVs < currentCompactedKVs) { - LOG.warn("totalCompactingKVs={} less than currentCompactedKVs={}", - totalCompactingKVs, currentCompactedKVs); + LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", +totalCompactingKVs, currentCompactedKVs); return currentCompactedKVs; } return totalCompactingKVs;
[hbase] branch branch-2.3 updated: HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a commit to branch branch-2.3 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.3 by this push: new 3397fae HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) 3397fae is described below commit 3397faea3bb01bba1faa02a4e6c0aebb05ffd124 Author: Andrew Purtell AuthorDate: Fri Aug 27 10:13:34 2021 -0700 HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) Signed-off-by: Bharath Vissapragada Signed-off-by: Duo Zhang Signed-off-by: Nick Dimiduk --- .../hadoop/hbase/regionserver/compactions/CompactionProgress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java index 577276e..942cc4f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java @@ -77,8 +77,8 @@ public class CompactionProgress { */ public long getTotalCompactingKVs() { if (totalCompactingKVs < currentCompactedKVs) { - LOG.warn("totalCompactingKVs={} less than currentCompactedKVs={}", - totalCompactingKVs, currentCompactedKVs); + LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", +totalCompactingKVs, currentCompactedKVs); return currentCompactedKVs; } return totalCompactingKVs;
[hbase] branch branch-2 updated: HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a commit to branch branch-2 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2 by this push: new 3b1482e HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) 3b1482e is described below commit 3b1482ef6016b1df7dfdf2d87a048242ceec5a12 Author: Andrew Purtell AuthorDate: Fri Aug 27 10:13:34 2021 -0700 HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) Signed-off-by: Bharath Vissapragada Signed-off-by: Duo Zhang Signed-off-by: Nick Dimiduk --- .../hadoop/hbase/regionserver/compactions/CompactionProgress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java index 577276e..942cc4f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java @@ -77,8 +77,8 @@ public class CompactionProgress { */ public long getTotalCompactingKVs() { if (totalCompactingKVs < currentCompactedKVs) { - LOG.warn("totalCompactingKVs={} less than currentCompactedKVs={}", - totalCompactingKVs, currentCompactedKVs); + LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", +totalCompactingKVs, currentCompactedKVs); return currentCompactedKVs; } return totalCompactingKVs;
[hbase] 01/01: Revert "HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)"
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a commit to branch revert-3579-HBASE-25828 in repository https://gitbox.apache.org/repos/asf/hbase.git commit e47e5a4ec25b3470a4e8d2b09471252559ea18b0 Author: Andrew Purtell AuthorDate: Fri Aug 27 10:14:18 2021 -0700 Revert "HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)" This reverts commit c770b1de0d6d4a0cf02a52e1cf640d4be9e8ec5f. --- .../hadoop/hbase/regionserver/compactions/CompactionProgress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java index 942cc4f..577276e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java @@ -77,8 +77,8 @@ public class CompactionProgress { */ public long getTotalCompactingKVs() { if (totalCompactingKVs < currentCompactedKVs) { - LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", -totalCompactingKVs, currentCompactedKVs); + LOG.warn("totalCompactingKVs={} less than currentCompactedKVs={}", + totalCompactingKVs, currentCompactedKVs); return currentCompactedKVs; } return totalCompactingKVs;
[hbase] branch revert-3579-HBASE-25828 created (now e47e5a4)
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a change to branch revert-3579-HBASE-25828 in repository https://gitbox.apache.org/repos/asf/hbase.git. at e47e5a4 Revert "HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)" This branch includes the following new commits: new e47e5a4 Revert "HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)" The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[hbase] 02/02: HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hbase.git commit 07c0eeebb383cede8592dde36c535160c058a59e Author: Andrew Purtell AuthorDate: Fri Aug 27 10:13:34 2021 -0700 HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) Signed-off-by: Bharath Vissapragada Signed-off-by: Duo Zhang Signed-off-by: Nick Dimiduk --- .../hadoop/hbase/regionserver/compactions/CompactionProgress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java index 577276e..942cc4f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java @@ -77,8 +77,8 @@ public class CompactionProgress { */ public long getTotalCompactingKVs() { if (totalCompactingKVs < currentCompactedKVs) { - LOG.warn("totalCompactingKVs={} less than currentCompactedKVs={}", - totalCompactingKVs, currentCompactedKVs); + LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", +totalCompactingKVs, currentCompactedKVs); return currentCompactedKVs; } return totalCompactingKVs;
[hbase] 01/02: Revert "HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)"
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hbase.git commit 7cc876de5286b71f292d200053a1c539be15afc2 Author: Andrew Purtell AuthorDate: Fri Aug 27 10:13:34 2021 -0700 Revert "HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)" This reverts commit c770b1de0d6d4a0cf02a52e1cf640d4be9e8ec5f. GH workflow error caused commit with incorrect message. --- .../hadoop/hbase/regionserver/compactions/CompactionProgress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java index 942cc4f..577276e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java @@ -77,8 +77,8 @@ public class CompactionProgress { */ public long getTotalCompactingKVs() { if (totalCompactingKVs < currentCompactedKVs) { - LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", -totalCompactingKVs, currentCompactedKVs); + LOG.warn("totalCompactingKVs={} less than currentCompactedKVs={}", + totalCompactingKVs, currentCompactedKVs); return currentCompactedKVs; } return totalCompactingKVs;
[hbase] branch master updated (c770b1d -> 07c0eee)
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/hbase.git. from c770b1d HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) new 7cc876d Revert "HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)" new 07c0eee HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes:
[hbase] branch master updated: HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579)
This is an automated email from the ASF dual-hosted git repository. apurtell pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/master by this push: new c770b1d HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) c770b1d is described below commit c770b1de0d6d4a0cf02a52e1cf640d4be9e8ec5f Author: Andrew Purtell AuthorDate: Fri Aug 27 10:11:16 2021 -0700 HBASE-26189 Reduce log level of CompactionProgress notice to DEBUG (#3579) --- .../hadoop/hbase/regionserver/compactions/CompactionProgress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java index 577276e..942cc4f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionProgress.java @@ -77,8 +77,8 @@ public class CompactionProgress { */ public long getTotalCompactingKVs() { if (totalCompactingKVs < currentCompactedKVs) { - LOG.warn("totalCompactingKVs={} less than currentCompactedKVs={}", - totalCompactingKVs, currentCompactedKVs); + LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", +totalCompactingKVs, currentCompactedKVs); return currentCompactedKVs; } return totalCompactingKVs;
[hbase] 16/18: HBASE-26139 Backport HBASE-23762 "Add documentation on how to enable and view tracing with OpenTelemetry" to branch-2 (#3629)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 2c0664e379866ddfdec30a170e23c90e2d85954f Author: Tak Lon (Stephen) Wu AuthorDate: Thu Aug 26 09:36:05 2021 -0700 HBASE-26139 Backport HBASE-23762 "Add documentation on how to enable and view tracing with OpenTelemetry" to branch-2 (#3629) 16/17 commits of HBASE-22120, original commit be4503d9f82f044fbfce21c8a42d0b1684607238 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- src/main/asciidoc/_chapters/tracing.adoc | 57 ++ src/main/asciidoc/_chapters/upgrading.adoc | 4 +-- src/main/asciidoc/book.adoc| 1 + 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/main/asciidoc/_chapters/tracing.adoc b/src/main/asciidoc/_chapters/tracing.adoc new file mode 100644 index 000..cc9f093 --- /dev/null +++ b/src/main/asciidoc/_chapters/tracing.adoc @@ -0,0 +1,57 @@ + +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +[[tracing]] += Tracing +:doctype: book +:numbered: +:toc: left +:icons: font +:experimental: + +== Overview + +HBase used to depend on the HTrace project for tracing. After the Apache HTrace project moved to the Attic/retired, we decided to move to https://opentelemetry.io[OpenTelemetry] in https://issues.apache.org/jira/browse/HBASE-22120[HBASE-22120]. + +The basic support for tracing has been done, where we added tracing for async client, rpc, region read/write/scan operation, and WAL. We use opentelemetry-api to implement the tracing support manually by code, as our code base is way too complicated to be instrumented through a java agent. But notice that you still need to attach the opentelemetry java agent to enable tracing. Please see the official site for https://opentelemetry.io/[OpenTelemetry] and the documentation for https://gith [...] + +== Usage + +=== Enable Tracing + +See this section in hbase-env.sh + +[source,shell] + +# Uncomment to enable trace, you can change the options to use other exporters such as jaeger or +# zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to +# configure exporters and other components through system properties. +# export HBASE_TRACE_OPTS="-Dotel.resource.attributes=service.name=HBase -Dotel.traces.exporter=logging otel.metrics.exporter=none" + + +Uncomment this line to enable tracing. The default config is to output the tracing data to log. Please see the documentation for https://github.com/open-telemetry/opentelemetry-java-instrumentation[opentelemetry-java-instrumentation] for more details on how to export tracing data to other tracing system such as OTel collector, jaeger or zipkin, what does the _service.name_ mean, and how to change the sampling rate, etc. + +NOTE: The https://github.com/open-telemetry/opentelemetry-java/blob/v1.0.1/exporters/logging/src/main/java/io/opentelemetry/exporter/logging/LoggingSpanExporter.java[LoggingSpanExporter] uses java.util.logging(jul) for logging tracing data, and the logger is initialized in opentelemetry java agent, which seems to be ahead of our jul to slf4j bridge initialization, so it will always log the tracing data to console. We highly suggest that you use other tracing systems to collect and view t [...] + +=== Performance Impact + +According to the result in https://issues.apache.org/jira/browse/HBASE-25658[HBASE-25658], the performance impact is minimal. Of course the test cluster is not under heavy load, so if you find out that enabling tracing would impact the performance, try to lower the sampling rate. See documentation for configuring https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#sampler[sampler] for more details. + diff --git a/src/main/asciidoc/_chapters/upgrading.adoc b/src/main/asciidoc/_chapters/upgrading.adoc index cf1568e..d4f9e37 100644 --- a/src/main/asciidoc/_chapters/upgrading.adoc +++ b/src/main/asciidoc/_chapters/upgrading.adoc @@ -634,11 +634,11 @@ The Java client API for HBase has a number of change
[hbase] 18/18: HBASE-26168 Backport HBASE-25811 "The client integration test is failing after HBASE-22120 merged" into branch-2 (#3634)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 791fd64fb3c6726a95af499108729b2e7d36064f Author: Tak Lon (Stephen) Wu AuthorDate: Fri Aug 27 09:09:55 2021 -0700 HBASE-26168 Backport HBASE-25811 "The client integration test is failing after HBASE-22120 merged" into branch-2 (#3634) move opentelemetry jars to client-facing-thirdparty add opentelemetry jars when init map reduce job dependencies original commit 8d2a0efb7a9c17e58892369b281b4af49a5f0d7e Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang Signed-off-by: Peter Somogyi --- hbase-assembly/src/main/assembly/client.xml | 8 hbase-assembly/src/main/assembly/hadoop-three-compat.xml | 1 + .../org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hbase-assembly/src/main/assembly/client.xml b/hbase-assembly/src/main/assembly/client.xml index bd65cb4..48940b7 100644 --- a/hbase-assembly/src/main/assembly/client.xml +++ b/hbase-assembly/src/main/assembly/client.xml @@ -65,6 +65,7 @@ org.slf4j:jcl-over-slf4j org.slf4j:jul-to-slf4j org.slf4j:slf4j-log4j12 + io.opentelemetry.javaagent:* @@ -153,6 +154,13 @@ org.slf4j:jcl-over-slf4j org.slf4j:jul-to-slf4j org.slf4j:slf4j-log4j12 +io.opentelemetry:* + + + + lib/trace + +io.opentelemetry.javaagent:* diff --git a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml index 9780444..6c670a7 100644 --- a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml +++ b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml @@ -213,6 +213,7 @@ org.slf4j:jcl-over-slf4j org.slf4j:jul-to-slf4j org.slf4j:slf4j-log4j12 +io.opentelemetry:* diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java index 7910a5f..d8bffb3 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java @@ -832,7 +832,9 @@ public class TableMapReduceUtil { org.apache.zookeeper.ZooKeeper.class, // zookeeper com.google.protobuf.Message.class, // protobuf com.codahale.metrics.MetricRegistry.class, // metrics-core - org.apache.commons.lang3.ArrayUtils.class);// commons-lang + org.apache.commons.lang3.ArrayUtils.class, // commons-lang + io.opentelemetry.api.trace.Span.class, // opentelemetry-api + io.opentelemetry.semconv.trace.attributes.SemanticAttributes.class); // opentelemetry-semconv } /**
[hbase] 12/18: HBASE-26135 Backport HBASE-25616 "Upgrade opentelemetry to 1.0.0" to branch-2 (#3620)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 55e06a68f6c5677ef4000883868ee28712c158ef Author: Tak Lon (Stephen) Wu AuthorDate: Tue Aug 24 09:22:37 2021 -0700 HBASE-26135 Backport HBASE-25616 "Upgrade opentelemetry to 1.0.0" to branch-2 (#3620) 12/17 commits of HBASE-22120, original commits 8399293e21127df3ffdcb757242e4cb5964c7e99 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang Signed-off-by: Peter Somogyi --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0c90019..8c9873c 100755 --- a/pom.xml +++ b/pom.xml @@ -1482,8 +1482,8 @@ 9.2.13.0 4.13 1.3 -0.17.1 -0.17.0 +1.0.0 +1.0.0 1.2.17 2.28.2
[hbase] 10/18: HBASE-26133 Backport HBASE-25591 "Upgrade opentelemetry to 0.17.1" to branch-2 (#3608)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit c479baad8bca2978ff545ea90986342905977a47 Author: Tak Lon (Stephen) Wu AuthorDate: Mon Aug 23 08:52:07 2021 -0700 HBASE-26133 Backport HBASE-25591 "Upgrade opentelemetry to 0.17.1" to branch-2 (#3608) 10/17 commits of HBASE-22120, original commit f6ff519dd0c7fe0e3ae3c175eefee27a26a065a4 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang Signed-off-by: Peter Somogyi --- .../hadoop/hbase/client/TestAsyncTableTracing.java | 6 +++--- hbase-common/pom.xml | 4 .../org/apache/hadoop/hbase/trace/TraceUtil.java | 25 +++--- .../hadoop/hbase/mttr/IntegrationTestMTTR.java | 3 +-- .../hadoop/hbase/ipc/ServerRpcConnection.java | 4 ++-- .../apache/hadoop/hbase/ipc/AbstractTestIPC.java | 14 ++-- .../hbase/regionserver/TestHRegionTracing.java | 15 ++--- pom.xml| 18 +++- 8 files changed, 44 insertions(+), 45 deletions(-) diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableTracing.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableTracing.java index 07cdf0e..a3ad9df 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableTracing.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableTracing.java @@ -24,7 +24,7 @@ import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; -import io.opentelemetry.api.trace.Span.Kind; +import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.api.trace.StatusCode; import io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule; import io.opentelemetry.sdk.trace.data.SpanData; @@ -222,7 +222,7 @@ public class TestAsyncTableTracing { Waiter.waitFor(CONF, 1000, () -> traceRule.getSpans().stream() .anyMatch(span -> span.getName().equals("AsyncTable." + methodName) && - span.getKind() == Kind.INTERNAL && span.hasEnded())); + span.getKind() == SpanKind.INTERNAL && span.hasEnded())); SpanData data = traceRule.getSpans().stream() .filter(s -> s.getName().equals("AsyncTable." + methodName)).findFirst().get(); assertEquals(StatusCode.OK, data.getStatus().getStatusCode()); @@ -409,7 +409,7 @@ public class TestAsyncTableTracing { Waiter.waitFor(CONF, 1000, () -> traceRule.getSpans().stream() .anyMatch(span -> span.getName().equals("AsyncConnection.close") && - span.getKind() == Kind.INTERNAL && span.hasEnded())); + span.getKind() == SpanKind.INTERNAL && span.hasEnded())); SpanData data = traceRule.getSpans().stream() .filter(s -> s.getName().equals("AsyncConnection.close")).findFirst().get(); assertEquals(StatusCode.OK, data.getStatus().getStatusCode()); diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml index 62661b8..2212fd1 100644 --- a/hbase-common/pom.xml +++ b/hbase-common/pom.xml @@ -196,6 +196,10 @@ opentelemetry-api + io.opentelemetry + opentelemetry-semconv + + org.apache.commons commons-crypto diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java index 2a6b6b6..43c2e04 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java @@ -20,12 +20,12 @@ package org.apache.hadoop.hbase.trace; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.Span.Kind; +import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.api.trace.StatusCode; import io.opentelemetry.api.trace.Tracer; -import io.opentelemetry.api.trace.attributes.SemanticAttributes; import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; +import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.io.IOException; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -72,14 +72,14 @@ public final class TraceUtil { } /** - * Create a {@link Kind#INTERNAL} span. + * Create a {@link SpanKind#INTERNAL} span. */ public static Span createSpan(String name) { -return createSpan(name, Kind.INTERNAL); +return createSpan(name, SpanKind.INTERNAL); } /** - * Create a {@link Kind#INTERNAL} span and set table related attributes. + * Create a {@link SpanKind#INTERNAL} span and set table related attributes. */ public static Span createTableSpan(String spanN
[hbase] 08/18: HBASE-26131 Backport HBASE-25484 "Add trace support for WAL sync" to branch-2 (#3597)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit aa0464ceb716e931d728deb184038d999a3cdaf0 Author: Tak Lon (Stephen) Wu AuthorDate: Thu Aug 19 09:15:05 2021 -0700 HBASE-26131 Backport HBASE-25484 "Add trace support for WAL sync" to branch-2 (#3597) 8/17 commits of HBASE-22120, original commit 2be2c63f0d3917a243b74af9754cbfc805b858d1 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang Signed-off-by: Peter Somogyi --- .../org/apache/hadoop/hbase/trace/TraceUtil.java | 2 + .../hbase/regionserver/wal/AbstractFSWAL.java | 77 +++- .../hadoop/hbase/regionserver/wal/AsyncFSWAL.java | 101 +++-- .../hadoop/hbase/regionserver/wal/FSHLog.java | 38 +--- .../hadoop/hbase/regionserver/TestHRegion.java | 4 +- .../regionserver/wal/TestAsyncFSWALDurability.java | 8 +- .../regionserver/wal/TestFSHLogDurability.java | 8 +- .../org/apache/hadoop/hbase/wal/FaultyFSLog.java | 10 +- 8 files changed, 104 insertions(+), 144 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java index ea16df1..886a4a9 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java @@ -62,6 +62,8 @@ public final class TraceUtil { public static final AttributeKey ROW_LOCK_READ_LOCK_KEY = AttributeKey.booleanKey("db.hbase.rowlock.readlock"); + public static final AttributeKey WAL_IMPL = AttributeKey.stringKey("db.hbase.wal.impl"); + private TraceUtil() { } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java index 5c247d1..c39e10d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java @@ -26,7 +26,6 @@ import static org.apache.hbase.thirdparty.com.google.common.base.Preconditions.c import com.lmax.disruptor.RingBuffer; import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Scope; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InterruptedIOException; @@ -549,6 +548,35 @@ public abstract class AbstractFSWAL implements WAL { return rollWriter(false); } + @Override + public final void sync() throws IOException { +sync(useHsync); + } + + @Override + public final void sync(long txid) throws IOException { +sync(txid, useHsync); + } + + @Override + public final void sync(boolean forceSync) throws IOException { +TraceUtil.trace(() -> { + doSync(forceSync); + return null; +}, () -> createSpan("WAL.sync")); + } + + @Override + public final void sync(long txid, boolean forceSync) throws IOException { +TraceUtil.trace(() -> { + doSync(txid, forceSync); + return null; +}, () -> createSpan("WAL.sync")); + } + + protected abstract void doSync(boolean forceSync) throws IOException; + + protected abstract void doSync(long txid, boolean forceSync) throws IOException; /** * This is a convenience method that computes a new filename with a given file-number. * @param filenum to use @@ -650,7 +678,7 @@ public abstract class AbstractFSWAL implements WAL { this.sequenceIdAccounting.findLower(firstWALEntry.getValue().encodedName2HighestSequenceId); } if (regions != null) { - List listForPrint = new ArrayList(); + List listForPrint = new ArrayList<>(); for (Map.Entry> r : regions.entrySet()) { StringBuilder families = new StringBuilder(); for (int i = 0; i < r.getValue().size(); i++) { @@ -768,6 +796,10 @@ public abstract class AbstractFSWAL implements WAL { } } + private Span createSpan(String name) { +return TraceUtil.createSpan(name).setAttribute(TraceUtil.WAL_IMPL, implClassName); + } + /** * Cleans up current writer closing it and then puts in place the passed in {@code nextWriter}. * @@ -785,13 +817,10 @@ public abstract class AbstractFSWAL implements WAL { * @throws IOException if there is a problem flushing or closing the underlying FS */ Path replaceWriter(Path oldPath, Path newPath, W nextWriter) throws IOException { -Span span = TraceUtil.getGlobalTracer().spanBuilder("FSHFile.replaceWriter").startSpan(); -try (Scope scope = span.makeCurrent()) { +return TraceUtil.trace(() -> { doReplaceWriter(oldPath, newPath, nextWriter); return newPath; -} finally { - span.end(); -} +}, () -> createSpan("WAL.replaceWriter")); } protected fi
[hbase] 17/18: HBASE-26140 Backport HBASE-25778 "The tracinig implementation for AsyncConnectionImpl.getHbck is incorrect" to branch-2 (#3631)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 275de8d024a3e86e5ee18c677a2dd3668fd6b845 Author: Tak Lon (Stephen) Wu AuthorDate: Thu Aug 26 11:29:30 2021 -0700 HBASE-26140 Backport HBASE-25778 "The tracinig implementation for AsyncConnectionImpl.getHbck is incorrect" to branch-2 (#3631) 17/17 commits of HBASE-22120, original commit f36e1539648bbaee84c626fd54d1605baebf3c5a Co-authored-by: Duo Zhang Signed-off-by: Peter Somogyi --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 37 +++ .../hbase/client/TestAsyncConnectionTracing.java | 112 + .../org/apache/hadoop/hbase/trace/TraceUtil.java | 14 +++ 3 files changed, 145 insertions(+), 18 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index 98e7825..76b1208 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -28,7 +28,6 @@ import static org.apache.hadoop.hbase.client.NonceGenerator.CLIENT_NONCES_ENABLE import static org.apache.hadoop.hbase.util.FutureUtils.addListener; import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Scope; import java.io.IOException; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -37,6 +36,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; import org.apache.commons.io.IOUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.AuthUtil; @@ -370,6 +370,15 @@ class AsyncConnectionImpl implements AsyncConnection { RETRY_TIMER); } + private Hbck getHbckInternal(ServerName masterServer) { +Span.current().setAttribute(TraceUtil.SERVER_NAME_KEY, masterServer.getServerName()); +// we will not create a new connection when creating a new protobuf stub, and for hbck there +// will be no performance consideration, so for simplification we will create a new stub every +// time instead of caching the stub here. +return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( + rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); + } + @Override public CompletableFuture getHbck() { return TraceUtil.tracedFuture(() -> { @@ -378,11 +387,7 @@ class AsyncConnectionImpl implements AsyncConnection { if (error != null) { future.completeExceptionally(error); } else { - try { -future.complete(getHbck(sn)); - } catch (IOException e) { -future.completeExceptionally(e); - } + future.complete(getHbckInternal(sn)); } }); return future; @@ -390,18 +395,14 @@ class AsyncConnectionImpl implements AsyncConnection { } @Override - public Hbck getHbck(ServerName masterServer) throws IOException { -Span span = TraceUtil.createSpan("AsyncConnection.getHbck") - .setAttribute(TraceUtil.SERVER_NAME_KEY, masterServer.getServerName()); -try (Scope scope = span.makeCurrent()) { - // we will not create a new connection when creating a new protobuf stub, and for hbck there - // will be no performance consideration, so for simplification we will create a new stub every - // time instead of caching the stub here. - return new HBaseHbck( -MasterProtos.HbckService - .newBlockingStub(rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), -rpcControllerFactory); -} + public Hbck getHbck(ServerName masterServer) { +return TraceUtil.trace(new Supplier() { + + @Override + public Hbck get() { +return getHbckInternal(masterServer); + } +}, "AsyncConnection.getHbck"); } @Override diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncConnectionTracing.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncConnectionTracing.java new file mode 100644 index 000..fec5f6d --- /dev/null +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncConnectionTracing.java @@ -0,0 +1,112 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the Licens
[hbase] 15/18: HBASE-26138 Backport HBASE-25733 "Upgrade opentelemetry to 1.0.1" to branch-2 (#3628)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit f925d32473874ae40bfd5e524ead07d3e2d04149 Author: Tak Lon (Stephen) Wu AuthorDate: Wed Aug 25 19:28:10 2021 -0700 HBASE-26138 Backport HBASE-25733 "Upgrade opentelemetry to 1.0.1" to branch-2 (#3628) 15/17 commits of HBASE-22120, original commit b71488998970a3353086a34736ed1edab527f673 Co-authored-by: Duo Zhang Signed-off-by: Peter Somogyi --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8c9873c..e6437de 100755 --- a/pom.xml +++ b/pom.xml @@ -1482,8 +1482,8 @@ 9.2.13.0 4.13 1.3 -1.0.0 -1.0.0 +1.0.1 +1.0.1 1.2.17 2.28.2
[hbase] 14/18: HBASE-26137 Backport HBASE-25732 "Change the command line argument for tracing after upgrading opentelemtry to 1.0.0" to branch-2 (#3624)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 85e9c1a87fbafb848daf1d94351ebbc664fe2489 Author: Tak Lon (Stephen) Wu AuthorDate: Wed Aug 25 09:01:19 2021 -0700 HBASE-26137 Backport HBASE-25732 "Change the command line argument for tracing after upgrading opentelemtry to 1.0.0" to branch-2 (#3624) 14/17 commits of HBASE-22120, original commit 8df9bebdd367d52a32b08c18a7cf4f9c2d712071 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- conf/hbase-env.cmd | 5 + conf/hbase-env.sh | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/conf/hbase-env.cmd b/conf/hbase-env.cmd index 1f1c3e3..4beebf6 100644 --- a/conf/hbase-env.cmd +++ b/conf/hbase-env.cmd @@ -81,3 +81,8 @@ set HBASE_OPTS=%HBASE_OPTS% "-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stac @rem Tell HBase whether it should manage it's own instance of ZooKeeper or not. @rem set HBASE_MANAGES_ZK=true + +@rem Uncomment to enable trace, you can change the options to use other exporters such as jaeger or +@rem zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to +@rem configure exporters and other components through system properties. +@rem set HBASE_TRACE_OPTS="-Dotel.resource.attributes=service.name=HBase -Dotel.traces.exporter=logging otel.metrics.exporter=none" diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh index b3c4baf..d1d9a6f 100644 --- a/conf/hbase-env.sh +++ b/conf/hbase-env.sh @@ -146,6 +146,6 @@ # export HBASE_JSHELL_ARGS="--startup DEFAULT --startup PRINTING --startup hbase_startup.jsh" # Uncomment to enable trace, you can change the options to use other exporters such as jaeger or -# zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to config -# exporters and other components through system properties. -# export HBASE_TRACE_OPTS="-Dotel.config.sampler.probability=0.1 -Dotel.exporter=logging" +# zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to +# configure exporters and other components through system properties. +# export HBASE_TRACE_OPTS="-Dotel.resource.attributes=service.name=HBase -Dotel.traces.exporter=logging otel.metrics.exporter=none"
[hbase] 05/18: HBASE-26128 Backport HBASE-25454 "Add trace support for connection re… (#3561)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit c3d577a3b2afc6024a9d02d6f6ef9fae3bed53b1 Author: Tak Lon (Stephen) Wu AuthorDate: Thu Aug 12 12:38:53 2021 -0700 HBASE-26128 Backport HBASE-25454 "Add trace support for connection re… (#3561) 5/17 commits of HBASE-22120, original commit dcb78bd4bda4a4ae13d863df8aec266031e5bc93 and merged conflicts after rebasing on HBASE-26150 with commit 63d4970de451bf234f2ddbda949995b1420e525b Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- .../client/AbstractRpcBasedConnectionRegistry.java | 52 +- .../hadoop/hbase/client/ZKConnectionRegistry.java | 36 --- 2 files changed, 53 insertions(+), 35 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java index 7d946aa..54138d3 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.hbase.client; +import static org.apache.hadoop.hbase.trace.TraceUtil.trace; +import static org.apache.hadoop.hbase.trace.TraceUtil.tracedFuture; import static org.apache.hadoop.hbase.util.FutureUtils.addListener; import com.google.errorprone.annotations.RestrictedApi; @@ -237,38 +239,48 @@ abstract class AbstractRpcBasedConnectionRegistry implements ConnectionRegistry @Override public CompletableFuture getMetaRegionLocations() { -return this - . call((c, s, d) -> s.getMetaRegionLocations(c, -GetMetaRegionLocationsRequest.getDefaultInstance(), d), r -> r.getMetaLocationsCount() != 0, +return tracedFuture( + () -> this +. call( + (c, s, d) -> s.getMetaRegionLocations(c, +GetMetaRegionLocationsRequest.getDefaultInstance(), d), + r -> r.getMetaLocationsCount() != 0, "getMetaLocationsCount") - .thenApply(AbstractRpcBasedConnectionRegistry::transformMetaRegionLocations); + .thenApply(AbstractRpcBasedConnectionRegistry::transformMetaRegionLocations), + getClass().getSimpleName() + ".getMetaRegionLocations"); } @Override public CompletableFuture getClusterId() { -return this - . call( -(c, s, d) -> s.getClusterId(c, GetClusterIdRequest.getDefaultInstance(), d), -GetClusterIdResponse::hasClusterId, "getClusterId()") - .thenApply(GetClusterIdResponse::getClusterId); +return tracedFuture( + () -> this +. call( + (c, s, d) -> s.getClusterId(c, GetClusterIdRequest.getDefaultInstance(), d), + GetClusterIdResponse::hasClusterId, "getClusterId()") +.thenApply(GetClusterIdResponse::getClusterId), + getClass().getSimpleName() + ".getClusterId"); } @Override public CompletableFuture getActiveMaster() { -return this - . call( -(c, s, d) -> s.getActiveMaster(c, GetActiveMasterRequest.getDefaultInstance(), d), -GetActiveMasterResponse::hasServerName, "getActiveMaster()") - .thenApply(resp -> ProtobufUtil.toServerName(resp.getServerName())); +return tracedFuture( + () -> this +.call( + (c, s, d) -> s.getActiveMaster(c, GetActiveMasterRequest.getDefaultInstance(), d), + GetActiveMasterResponse::hasServerName, "getActiveMaster()") +.thenApply(resp -> ProtobufUtil.toServerName(resp.getServerName())), + getClass().getSimpleName() + ".getActiveMaster"); } @Override public void close() { -if (registryEndpointRefresher != null) { - registryEndpointRefresher.stop(); -} -if (rpcClient != null) { - rpcClient.close(); -} +trace(() -> { + if (registryEndpointRefresher != null) { +registryEndpointRefresher.stop(); + } + if (rpcClient != null) { +rpcClient.close(); + } +}, getClass().getSimpleName() + ".close"); } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistry.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistry.java index 35107ca..6e94afe 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistry.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistry.java @@ -22,6 +22,7 @@ import static org.apache.hadoop.hbase.client.RegionInfoBuilder.FIRST_META_REGION import static org.apache.hadoop.hbase.client.RegionReplicaUtil.getRegionInfoForDefaultReplica; import static org.apache.hadoop.hbase.client.RegionReplicaUtil.getRegionInfoForReplica; import static org.apache.hadoop.hbase.shaded
[hbase] 06/18: HBASE-26129 Backport HBASE-25481 "Add host and port attribute when tracing rpc call at client side" to branch-2 (#3589)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit e19784c132661c76326172ec5f85121c90f69a73 Author: Tak Lon (Stephen) Wu AuthorDate: Tue Aug 17 09:24:10 2021 -0700 HBASE-26129 Backport HBASE-25481 "Add host and port attribute when tracing rpc call at client side" to branch-2 (#3589) 6/17 commits of HBASE-22120, original commit ae2c62ffaad5ba4c976b0a79c10a365edf2844fd Co-authored-by: Duo Zhang Signed-off-by: Peter Somogyi --- .../org/apache/hadoop/hbase/ipc/AbstractRpcClient.java | 4 +++- .../java/org/apache/hadoop/hbase/trace/TraceUtil.java | 4 .../org/apache/hadoop/hbase/ipc/AbstractTestIPC.java| 17 ++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java index b671095..878f9cf 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java @@ -397,7 +397,9 @@ public abstract class AbstractRpcClient implements RpcC final RpcCallback callback) { Span span = TraceUtil.createSpan("RpcClient.callMethod") .setAttribute(TraceUtil.RPC_SERVICE_KEY, md.getService().getName()) - .setAttribute(TraceUtil.RPC_METHOD_KEY, md.getName()); + .setAttribute(TraceUtil.RPC_METHOD_KEY, md.getName()) + .setAttribute(TraceUtil.REMOTE_HOST_KEY, addr.getHostName()) + .setAttribute(TraceUtil.REMOTE_PORT_KEY, addr.getPort()); try (Scope scope = span.makeCurrent()) { final MetricsConnection.CallStats cs = MetricsConnection.newCallStats(); cs.setStartTime(EnvironmentEdgeManager.currentTime()); diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java index d0da071..8eb2399 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java @@ -54,6 +54,10 @@ public final class TraceUtil { public static final AttributeKey SERVER_NAME_KEY = AttributeKey.stringKey("db.hbase.server.name"); + public static final AttributeKey REMOTE_HOST_KEY = SemanticAttributes.NET_PEER_NAME; + + public static final AttributeKey REMOTE_PORT_KEY = SemanticAttributes.NET_PEER_PORT; + private TraceUtil() { } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java index 4aca764..ffecb09 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java @@ -455,11 +455,14 @@ public abstract class AbstractTestIPC { return traceRule.getSpans().stream().filter(s -> s.getName().equals(name)).findFirst().get(); } - private void assertRpcAttribute(SpanData data, String methodName) { + private void assertRpcAttribute(SpanData data, String methodName, InetSocketAddress addr) { assertEquals(SERVICE.getDescriptorForType().getName(), data.getAttributes().get(TraceUtil.RPC_SERVICE_KEY)); -assertEquals(methodName, - data.getAttributes().get(TraceUtil.RPC_METHOD_KEY)); +assertEquals(methodName, data.getAttributes().get(TraceUtil.RPC_METHOD_KEY)); +if (addr != null) { + assertEquals(addr.getHostName(), data.getAttributes().get(TraceUtil.REMOTE_HOST_KEY)); + assertEquals(addr.getPort(), data.getAttributes().get(TraceUtil.REMOTE_PORT_KEY).intValue()); +} } @Test @@ -471,8 +474,8 @@ public abstract class AbstractTestIPC { rpcServer.start(); BlockingInterface stub = newBlockingStub(client, rpcServer.getListenerAddress()); stub.pause(null, PauseRequestProto.newBuilder().setMs(100).build()); - assertRpcAttribute(waitSpan("RpcClient.callMethod"), "pause"); - assertRpcAttribute(waitSpan("RpcServer.callMethod"), "pause"); + assertRpcAttribute(waitSpan("RpcClient.callMethod"), "pause", rpcServer.getListenerAddress()); + assertRpcAttribute(waitSpan("RpcServer.callMethod"), "pause", null); assertSameTraceId(); for (SpanData data : traceRule.getSpans()) { assertThat( @@ -484,8 +487,8 @@ public abstract class AbstractTestIPC { traceRule.clearSpans(); assertThrows(ServiceException.class, () -> stub.error(null, EmptyRequestProto.getDefaultInstance())); - assertRpcAttribute(waitSpan("RpcClient.callMethod"), "error"); - assertRpcAttribute(waitSpan("RpcServer.callMethod"), "error"); + assertRpcAttribute(waitSpan("RpcClient.callMethod"), "error", rpcServer.getList
[hbase] 13/18: HBASE-26136 Backport HBASE-25723 "Temporarily remove the trace support for RegionScanner.next" to branch-2 (#3623)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit d14ab3eba961522174d1f592767998535dd55d5b Author: Tak Lon (Stephen) Wu AuthorDate: Tue Aug 24 17:45:04 2021 -0700 HBASE-26136 Backport HBASE-25723 "Temporarily remove the trace support for RegionScanner.next" to branch-2 (#3623) 13/17 commits of HBASE-22120, original commit 7f90c2201f6a17d2e2d031505c35ae7c2b1ed7ea Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- .../hbase/regionserver/RegionScannerImpl.java | 58 +++--- .../hbase/regionserver/TestHRegionTracing.java | 1 - 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java index b2e793f..881f423 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java @@ -255,39 +255,37 @@ class RegionScannerImpl implements RegionScanner, Shipper, RpcCallback { @Override public boolean nextRaw(List outResults, ScannerContext scannerContext) throws IOException { -return TraceUtil.trace(() -> { - if (storeHeap == null) { -// scanner is closed -throw new UnknownScannerException("Scanner was closed"); - } - boolean moreValues = false; - if (outResults.isEmpty()) { -// Usually outResults is empty. This is true when next is called -// to handle scan or get operation. -moreValues = nextInternal(outResults, scannerContext); - } else { -List tmpList = new ArrayList<>(); -moreValues = nextInternal(tmpList, scannerContext); -outResults.addAll(tmpList); - } +if (storeHeap == null) { + // scanner is closed + throw new UnknownScannerException("Scanner was closed"); +} +boolean moreValues = false; +if (outResults.isEmpty()) { + // Usually outResults is empty. This is true when next is called + // to handle scan or get operation. + moreValues = nextInternal(outResults, scannerContext); +} else { + List tmpList = new ArrayList<>(); + moreValues = nextInternal(tmpList, scannerContext); + outResults.addAll(tmpList); +} - region.addReadRequestsCount(1); - if (region.getMetrics() != null) { -region.getMetrics().updateReadRequestCount(); - } +region.addReadRequestsCount(1); +if (region.getMetrics() != null) { + region.getMetrics().updateReadRequestCount(); +} - // If the size limit was reached it means a partial Result is being returned. Returning a - // partial Result means that we should not reset the filters; filters should only be reset in - // between rows - if (!scannerContext.mayHaveMoreCellsInRow()) { -resetFilters(); - } +// If the size limit was reached it means a partial Result is being returned. Returning a +// partial Result means that we should not reset the filters; filters should only be reset in +// between rows +if (!scannerContext.mayHaveMoreCellsInRow()) { + resetFilters(); +} - if (isFilterDoneInternal()) { -moreValues = false; - } - return moreValues; -}, () -> region.createRegionSpan("RegionScanner.next")); +if (isFilterDoneInternal()) { + moreValues = false; +} +return moreValues; } /** diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java index 17c3eb4..e5779b4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java @@ -178,7 +178,6 @@ public class TestHRegionTracing { } assertSpan("Region.getScanner"); assertSpan("RegionScanner.reseek"); -assertSpan("RegionScanner.next"); assertSpan("RegionScanner.close"); } }
[hbase] 11/18: HBASE-26134 Backport HBASE-25617 "Revisit the span names" to branch-2 (#3618)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 554285e30940c2edd37fc3a8610d8166c1947b71 Author: Tak Lon (Stephen) Wu AuthorDate: Mon Aug 23 21:04:16 2021 -0700 HBASE-26134 Backport HBASE-25617 "Revisit the span names" to branch-2 (#3618) 11/17 commits of HBASE-22120, original commit 8d68f8cd1c8613be1b499eaa99f46806b2743294 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- .../main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java | 4 ++-- .../main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java | 2 +- .../main/java/org/apache/hadoop/hbase/client/ConnectionFactory.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index b919ee1..98e7825 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -386,12 +386,12 @@ class AsyncConnectionImpl implements AsyncConnection { } }); return future; -}, getClass().getName() + ".getHbck"); +}, "AsyncConnection.getHbck"); } @Override public Hbck getHbck(ServerName masterServer) throws IOException { -Span span = TraceUtil.createSpan(getClass().getName() + ".getHbck") +Span span = TraceUtil.createSpan("AsyncConnection.getHbck") .setAttribute(TraceUtil.SERVER_NAME_KEY, masterServer.getServerName()); try (Scope scope = span.makeCurrent()) { // we will not create a new connection when creating a new protobuf stub, and for hbck there diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java index 3067785..61086c4 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java @@ -97,7 +97,7 @@ class AsyncRegionLocator { private CompletableFuture tracedLocationFuture(Supplier> action, Function> getRegionNames, TableName tableName, String methodName) { -Span span = createTableSpan(getClass().getSimpleName() + "." + methodName, tableName); +Span span = createTableSpan("AsyncRegionLocator." + methodName, tableName); try (Scope scope = span.makeCurrent()) { CompletableFuture future = action.get(); FutureUtils.addListener(future, (resp, error) -> { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionFactory.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionFactory.java index 627e8d2..23bd333 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionFactory.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionFactory.java @@ -307,6 +307,6 @@ public class ConnectionFactory { } }); return future; -}, ConnectionFactory.class.getSimpleName() + ".createAsyncConnection"); +}, "ConnectionFactory.createAsyncConnection"); } }
[hbase] 09/18: HBASE-26132 Backport HBASE-25535 "Set span kind to CLIENT in AbstractRpcClient" to branch-2 (#3607)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 2e2cd4c744e91689b1523ac64fdf345f7258002f Author: Tak Lon (Stephen) Wu AuthorDate: Thu Aug 19 20:12:37 2021 -0700 HBASE-26132 Backport HBASE-25535 "Set span kind to CLIENT in AbstractRpcClient" to branch-2 (#3607) 9/17 commits of HBASE-22120, original commit bb8c4967f8ce2c89ebaf1ddc5d8a1bf55f1e20d3 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- .../apache/hadoop/hbase/ipc/AbstractRpcClient.java | 2 +- .../org/apache/hadoop/hbase/trace/TraceUtil.java | 7 +++ .../apache/hadoop/hbase/ipc/AbstractTestIPC.java | 23 +- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java index fa7dfb1..bb7f4af 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java @@ -395,7 +395,7 @@ public abstract class AbstractRpcClient implements RpcC private Call callMethod(final Descriptors.MethodDescriptor md, final HBaseRpcController hrc, final Message param, Message returnType, final User ticket, final Address addr, final RpcCallback callback) { -Span span = TraceUtil.createSpan("RpcClient.callMethod") +Span span = TraceUtil.createClientSpan("RpcClient.callMethod") .setAttribute(TraceUtil.RPC_SERVICE_KEY, md.getService().getName()) .setAttribute(TraceUtil.RPC_METHOD_KEY, md.getName()) .setAttribute(TraceUtil.REMOTE_HOST_KEY, addr.getHostName()) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java index 886a4a9..2a6b6b6 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java @@ -106,6 +106,13 @@ public final class TraceUtil { } /** + * Create a span with {@link Kind#CLIENT}. + */ + public static Span createClientSpan(String name) { +return createSpan(name, Kind.CLIENT); + } + + /** * Trace an asynchronous operation for a table. */ public static CompletableFuture tracedFuture(Supplier> action, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java index ffecb09..c4951b2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java @@ -34,6 +34,7 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.internal.verification.VerificationModeFactory.times; +import io.opentelemetry.api.trace.Span.Kind; import io.opentelemetry.api.trace.StatusCode; import io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule; import io.opentelemetry.sdk.trace.data.SpanData; @@ -455,7 +456,8 @@ public abstract class AbstractTestIPC { return traceRule.getSpans().stream().filter(s -> s.getName().equals(name)).findFirst().get(); } - private void assertRpcAttribute(SpanData data, String methodName, InetSocketAddress addr) { + private void assertRpcAttribute(SpanData data, String methodName, InetSocketAddress addr, +Kind kind) { assertEquals(SERVICE.getDescriptorForType().getName(), data.getAttributes().get(TraceUtil.RPC_SERVICE_KEY)); assertEquals(methodName, data.getAttributes().get(TraceUtil.RPC_METHOD_KEY)); @@ -463,6 +465,13 @@ public abstract class AbstractTestIPC { assertEquals(addr.getHostName(), data.getAttributes().get(TraceUtil.REMOTE_HOST_KEY)); assertEquals(addr.getPort(), data.getAttributes().get(TraceUtil.REMOTE_PORT_KEY).intValue()); } +assertEquals(kind, data.getKind()); + } + + private void assertRemoteSpan() { +SpanData data = waitSpan("RpcServer.process"); +assertTrue(data.getParentSpanContext().isRemote()); +assertEquals(Kind.SERVER, data.getKind()); } @Test @@ -474,8 +483,10 @@ public abstract class AbstractTestIPC { rpcServer.start(); BlockingInterface stub = newBlockingStub(client, rpcServer.getListenerAddress()); stub.pause(null, PauseRequestProto.newBuilder().setMs(100).build()); - assertRpcAttribute(waitSpan("RpcClient.callMethod"), "pause", rpcServer.getListenerAddress()); - assertRpcAttribute(waitSpan("RpcServer.callMethod"), "pause", null); + assertRpcAttribute(waitSpan("RpcClient.callMethod"), "pause", rpcServer.getListenerAddress(), +Kind.CLIENT); + assertRpcAttribute(waitSpan("RpcServer.callMe
[hbase] 04/18: HBASE-26127 Backport HBASE-23898 "Add trace support for simple apis i… (#3556)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit c96d8fdbd574c354d3722e19465b120cfc575388 Author: Tak Lon (Stephen) Wu AuthorDate: Wed Aug 4 18:25:24 2021 -0700 HBASE-26127 Backport HBASE-23898 "Add trace support for simple apis i… (#3556) 4/17 commits of HBASE-22120, original commit 805b2ae2ad0f6325515d46043ff01e4e2c7a9f59 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- hbase-client/pom.xml | 10 + .../hadoop/hbase/client/AsyncConnection.java | 4 +- .../hadoop/hbase/client/AsyncConnectionImpl.java | 106 +++--- .../hadoop/hbase/client/AsyncRegionLocator.java| 166 +--- .../org/apache/hadoop/hbase/client/AsyncTable.java | 31 +- .../hbase/client/AsyncTableRegionLocatorImpl.java | 18 +- .../hadoop/hbase/client/ConnectionFactory.java | 53 +-- .../hadoop/hbase/client/RawAsyncTableImpl.java | 345 + .../apache/hadoop/hbase/ipc/AbstractRpcClient.java | 9 +- .../client/TestAsyncRegionLocatorTracing.java | 157 .../hadoop/hbase/client/TestAsyncTableTracing.java | 417 + .../org/apache/hadoop/hbase/trace/TraceUtil.java | 134 +++ .../org/apache/hadoop/hbase/ipc/CallRunner.java| 7 +- .../hadoop/hbase/ipc/ServerRpcConnection.java | 3 +- .../apache/hadoop/hbase/ipc/AbstractTestIPC.java | 24 +- pom.xml| 3 +- 16 files changed, 1159 insertions(+), 328 deletions(-) diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index e62a7d1..01a74cc 100644 --- a/hbase-client/pom.xml +++ b/hbase-client/pom.xml @@ -157,6 +157,16 @@ joni + io.opentelemetry + opentelemetry-sdk + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + org.slf4j jcl-over-slf4j test diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnection.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnection.java index 75971ad..d04b5f2 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnection.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnection.java @@ -64,8 +64,8 @@ public interface AsyncConnection extends Closeable { /** * Retrieve an {@link AsyncTable} implementation for accessing a table. * - * The returned instance will use default configs. Use {@link #getTableBuilder(TableName)} if - * you want to customize some configs. + * The returned instance will use default configs. Use {@link #getTableBuilder(TableName)} if you + * want to customize some configs. * * This method no longer checks table existence. An exception will be thrown if the table does not * exist only when the first operation is attempted. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index 2ed7399..b919ee1 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -27,6 +27,8 @@ import static org.apache.hadoop.hbase.client.MetricsConnection.CLIENT_SIDE_METRI import static org.apache.hadoop.hbase.client.NonceGenerator.CLIENT_NONCES_ENABLED_KEY; import static org.apache.hadoop.hbase.util.FutureUtils.addListener; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.context.Scope; import java.io.IOException; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -48,6 +50,7 @@ import org.apache.hadoop.hbase.ipc.RpcClient; import org.apache.hadoop.hbase.ipc.RpcClientFactory; import org.apache.hadoop.hbase.ipc.RpcControllerFactory; import org.apache.hadoop.hbase.security.User; +import org.apache.hadoop.hbase.trace.TraceUtil; import org.apache.hadoop.hbase.util.ConcurrentMapUtils; import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.security.UserGroupInformation; @@ -153,14 +156,13 @@ class AsyncConnectionImpl implements AsyncConnection { LOG.warn("{} is true, but {} is not set", STATUS_PUBLISHED, STATUS_LISTENER_CLASS); } else { try { - listener = new ClusterStatusListener( -new ClusterStatusListener.DeadServerHandler() { - @Override - public void newDead(ServerName sn) { -locator.clearCache(sn); -rpcClient.cancelConnections(sn); - } -}, conf, listenerClass); + listener = new ClusterStatusListener(new ClusterStatusListener.DeadServerHandler() { +@Override +public void newDead(ServerName sn) { +
[hbase] 02/18: HBASE-26125 Backport HBASE-25401 "Add trace support for async call in rpc client" to branch-2 (#3543)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 1beffa74699e874c85ee2c0f48347f59ba8b156b Author: Tak Lon (Stephen) Wu AuthorDate: Mon Aug 2 11:33:19 2021 -0700 HBASE-26125 Backport HBASE-25401 "Add trace support for async call in rpc client" to branch-2 (#3543) 2/17 commits of HBASE-22120 Co-authored-by: Duo Zhang Signed-off-by: Peter Somogyi --- .../apache/hadoop/hbase/ipc/AbstractRpcClient.java | 75 --- .../hadoop/hbase/ipc/BlockingRpcConnection.java| 21 +- .../java/org/apache/hadoop/hbase/ipc/Call.java | 2 +- .../java/org/apache/hadoop/hbase/ipc/IPCUtil.java | 12 +- .../hadoop/hbase/ipc/NettyRpcDuplexHandler.java| 8 +- .../org/apache/hadoop/hbase/trace/TraceUtil.java | 4 +- .../src/main/protobuf/Tracing.proto| 14 +- hbase-server/pom.xml | 10 + .../org/apache/hadoop/hbase/ipc/CallRunner.java| 19 +- .../org/apache/hadoop/hbase/ipc/ServerCall.java| 14 ++ .../hadoop/hbase/ipc/ServerRpcConnection.java | 222 - .../apache/hadoop/hbase/ipc/AbstractTestIPC.java | 59 +- .../org/apache/hadoop/hbase/ipc/TestNettyIPC.java | 1 + pom.xml| 12 +- 14 files changed, 299 insertions(+), 174 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java index 4bbb729..9117fef 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java @@ -21,6 +21,9 @@ package org.apache.hadoop.hbase.ipc; import static org.apache.hadoop.hbase.ipc.IPCUtil.toIOE; import static org.apache.hadoop.hbase.ipc.IPCUtil.wrapException; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.StatusCode; +import io.opentelemetry.context.Scope; import java.io.IOException; import java.net.SocketAddress; import java.util.Collection; @@ -38,6 +41,7 @@ import org.apache.hadoop.hbase.codec.KeyValueCodec; import org.apache.hadoop.hbase.net.Address; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.security.UserProvider; +import org.apache.hadoop.hbase.trace.TraceUtil; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.PoolMap; import org.apache.hadoop.hbase.util.Threads; @@ -365,7 +369,7 @@ public abstract class AbstractRpcClient implements RpcC protected abstract T createConnection(ConnectionId remoteId) throws IOException; private void onCallFinished(Call call, HBaseRpcController hrc, Address addr, - RpcCallback callback) { +RpcCallback callback) { call.callStats.setCallTimeMs(EnvironmentEdgeManager.currentTime() - call.getStartTime()); if (metrics != null) { metrics.updateRpc(call.md, call.param, call.callStats); @@ -388,44 +392,59 @@ public abstract class AbstractRpcClient implements RpcC } } - Call callMethod(final Descriptors.MethodDescriptor md, final HBaseRpcController hrc, + private Call callMethod(final Descriptors.MethodDescriptor md, final HBaseRpcController hrc, final Message param, Message returnType, final User ticket, final Address addr, final RpcCallback callback) { -final MetricsConnection.CallStats cs = MetricsConnection.newCallStats(); -cs.setStartTime(EnvironmentEdgeManager.currentTime()); - -if (param instanceof ClientProtos.MultiRequest) { - ClientProtos.MultiRequest req = (ClientProtos.MultiRequest) param; - int numActions = 0; - for (ClientProtos.RegionAction regionAction : req.getRegionActionList()) { -numActions += regionAction.getActionCount(); - } +Span span = TraceUtil.getGlobalTracer().spanBuilder("RpcClient.callMethod." + md.getFullName()) + .startSpan(); +try (Scope scope = span.makeCurrent()) { + final MetricsConnection.CallStats cs = MetricsConnection.newCallStats(); + cs.setStartTime(EnvironmentEdgeManager.currentTime()); + + if (param instanceof ClientProtos.MultiRequest) { +ClientProtos.MultiRequest req = (ClientProtos.MultiRequest) param; +int numActions = 0; +for (ClientProtos.RegionAction regionAction : req.getRegionActionList()) { + numActions += regionAction.getActionCount(); +} - cs.setNumActionsPerServer(numActions); -} +cs.setNumActionsPerServer(numActions); + } -final AtomicInteger counter = concurrentCounterCache.getUnchecked(addr); -Call call = new Call(nextCallId(), md, param, hrc.cellScanner(), returnType, + final AtomicInteger counter = concurrentCounterCache.getUnchecked(addr); + Call call = new Call(nextCal
[hbase] 07/18: HBASE-26130 Backport HBASE-25455 "Add trace support for HRegion read/… (#3594)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 811f089f0c87acee1b0e3941148c237b392f0408 Author: Tak Lon (Stephen) Wu AuthorDate: Tue Aug 17 22:37:41 2021 -0700 HBASE-26130 Backport HBASE-25455 "Add trace support for HRegion read/… (#3594) 7/17 commits of HBASE-22120, original commit 03e12bfa4ad62ecc6eee6a2c68d431bea2d5c473 Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang --- .../hadoop/hbase/client/AsyncRegionLocator.java| 3 +- .../apache/hadoop/hbase/ipc/AbstractRpcClient.java | 3 +- .../org/apache/hadoop/hbase/trace/TraceUtil.java | 40 - .../org/apache/hadoop/hbase/ipc/CallRunner.java| 6 +- .../org/apache/hadoop/hbase/ipc/ServerCall.java| 4 +- .../apache/hadoop/hbase/regionserver/HRegion.java | 185 +++- .../hbase/regionserver/RegionScannerImpl.java | 101 ++- .../hbase/regionserver/TestAtomicOperation.java| 2 +- .../hbase/regionserver/TestHRegionTracing.java | 187 + 9 files changed, 393 insertions(+), 138 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java index 1d0efcc..3067785 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocator.java @@ -102,8 +102,7 @@ class AsyncRegionLocator { CompletableFuture future = action.get(); FutureUtils.addListener(future, (resp, error) -> { if (error != null) { - span.recordException(error); - span.setStatus(StatusCode.ERROR); + TraceUtil.setError(span, error); } else { List regionNames = getRegionNames.apply(resp); if (!regionNames.isEmpty()) { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java index 878f9cf..fa7dfb1 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java @@ -424,8 +424,7 @@ public abstract class AbstractRpcClient implements RpcC onCallFinished(call, hrc, addr, callback); } finally { if (hrc.failed()) { -span.setStatus(StatusCode.ERROR); -span.recordException(hrc.getFailed()); +TraceUtil.setError(span, hrc.getFailed()); } else { span.setStatus(StatusCode.OK); } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java index 8eb2399..ea16df1 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java @@ -26,6 +26,7 @@ import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.api.trace.attributes.SemanticAttributes; import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; +import java.io.IOException; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; @@ -58,6 +59,9 @@ public final class TraceUtil { public static final AttributeKey REMOTE_PORT_KEY = SemanticAttributes.NET_PEER_PORT; + public static final AttributeKey ROW_LOCK_READ_LOCK_KEY = +AttributeKey.booleanKey("db.hbase.rowlock.readlock"); + private TraceUtil() { } @@ -139,14 +143,18 @@ public final class TraceUtil { } } + public static void setError(Span span, Throwable error) { +span.recordException(error); +span.setStatus(StatusCode.ERROR); + } + /** * Finish the {@code span} when the given {@code future} is completed. */ private static void endSpan(CompletableFuture future, Span span) { FutureUtils.addListener(future, (resp, error) -> { if (error != null) { -span.recordException(error); -span.setStatus(StatusCode.ERROR); +setError(span, error); } else { span.setStatus(StatusCode.OK); } @@ -164,8 +172,32 @@ public final class TraceUtil { action.run(); span.setStatus(StatusCode.OK); } catch (Throwable e) { - span.recordException(e); - span.setStatus(StatusCode.ERROR); + setError(span, e); + throw e; +} finally { + span.end(); +} + } + + @FunctionalInterface + public interface IOExceptionCallable { +V call() throws IOException; + } + + public static T trace(IOExceptionCallable callable, String spanName) throws IOException { +return trace(callable,
[hbase] 01/18: HBASE-26124 Backport HBASE-25373 "Remove HTrace completely in code base and try to make use of OpenTelemetry" to branch-2 (#3529)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit fc1aa5c044c5934fcec30bdd9a9758074157e561 Author: Tak Lon (Stephen) Wu AuthorDate: Thu Jul 29 09:15:10 2021 -0700 HBASE-26124 Backport HBASE-25373 "Remove HTrace completely in code base and try to make use of OpenTelemetry" to branch-2 (#3529) 1/17 commits of HBASE-22120 Signed-off-by: Peter Somogyi --- .../hadoop/hbase/io/asyncfs/AsyncFSTestBase.java | 3 - hbase-client/pom.xml | 4 +- .../hbase/client/AsyncRequestFutureImpl.java | 14 +- .../client/ResultBoundedCompletionService.java | 4 +- .../hadoop/hbase/ipc/BlockingRpcConnection.java| 11 +- .../java/org/apache/hadoop/hbase/ipc/Call.java | 7 +- hbase-common/pom.xml | 4 +- .../hbase/trace/HBaseHTraceConfiguration.java | 80 --- .../hadoop/hbase/trace/SpanReceiverHost.java | 120 - .../org/apache/hadoop/hbase/trace/TraceUtil.java | 105 +-- hbase-external-blockcache/pom.xml | 4 - .../hadoop/hbase/io/hfile/MemcachedBlockCache.java | 14 +- hbase-it/pom.xml | 4 +- .../IntegrationTestTableMapReduceUtil.java | 1 - .../hadoop/hbase/mttr/IntegrationTestMTTR.java | 21 +-- .../trace/IntegrationTestSendTraceRequests.java| 135 ++- hbase-mapreduce/pom.xml| 4 +- .../hadoop/hbase/mapreduce/TableMapReduceUtil.java | 1 - .../apache/hadoop/hbase/PerformanceEvaluation.java | 29 ++-- hbase-protocol-shaded/pom.xml | 4 - hbase-server/pom.xml | 4 +- .../apache/hadoop/hbase/executor/EventHandler.java | 16 ++- .../hadoop/hbase/io/hfile/HFileReaderImpl.java | 11 +- .../org/apache/hadoop/hbase/ipc/CallRunner.java| 31 +++-- .../org/apache/hadoop/hbase/master/HMaster.java| 2 - .../hadoop/hbase/master/HMasterCommandLine.java| 6 +- .../apache/hadoop/hbase/regionserver/HRegion.java | 15 ++- .../hadoop/hbase/regionserver/HRegionServer.java | 9 -- .../regionserver/HRegionServerCommandLine.java | 8 +- .../hadoop/hbase/regionserver/MemStoreFlusher.java | 14 +- .../hbase/regionserver/wal/AbstractFSWAL.java | 19 ++- .../hadoop/hbase/regionserver/wal/AsyncFSWAL.java | 21 +-- .../hadoop/hbase/regionserver/wal/FSHLog.java | 22 +-- .../apache/hadoop/hbase/HBaseTestingUtility.java | 13 +- .../hadoop/hbase/executor/TestExecutorService.java | 4 +- .../apache/hadoop/hbase/trace/TestHTraceHooks.java | 134 --- .../org/apache/hadoop/hbase/trace/TraceTree.java | 148 - .../hadoop/hbase/wal/WALPerformanceEvaluation.java | 73 +++--- hbase-shaded/hbase-shaded-client/pom.xml | 1 + hbase-shaded/hbase-shaded-testing-util/pom.xml | 1 + hbase-shaded/pom.xml | 1 + hbase-shell/src/main/ruby/shell/commands/trace.rb | 43 +++--- hbase-zookeeper/pom.xml| 4 + .../hbase/zookeeper/RecoverableZooKeeper.java | 77 --- pom.xml| 30 - 45 files changed, 362 insertions(+), 914 deletions(-) diff --git a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java index 9b276ac..fc148e8 100644 --- a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java +++ b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java @@ -19,11 +19,9 @@ package org.apache.hadoop.hbase.io.asyncfs; import java.io.File; import java.io.IOException; - import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.trace.TraceUtil; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -104,7 +102,6 @@ public abstract class AsyncFSTestBase { org.apache.log4j.Logger.getLogger(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class) .setLevel(org.apache.log4j.Level.ERROR); -TraceUtil.initTracer(conf); CLUSTER = new MiniDFSCluster.Builder(conf).numDataNodes(servers).build(); CLUSTER.waitClusterUp(); } diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index 08e9174..e62a7d1 100644 --- a/hbase-client/pom.xml +++ b/hbase-client/pom.xml @@ -145,8 +145,8 @@ zookeeper - org.apache.htrace - htrace-core4 + io.opentelemetry + opentelemetry-api org.jruby.jcodings diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequest
[hbase] branch HBASE-25853 updated (fc779d1 -> 791fd64)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a change to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git. discard fc779d1 HBASE-26168 Backport HBASE-25811 "The client integration test is failing after HBASE-22120 merged" into branch-2 (#3634) omit d807632 HBASE-26140 Backport HBASE-25778 "The tracinig implementation for AsyncConnectionImpl.getHbck is incorrect" to branch-2 (#3631) omit c967467 HBASE-26139 Backport HBASE-23762 "Add documentation on how to enable and view tracing with OpenTelemetry" to branch-2 (#3629) omit 8e4d98e HBASE-26138 Backport HBASE-25733 "Upgrade opentelemetry to 1.0.1" to branch-2 (#3628) omit d8f1ffa HBASE-26137 Backport HBASE-25732 "Change the command line argument for tracing after upgrading opentelemtry to 1.0.0" to branch-2 (#3624) omit 817cfe1 HBASE-26136 Backport HBASE-25723 "Temporarily remove the trace support for RegionScanner.next" to branch-2 (#3623) omit 5c91830 HBASE-26135 Backport HBASE-25616 "Upgrade opentelemetry to 1.0.0" to branch-2 (#3620) omit 5de0ef3 HBASE-26134 Backport HBASE-25617 "Revisit the span names" to branch-2 (#3618) omit f318d5e HBASE-26133 Backport HBASE-25591 "Upgrade opentelemetry to 0.17.1" to branch-2 (#3608) omit 9724df0 HBASE-26132 Backport HBASE-25535 "Set span kind to CLIENT in AbstractRpcClient" to branch-2 (#3607) omit 6a0f159 HBASE-26131 Backport HBASE-25484 "Add trace support for WAL sync" to branch-2 (#3597) omit 3d7bd1e HBASE-26130 Backport HBASE-25455 "Add trace support for HRegion read/… (#3594) omit a618459 HBASE-26129 Backport HBASE-25481 "Add host and port attribute when tracing rpc call at client side" to branch-2 (#3589) omit 77b1dde HBASE-26128 Backport HBASE-25454 "Add trace support for connection re… (#3561) omit a03ce5a HBASE-26176 Addendum fix regex in jenkins_precommit_github_yetus.sh omit 1a30692 HBASE-26176 Correct regex in hbase-personality.sh (#3568) omit 4fbc4c2 HBASE-26127 Backport HBASE-23898 "Add trace support for simple apis i… (#3556) omit 287aac5 HBASE-26126 Backport HBASE-25424 "Find a way to config OpenTelemetry tracing without directly depending on opentelemetry-sdk" to branch-2 (#3552) omit 82d4765 HBASE-26125 Backport HBASE-25401 "Add trace support for async call in rpc client" to branch-2 (#3543) omit 3c75c8d HBASE-26124 Backport HBASE-25373 "Remove HTrace completely in code base and try to make use of OpenTelemetry" to branch-2 (#3529) add 4f0f519 HBASE-26142 NullPointerException when set 'hbase.hregion.memstore.mslab.indexchunksize.percent' to zero (#3531) add 61fbe6f HBASE-26170 handleTooBigRequest in NettyRpcServer didn't skip enough bytes (#3564) add 611ffa7 HBASE-26179 TestRequestTooBigException spends too much time to finish (#3571) add 57361bb HBASE-26176 Correct regex in hbase-personality.sh (#3567) add 79a6dc6 HBASE-6908: Add pluggable rpc queue implementation (#3522) add 40a7a75 HBASE-26185 Fix TestMaster#testMoveRegionWhenNotInitialized in the presence of hbase.min.version.move.system.tables (#3573) add 8f16e34 HBASE-26122: Implement an optional maximum size for Gets, after which a partial result is returned (#3532) add 243e861 Revert "HBASE-26122: Implement an optional maximum size for Gets, after which a partial result is returned (#3532)" add 6b9114d HBASE-26185 Return mutable list in AssignmentManager#getExcludedServersForSystemTable (#3577) add e8ecafb HBASE-26155 JVM crash when scan (#3553) add 725474b HBASE-26026 HBase Write may be stuck forever when using CompactingMemStore (#3421) add 4aec407 HBASE-25680 Non-idempotent test in TestReplicationHFileCleaner (#2984) add e08b364 HBASE-26196 Support configuration override for remote cluster of HFileOutputFormat locality sensitive (#3582) add 63c57d7 HBASE-26200 Revert "HBASE-25165 Change 'State time' in UI so sorts (#2508)" add 5eac407 HBASE-24652 master-status UI make date type fields sortable add 13c5cfa HBASE-24570 connection#close throws NPE add d99ca37 HBASE-26193 Do not store meta region location as permanent state on zookeeper (#3583) add 4ccd215 HBASE-26087 JVM crash when displaying RPC params by MonitoredRPCHandler (#3489) add 30c20d7 HBASE-26187 Write straight into the store directory when Splitting an… (#3574) (#3595) add f2f99ae Amend HBASE-26187 UTs, adding a check for Split procedure completion before proceeding with test logic. (#3598) add 1016020 HBASE-24337 Backport HBASE-23968 to branch-2 (#3588) add 6ad7eb8 HBASE-26172 Deprecated MasterRegistry (#3566) add 2728821 HBASE-26212 Expose configuration to enable/disable AuthUtil (#3619) add d8fb978 HBASE-26182 Allow disabling refresh of connection registry endpoint (#3605) add 5dad395 HBASE-26173 Return only a sub set of region
[hbase] 03/18: HBASE-26126 Backport HBASE-25424 "Find a way to config OpenTelemetry tracing without directly depending on opentelemetry-sdk" to branch-2 (#3552)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 350288e9820dec32acfaf890a7fd3f93b42ac47a Author: Tak Lon (Stephen) Wu AuthorDate: Tue Aug 3 09:54:37 2021 -0700 HBASE-26126 Backport HBASE-25424 "Find a way to config OpenTelemetry tracing without directly depending on opentelemetry-sdk" to branch-2 (#3552) 3/17 commits of HBASE-22120, original commit#57960fa8fa7228d65b1a4adc8e9b5b1a8158824d Co-authored-by: Duo Zhang Signed-off-by: Peter Somogyi --- bin/hbase| 10 ++ conf/hbase-env.sh| 5 + hbase-assembly/pom.xml | 6 ++ hbase-assembly/src/main/assembly/hadoop-three-compat.xml | 7 +++ pom.xml | 7 +++ 5 files changed, 35 insertions(+) diff --git a/bin/hbase b/bin/hbase index 496ebe1..5f3b326 100755 --- a/bin/hbase +++ b/bin/hbase @@ -487,6 +487,11 @@ add_jdk11_deps_to_classpath() { done } +enable_trace() { + agent_jar=$(find lib/trace -type f -name "opentelemetry-javaagent-*") + HBASE_OPTS="$HBASE_OPTS -javaagent:$agent_jar $HBASE_TRACE_OPTS" +} + #Add the development env class path stuff if $in_dev_env; then add_maven_deps_to_classpath "cached_classpath.txt" @@ -764,6 +769,11 @@ elif [ "${DEBUG}" = "true" ]; then echo "JDK11 jars skipped from classpath." fi +if [[ -n "${HBASE_TRACE_OPTS}" ]]; then + echo "Attach opentelemetry agent to enable trace" + enable_trace +fi + # Have JVM dump heap if we run out of memory. Files will be 'launch directory' # and are named like the following: java_pid21612.hprof. Apparently it doesn't # 'cost' to have this flag enabled. Its a 1.6 flag only. See: diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh index 6cc16d8..b3c4baf 100644 --- a/conf/hbase-env.sh +++ b/conf/hbase-env.sh @@ -144,3 +144,8 @@ # Additional argments passed to jshell invocation # export HBASE_JSHELL_ARGS="--startup DEFAULT --startup PRINTING --startup hbase_startup.jsh" + +# Uncomment to enable trace, you can change the options to use other exporters such as jaeger or +# zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to config +# exporters and other components through system properties. +# export HBASE_TRACE_OPTS="-Dotel.config.sampler.probability=0.1 -Dotel.exporter=logging" diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml index 451e9f3..4ea650d 100644 --- a/hbase-assembly/pom.xml +++ b/hbase-assembly/pom.xml @@ -339,6 +339,12 @@ log4j log4j + + + io.opentelemetry.javaagent + opentelemetry-javaagent + all + diff --git a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml index e5422f3..9780444 100644 --- a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml +++ b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml @@ -112,6 +112,7 @@ org.apache.yetus:audience-annotations org.slf4j:slf4j-api org.slf4j:slf4j-log4j12 + io.opentelemetry.javaagent:* @@ -256,6 +257,12 @@ jakarta.jws:jakarta.jws-api + + lib/trace + +io.opentelemetry.javaagent:* + + diff --git a/pom.xml b/pom.xml index 77d12ac..75b3c58 100755 --- a/pom.xml +++ b/pom.xml @@ -1483,6 +1483,7 @@ 4.13 1.3 0.13.1 + 0.13.0 1.2.17 2.28.2 @@ -2189,6 +2190,12 @@ ${opentelemetry.version} +io.opentelemetry.javaagent +opentelemetry-javaagent +${opentelemetry-instrumentation.version} +all + + com.lmax disruptor ${disruptor.version}
[hbase] branch HBASE-25853 updated: HBASE-26168 Backport HBASE-25811 "The client integration test is failing after HBASE-22120 merged" into branch-2 (#3634)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/HBASE-25853 by this push: new fc779d1 HBASE-26168 Backport HBASE-25811 "The client integration test is failing after HBASE-22120 merged" into branch-2 (#3634) fc779d1 is described below commit fc779d11613fdf3969477c6cca479f961e4d4249 Author: Tak Lon (Stephen) Wu AuthorDate: Fri Aug 27 09:09:55 2021 -0700 HBASE-26168 Backport HBASE-25811 "The client integration test is failing after HBASE-22120 merged" into branch-2 (#3634) move opentelemetry jars to client-facing-thirdparty add opentelemetry jars when init map reduce job dependencies original commit 8d2a0efb7a9c17e58892369b281b4af49a5f0d7e Co-authored-by: Duo Zhang Signed-off-by: Duo Zhang Signed-off-by: Peter Somogyi --- hbase-assembly/src/main/assembly/client.xml | 8 hbase-assembly/src/main/assembly/hadoop-three-compat.xml | 1 + .../org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hbase-assembly/src/main/assembly/client.xml b/hbase-assembly/src/main/assembly/client.xml index bd65cb4..48940b7 100644 --- a/hbase-assembly/src/main/assembly/client.xml +++ b/hbase-assembly/src/main/assembly/client.xml @@ -65,6 +65,7 @@ org.slf4j:jcl-over-slf4j org.slf4j:jul-to-slf4j org.slf4j:slf4j-log4j12 + io.opentelemetry.javaagent:* @@ -153,6 +154,13 @@ org.slf4j:jcl-over-slf4j org.slf4j:jul-to-slf4j org.slf4j:slf4j-log4j12 +io.opentelemetry:* + + + + lib/trace + +io.opentelemetry.javaagent:* diff --git a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml index 9780444..6c670a7 100644 --- a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml +++ b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml @@ -213,6 +213,7 @@ org.slf4j:jcl-over-slf4j org.slf4j:jul-to-slf4j org.slf4j:slf4j-log4j12 +io.opentelemetry:* diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java index 7910a5f..d8bffb3 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java @@ -832,7 +832,9 @@ public class TableMapReduceUtil { org.apache.zookeeper.ZooKeeper.class, // zookeeper com.google.protobuf.Message.class, // protobuf com.codahale.metrics.MetricRegistry.class, // metrics-core - org.apache.commons.lang3.ArrayUtils.class);// commons-lang + org.apache.commons.lang3.ArrayUtils.class, // commons-lang + io.opentelemetry.api.trace.Span.class, // opentelemetry-api + io.opentelemetry.semconv.trace.attributes.SemanticAttributes.class); // opentelemetry-semconv } /**
[hbase] branch branch-2 updated: HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632)
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch branch-2 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2 by this push: new 30bb72b HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632) 30bb72b is described below commit 30bb72bdb8c8796ca9a9e72991983b41074897a4 Author: Pankaj AuthorDate: Fri Aug 27 14:12:27 2021 +0530 HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632) Signed-off-by: Duo Zhang --- .../org/apache/hadoop/hbase/master/TestSplitWALManager.java| 10 ++ 1 file changed, 10 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java index e1f3188..5cabe0e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -233,11 +234,20 @@ public class TestSplitWALManager { ProcedureTestingUtility.submitAndWait(masterPE, procedures.get(0)); Assert.assertEquals(0, splitWALManager.getWALsToSplit(testServer, false).size()); +// Validate the old WAL file archive dir +Path walRootDir = hmaster.getMasterFileSystem().getWALRootDir(); +Path walArchivePath = new Path(walRootDir, HConstants.HREGION_OLDLOGDIR_NAME); +FileSystem walFS = hmaster.getMasterFileSystem().getWALFileSystem(); +int archiveFileCount = walFS.listStatus(walArchivePath).length; + procedures = splitWALManager.splitWALs(metaServer, true); Assert.assertEquals(1, procedures.size()); ProcedureTestingUtility.submitAndWait(masterPE, procedures.get(0)); Assert.assertEquals(0, splitWALManager.getWALsToSplit(metaServer, true).size()); Assert.assertEquals(1, splitWALManager.getWALsToSplit(metaServer, false).size()); +// There should be archiveFileCount + 1 WALs after SplitWALProcedure finish +Assert.assertEquals("Splitted WAL files should be archived", archiveFileCount + 1, + walFS.listStatus(walArchivePath).length); } @Test
[hbase] branch branch-2.4 updated: HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632)
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch branch-2.4 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.4 by this push: new 1a5b9b7 HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632) 1a5b9b7 is described below commit 1a5b9b7ff65ab06042d0429d824ad16c8941ad68 Author: Pankaj AuthorDate: Fri Aug 27 14:12:27 2021 +0530 HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632) Signed-off-by: Duo Zhang --- .../org/apache/hadoop/hbase/master/TestSplitWALManager.java| 10 ++ 1 file changed, 10 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java index e1f3188..5cabe0e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -233,11 +234,20 @@ public class TestSplitWALManager { ProcedureTestingUtility.submitAndWait(masterPE, procedures.get(0)); Assert.assertEquals(0, splitWALManager.getWALsToSplit(testServer, false).size()); +// Validate the old WAL file archive dir +Path walRootDir = hmaster.getMasterFileSystem().getWALRootDir(); +Path walArchivePath = new Path(walRootDir, HConstants.HREGION_OLDLOGDIR_NAME); +FileSystem walFS = hmaster.getMasterFileSystem().getWALFileSystem(); +int archiveFileCount = walFS.listStatus(walArchivePath).length; + procedures = splitWALManager.splitWALs(metaServer, true); Assert.assertEquals(1, procedures.size()); ProcedureTestingUtility.submitAndWait(masterPE, procedures.get(0)); Assert.assertEquals(0, splitWALManager.getWALsToSplit(metaServer, true).size()); Assert.assertEquals(1, splitWALManager.getWALsToSplit(metaServer, false).size()); +// There should be archiveFileCount + 1 WALs after SplitWALProcedure finish +Assert.assertEquals("Splitted WAL files should be archived", archiveFileCount + 1, + walFS.listStatus(walArchivePath).length); } @Test
[hbase] branch master updated: HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632)
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/master by this push: new 11b32db HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632) 11b32db is described below commit 11b32dbfd3ec149153c4faf402b1a2a284c88eb8 Author: Pankaj AuthorDate: Fri Aug 27 14:12:27 2021 +0530 HBASE-26227 Forward port HBASE-26223 test code to branch-2.4+ (#3632) Signed-off-by: Duo Zhang --- .../org/apache/hadoop/hbase/master/TestSplitWALManager.java| 10 ++ 1 file changed, 10 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java index 0ea0c97..e97d43b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseTestingUtil; @@ -233,11 +234,20 @@ public class TestSplitWALManager { ProcedureTestingUtility.submitAndWait(masterPE, procedures.get(0)); Assert.assertEquals(0, splitWALManager.getWALsToSplit(testServer, false).size()); +// Validate the old WAL file archive dir +Path walRootDir = hmaster.getMasterFileSystem().getWALRootDir(); +Path walArchivePath = new Path(walRootDir, HConstants.HREGION_OLDLOGDIR_NAME); +FileSystem walFS = hmaster.getMasterFileSystem().getWALFileSystem(); +int archiveFileCount = walFS.listStatus(walArchivePath).length; + procedures = splitWALManager.splitWALs(metaServer, true); Assert.assertEquals(1, procedures.size()); ProcedureTestingUtility.submitAndWait(masterPE, procedures.get(0)); Assert.assertEquals(0, splitWALManager.getWALsToSplit(metaServer, true).size()); Assert.assertEquals(1, splitWALManager.getWALsToSplit(metaServer, false).size()); +// There should be archiveFileCount + 1 WALs after SplitWALProcedure finish +Assert.assertEquals("Splitted WAL files should be archived", archiveFileCount + 1, + walFS.listStatus(walArchivePath).length); } @Test