Skip to content

HBASE-25217 [Metrics] Add metrics for Call in IPC response queue#2585

Closed
Reidddddd wants to merge 4 commits intoapache:branch-1from
Reidddddd:HBASE-25217-b1
Closed

HBASE-25217 [Metrics] Add metrics for Call in IPC response queue#2585
Reidddddd wants to merge 4 commits intoapache:branch-1from
Reidddddd:HBASE-25217-b1

Conversation

@Reidddddd
Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 6m 37s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-0 ⚠️ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ branch-1 Compile Tests _
+0 🆗 mvndep 2m 24s Maven dependency ordering for branch
+1 💚 mvninstall 8m 1s branch-1 passed
+1 💚 compile 1m 10s branch-1 passed with JDK v1.8.0_262
+1 💚 compile 1m 20s branch-1 passed with JDK v1.7.0_272
+1 💚 checkstyle 2m 8s branch-1 passed
+1 💚 shadedjars 2m 58s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 8s branch-1 passed with JDK v1.8.0_262
+1 💚 javadoc 1m 14s branch-1 passed with JDK v1.7.0_272
+0 🆗 spotbugs 2m 48s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 4m 7s branch-1 passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 20s Maven dependency ordering for patch
+1 💚 mvninstall 2m 2s the patch passed
+1 💚 compile 1m 9s the patch passed with JDK v1.8.0_262
+1 💚 javac 1m 9s the patch passed
+1 💚 compile 1m 14s the patch passed with JDK v1.7.0_272
+1 💚 javac 1m 14s the patch passed
-1 ❌ checkstyle 0m 17s hbase-hadoop2-compat: The patch generated 1 new + 2 unchanged - 1 fixed = 3 total (was 3)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedjars 2m 53s patch has no errors when building our shaded downstream artifacts.
+1 💚 hadoopcheck 4m 42s Patch does not cause any errors with Hadoop 2.8.5 2.9.2.
+1 💚 javadoc 0m 57s the patch passed with JDK v1.8.0_262
+1 💚 javadoc 1m 16s the patch passed with JDK v1.7.0_272
+1 💚 findbugs 4m 19s the patch passed
_ Other Tests _
+1 💚 unit 0m 27s hbase-hadoop-compat in the patch passed.
+1 💚 unit 0m 38s hbase-hadoop2-compat in the patch passed.
+1 💚 unit 115m 24s hbase-server in the patch passed.
+1 💚 asflicense 1m 11s The patch does not generate ASF License warnings.
174m 10s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/1/artifact/out/Dockerfile
GITHUB PR #2585
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 6c0c229d7aa2 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-agent/workspace/Base-PreCommit-GitHub-PR_PR-2585/out/precommit/personality/provided.sh
git revision branch-1 / b30d1d1
Default Java 1.7.0_272
Multi-JDK versions /usr/lib/jvm/zulu-8-amd64:1.8.0_262 /usr/lib/jvm/zulu-7-amd64:1.7.0_272
checkstyle https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/1/artifact/out/diff-checkstyle-hbase-hadoop2-compat.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/1/testReport/
Max. process+thread count 3829 (vs. ulimit of 10000)
modules C: hbase-hadoop-compat hbase-hadoop2-compat hbase-server U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/1/console
versions git=1.9.1 maven=3.0.5 findbugs=3.0.1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 1s The patch does not contain any @author tags.
-0 ⚠️ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ branch-1 Compile Tests _
+0 🆗 mvndep 2m 24s Maven dependency ordering for branch
+1 💚 mvninstall 8m 1s branch-1 passed
+1 💚 compile 1m 13s branch-1 passed with JDK v1.8.0_262
+1 💚 compile 1m 17s branch-1 passed with JDK v1.7.0_272
+1 💚 checkstyle 2m 12s branch-1 passed
+1 💚 shadedjars 3m 4s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 8s branch-1 passed with JDK v1.8.0_262
+1 💚 javadoc 1m 17s branch-1 passed with JDK v1.7.0_272
+0 🆗 spotbugs 2m 49s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 4m 13s branch-1 passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 19s Maven dependency ordering for patch
+1 💚 mvninstall 2m 17s the patch passed
+1 💚 compile 1m 13s the patch passed with JDK v1.8.0_262
+1 💚 javac 1m 13s the patch passed
+1 💚 compile 1m 21s the patch passed with JDK v1.7.0_272
+1 💚 javac 1m 21s the patch passed
+1 💚 checkstyle 0m 15s The patch passed checkstyle in hbase-hadoop-compat
+1 💚 checkstyle 0m 15s hbase-hadoop2-compat: The patch generated 0 new + 2 unchanged - 1 fixed = 2 total (was 3)
+1 💚 checkstyle 1m 33s The patch passed checkstyle in hbase-server
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedjars 2m 56s patch has no errors when building our shaded downstream artifacts.
+1 💚 hadoopcheck 4m 34s Patch does not cause any errors with Hadoop 2.8.5 2.9.2.
+1 💚 javadoc 0m 59s the patch passed with JDK v1.8.0_262
+1 💚 javadoc 1m 12s the patch passed with JDK v1.7.0_272
+1 💚 findbugs 4m 25s the patch passed
_ Other Tests _
+1 💚 unit 0m 27s hbase-hadoop-compat in the patch passed.
+1 💚 unit 0m 38s hbase-hadoop2-compat in the patch passed.
+1 💚 unit 114m 17s hbase-server in the patch passed.
+1 💚 asflicense 1m 12s The patch does not generate ASF License warnings.
167m 32s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/2/artifact/out/Dockerfile
GITHUB PR #2585
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 43dcdd0efbae 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-agent/workspace/Base-PreCommit-GitHub-PR_PR-2585/out/precommit/personality/provided.sh
git revision branch-1 / b30d1d1
Default Java 1.7.0_272
Multi-JDK versions /usr/lib/jvm/zulu-8-amd64:1.8.0_262 /usr/lib/jvm/zulu-7-amd64:1.7.0_272
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/2/testReport/
Max. process+thread count 3676 (vs. ulimit of 10000)
modules C: hbase-hadoop-compat hbase-hadoop2-compat hbase-server U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/2/console
versions git=1.9.1 maven=3.0.5 findbugs=3.0.1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

