Skip to content

HBASE-26521 Name RPC spans as $package.$service/$method - #4024

Merged
ndimiduk merged 5 commits into
apache:masterfrom
ndimiduk:26521-rename-RPC-spans
Feb 9, 2022
Merged

HBASE-26521 Name RPC spans as $package.$service/$method#4024
ndimiduk merged 5 commits into
apache:masterfrom
ndimiduk:26521-rename-RPC-spans

Conversation

@ndimiduk

Copy link
Copy Markdown
Member

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@ndimiduk
ndimidukforce-pushed the 26521-rename-RPC-spans branch 2 times, most recently from 2df6379 to 0571aafCompareJanuary 18, 2022 20:23
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

attributes.put(RPC_METHOD, method);
}

private static String getRpcPackageAndService(final Descriptors.MethodDescriptor md) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could move this method to a util class and also let the IpcServerSpanBuilder to call this method too? So in the future if we want to change the implementation, we could fix them both at the same time.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally against "util" classes. They indicate to me a lack of proper object/interface design and separation of concerns. I also prefer that test code reuse as little of the implementation code as is necessary -- and no more. The reason being that test code usually needs to test output behaviors. When test code and implementation share the same code for computing those behaviors, it nullifies the point.

Let me see what makes sense for these methods.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I follow this strategy in the latest patch. IpcServerSpanBuilder has the details of how these tracing variables are extracted from the MethodDescriptor instance. The test uses constant values rather than looking them up from some instance. I think this makes for a more robust test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But IpcServerSpanBuilder is not for testing only? It is what we need to use at server side? I can not follow...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood you. The latest commit consolidates the implementation for both IpcClientSpanBuilder and IpcServerSpanBuilder into IpcClientSpanBuilder.

return md.getService().getFullName();
}

private static String getRpcName(final Descriptors.MethodDescriptor md) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

return new FeatureMatcher<SpanData, T>(matcher, "SpanData having duration that ", "duration") {
@Override
@SuppressWarnings("unchecked")
protected T featureValueOf(SpanData item) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the implementation of java.time.Duration, it seems that it can only be compared with another Duration, so do we need to introduce a generic type here? Just use Duration directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, good point. I guess the T extends Comparable<T> & TemporalAmount stuff is overly broad.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@ndimiduk
ndimidukforce-pushed the 26521-rename-RPC-spans branch from 0571aaf to 9328e54CompareJanuary 24, 2022 20:30
@ndimiduk

Copy link
Copy Markdown
MemberAuthor

Hmm, backup/restore test failures.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

TestResult fails for me locally on branch-2.5 when running on JDK11 + Hadoop3. Not introduced by this change.

@Apache9

Copy link
Copy Markdown
Contributor

The failure of TestResult is because of HBASE-26688.

Let me see how to address it.

@ndimiduk
ndimiduk requested a review from Apache9January 27, 2022 17:48
@ndimiduk
ndimidukforce-pushed the 26521-rename-RPC-spans branch from 9328e54 to e26a7b5CompareJanuary 27, 2022 17:49
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@ndimiduk
ndimidukforce-pushed the 26521-rename-RPC-spans branch from e26a7b5 to 762d866CompareFebruary 1, 2022 22:20
@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

attributes.put(RPC_METHOD, method);
}

private static String getRpcPackageAndService(final Descriptors.MethodDescriptor md) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But IpcServerSpanBuilder is not for testing only? It is what we need to use at server side? I can not follow...


public IpcServerSpanBuilder(final RpcCall rpcCall) {
this.rpcCall = rpcCall;
// it happens that `getFullName` returns a string in the $package.$service format required by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that, we have this logic in both IpcServerSpanBuilder and IpcClientSpanBuilder, as what you said in the comment, we may have to parse the value in the future then we need to modify both places. So I suggest that we have a common method to generate the span name from the ServiceDescriptor and MethodDescriptor.

Simplify `SpanDataMatchers#hasDuration` to work explicitly with `Duration` instances.
@ndimiduk
ndimidukforce-pushed the 26521-rename-RPC-spans branch from 762d866 to 5680c8bCompareFebruary 7, 2022 15:56
Further consolidate implementation extracting method information from protobuf objects.
@ndimiduk
ndimidukforce-pushed the 26521-rename-RPC-spans branch from 5680c8b to b4bb876CompareFebruary 7, 2022 16:06
@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

remove unused import
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 59sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for branch
+1 💚mvninstall4m 20smaster passed
+1 💚compile9m 27smaster passed
+1 💚checkstyle2m 19smaster passed
+1 💚spotbugs15m 28smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for patch
+1 💚mvninstall4m 16sthe patch passed
+1 💚compile9m 26sthe patch passed
+1 💚javac9m 26sthe patch passed
+1 💚checkstyle2m 20sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚xml0m 3sThe patch has no ill-formed XML file.
+1 💚hadoopcheck22m 56sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotbugs18m 2sthe patch passed
_ Other Tests _
+1 💚asflicense0m 50sThe patch does not generate ASF License warnings.
102m 41s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4024
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile xml
unameLinux 2f033cef5fa0 4.15.0-163-generic #171-Ubuntu SMP Fri Nov 5 11:55:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 36d8654
Default JavaAdoptOpenJDK-1.8.0_282-b08
Max. process+thread count126 (vs. ulimit of 30000)
modulesC: hbase-common hbase-client hbase-server . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 0sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 34sMaven dependency ordering for branch
+1 💚mvninstall5m 10smaster passed
+1 💚compile3m 38smaster passed
+1 💚shadedjars9m 15sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc4m 47smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 19sMaven dependency ordering for patch
+1 💚mvninstall5m 3sthe patch passed
+1 💚compile3m 36sthe patch passed
+1 💚javac3m 36sthe patch passed
+1 💚shadedjars9m 8spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc4m 41sthe patch passed
_ Other Tests _
+1 💚unit270m 46sroot in the patch passed.
320m 47s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4024
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 115a8e68a1b6 4.15.0-162-generic #170-Ubuntu SMP Mon Oct 18 11:38:05 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 36d8654
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/testReport/
Max. process+thread count4403 (vs. ulimit of 30000)
modulesC: hbase-common hbase-client hbase-server . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 26sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 22sMaven dependency ordering for branch
+1 💚mvninstall3m 49smaster passed
+1 💚compile2m 44smaster passed
+1 💚shadedjars8m 17sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 36smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 22sMaven dependency ordering for patch
+1 💚mvninstall3m 48sthe patch passed
+1 💚compile2m 50sthe patch passed
+1 💚javac2m 50sthe patch passed
+1 💚shadedjars8m 14spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 35sthe patch passed
_ Other Tests _
-1 ❌unit380m 29sroot in the patch failed.
421m 50s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4024
Optional Testsjavac javadoc unit shadedjars compile
unameLinux a9294f2cd344 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 36d8654
Default JavaAdoptOpenJDK-1.8.0_282-b08
unithttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-root.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/testReport/
Max. process+thread count4981 (vs. ulimit of 30000)
modulesC: hbase-common hbase-client hbase-server . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4024/6/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@ndimiduk
ndimiduk requested a review from Apache9February 9, 2022 10:59

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks Nick for the hard work!

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

And thank you @Apache9 for sticking with me through the reviews!

@ndimiduk
ndimiduk merged commit 6c3c53a into apache:masterFeb 9, 2022
@ndimiduk
ndimiduk deleted the 26521-rename-RPC-spans branch February 9, 2022 14:22
ndimiduk added a commit to ndimiduk/hbase that referenced this pull request Feb 9, 2022
ndimiduk added a commit to ndimiduk/hbase that referenced this pull request Feb 9, 2022
ndimiduk added a commit that referenced this pull request Feb 10, 2022
Signed-off-by: Duo Zhang <zhangduo@apache.org>
ndimiduk added a commit that referenced this pull request Feb 10, 2022
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ndimiduk@Apache-HBase@Apache9