Copy link
Copy Markdown
Contributor

@bharathv bharathv left a comment

Choose a reason for hiding this comment

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

Curious whats the context for this change? Noticed something fishy there in the call queue?

Need some tests here?

"were served from the tail of the queue";
String NUM_CALL_RESPONSE_QUEUE_NAME = "numCallsInResponseQueue";
String NUM_CALL_RESPONSE_QUEUE_DESC = "Number of calls in response queue.";
String NUM_SIZE_RESPONSE_QUEUE_NAME = "numSizeInResponseQueue";
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.

nit: SIZE_OF_RESPONSE_QUEUE and sizeOfResponseQueue ? num + size sounds confusing..

String NUM_CALL_RESPONSE_QUEUE_NAME = "numCallsInResponseQueue";
String NUM_CALL_RESPONSE_QUEUE_DESC = "Number of calls in response queue.";
String NUM_SIZE_RESPONSE_QUEUE_NAME = "numSizeInResponseQueue";
String NUM_SIZE_RESPONSE_QUEUE_DESC = "Size in response queue.";
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.

nit: .. of...

private final MutableFastCounter sentBytes;
private final MutableFastCounter receivedBytes;

private final MutableFastCounter numCallInResponseQueue;
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.

I think MutableGaugeLong is the right type for this.. Counters are meant to be always increasing where as a guage can go up and down...

@Reidddddd
Copy link
Copy Markdown
Contributor Author

Reidddddd commented Oct 29, 2020

Curious whats the context for this change? Noticed something fishy there in the call queue?

The main purpose is to gain better insight of the whole rpc process procedure. Currently, we have in request queue metrics, call processed metrics (queue time, wait time, total time etc), but we don't have metrics for calls in response queue which is the last part of the procedure.

I have some clients in production who fond of doing big joins or big scans, so I suspect if any possible that responses would be accumulated in such scenarios, knowing that socket channel only processed 64KB per chunk.

  protected long channelWrite(GatheringByteChannel channel, BufferChain bufferChain)
  throws IOException {
    long count =  bufferChain.write(channel, NIO_BUFFER_LIMIT); // 64KB
    if (count > 0) this.metrics.sentBytes(count);
    return count;
  }

@Apache-HBase
Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-0 ⚠️ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ branch-1 Compile Tests _
+0 🆗 mvndep 2m 25s Maven dependency ordering for branch
+1 💚 mvninstall 8m 0s branch-1 passed
+1 💚 compile 1m 9s branch-1 passed with JDK v1.8.0_262
+1 💚 compile 1m 17s branch-1 passed with JDK v1.7.0_272
+1 💚 checkstyle 2m 10s branch-1 passed
+1 💚 shadedjars 3m 3s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 8s branch-1 passed with JDK v1.8.0_262
+1 💚 javadoc 1m 16s branch-1 passed with JDK v1.7.0_272
+0 🆗 spotbugs 2m 40s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 4m 2s branch-1 passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 1m 55s the patch passed
+1 💚 compile 1m 11s the patch passed with JDK v1.8.0_262
+1 💚 javac 1m 11s the patch passed
+1 💚 compile 1m 17s the patch passed with JDK v1.7.0_272
+1 💚 javac 1m 17s the patch passed
+1 💚 checkstyle 0m 14s The patch passed checkstyle in hbase-hadoop-compat
+1 💚 checkstyle 0m 16s hbase-hadoop2-compat: The patch generated 0 new + 2 unchanged - 1 fixed = 2 total (was 3)
+1 💚 checkstyle 1m 32s The patch passed checkstyle in hbase-server
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedjars 2m 49s patch has no errors when building our shaded downstream artifacts.
+1 💚 hadoopcheck 4m 36s Patch does not cause any errors with Hadoop 2.8.5 2.9.2.
+1 💚 javadoc 0m 59s the patch passed with JDK v1.8.0_262
+1 💚 javadoc 1m 13s the patch passed with JDK v1.7.0_272
+1 💚 findbugs 4m 20s the patch passed
_ Other Tests _
+1 💚 unit 0m 28s hbase-hadoop-compat in the patch passed.
+1 💚 unit 0m 39s hbase-hadoop2-compat in the patch passed.
+1 💚 unit 107m 18s hbase-server in the patch passed.
+1 💚 asflicense 1m 17s The patch does not generate ASF License warnings.
159m 32s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/3/artifact/out/Dockerfile
GITHUB PR #2585
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 259517754cf8 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-agent/workspace/Base-PreCommit-GitHub-PR_PR-2585/out/precommit/personality/provided.sh
git revision branch-1 / b30d1d1
Default Java 1.7.0_272
Multi-JDK versions /usr/lib/jvm/zulu-8-amd64:1.8.0_262 /usr/lib/jvm/zulu-7-amd64:1.7.0_272
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/3/testReport/
Max. process+thread count 3615 (vs. ulimit of 10000)
modules C: hbase-hadoop-compat hbase-hadoop2-compat hbase-server U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/3/console
versions git=1.9.1 maven=3.0.5 findbugs=3.0.1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Reidddddd Reidddddd requested a review from bharathv October 30, 2020 03:42
@bharathv
Copy link
Copy Markdown
Contributor

I have some clients in production who fond of doing big joins or big scans, so I suspect if any possible that responses would be accumulated in such scenarios, knowing that socket channel only processed 64KB per chunk.

Ack, thanks. One last question, lgtm otherwise

We need any tests to assert some metrics state? (so that its not broken in the future inadvertently)

metrics.removeCallFromResponseQueue(call.response.getRemaining());
if (!processResponse(call)) {
connection.responseQueue.addFirst(call);
metrics.addCallToResponseQueue(call.response.getRemaining());
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.

Isn't the right way to do this something like..

 before = call.response.getRemaining();  <=== 1
  if (!processResponse(call)) {
   after = call.response.getRemaining();
   metrics.decr(after-before);  <=== 2
} else {
   metrics.decr(before);
}

The difference is you are not decrementing until the bytes are actually flushed, otherwise if a metrics poller polls between (1) and (2), there is some weird state in between, perhaps ^^ is more desirable for you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I got you.

@Apache-HBase
Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 12m 10s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-0 ⚠️ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ branch-1 Compile Tests _
+0 🆗 mvndep 2m 21s Maven dependency ordering for branch
+1 💚 mvninstall 8m 5s branch-1 passed
+1 💚 compile 1m 9s branch-1 passed with JDK v1.8.0_262
+1 💚 compile 1m 20s branch-1 passed with JDK v1.7.0_272
+1 💚 checkstyle 2m 19s branch-1 passed
+1 💚 shadedjars 3m 19s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 5s branch-1 passed with JDK v1.8.0_262
+1 💚 javadoc 1m 15s branch-1 passed with JDK v1.7.0_272
+0 🆗 spotbugs 2m 56s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 4m 18s branch-1 passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 2m 6s the patch passed
+1 💚 compile 1m 8s the patch passed with JDK v1.8.0_262
+1 💚 javac 1m 8s the patch passed
+1 💚 compile 1m 20s the patch passed with JDK v1.7.0_272
+1 💚 javac 1m 20s the patch passed
+1 💚 checkstyle 0m 14s The patch passed checkstyle in hbase-hadoop-compat
+1 💚 checkstyle 0m 14s hbase-hadoop2-compat: The patch generated 0 new + 2 unchanged - 1 fixed = 2 total (was 3)
+1 💚 checkstyle 1m 46s The patch passed checkstyle in hbase-server
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedjars 3m 7s patch has no errors when building our shaded downstream artifacts.
+1 💚 hadoopcheck 4m 54s Patch does not cause any errors with Hadoop 2.8.5 2.9.2.
+1 💚 javadoc 0m 59s the patch passed with JDK v1.8.0_262
+1 💚 javadoc 1m 15s the patch passed with JDK v1.7.0_272
+1 💚 findbugs 4m 40s the patch passed
_ Other Tests _
+1 💚 unit 0m 28s hbase-hadoop-compat in the patch passed.
+1 💚 unit 0m 37s hbase-hadoop2-compat in the patch passed.
+1 💚 unit 122m 36s hbase-server in the patch passed.
+1 💚 asflicense 1m 0s The patch does not generate ASF License warnings.
188m 28s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/4/artifact/out/Dockerfile
GITHUB PR #2585
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 61460ead477c 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 tool maven
Personality /home/jenkins/jenkins-home/workspace/Base-PreCommit-GitHub-PR_PR-2585/out/precommit/personality/provided.sh
git revision branch-1 / 8813b3b
Default Java 1.7.0_272
Multi-JDK versions /usr/lib/jvm/zulu-8-amd64:1.8.0_262 /usr/lib/jvm/zulu-7-amd64:1.7.0_272
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/4/testReport/
Max. process+thread count 4321 (vs. ulimit of 10000)
modules C: hbase-hadoop-compat hbase-hadoop2-compat hbase-server U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2585/4/console
versions git=1.9.1 maven=3.0.5 findbugs=3.0.1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Reidddddd
Copy link
Copy Markdown
Contributor Author

I applied it on my env. The response queue size got negative...
hmm, anywhere I missed?

@@ -1159,6 +1159,8 @@ private long purge(long lastPurgeTime) {
}
Call call = connection.responseQueue.peekFirst();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, peekFirst doesn't remove element.

@Reidddddd
Copy link
Copy Markdown
Contributor Author

I applied it on my env. The response queue size got negative, but numCallsInResponseQueue is normal
hmm, anywhere I missed?

Is it possible that getRemaining returns negative?

@bharathv
Copy link
Copy Markdown
Contributor

I don't know it on top of my head but mind adding a test for this :-), perhaps easier to debug with break points too if you can repro.

@Apache9 Apache9 closed this Aug 9, 2022
Sign up for free to 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.

4 participants