Skip to content

Conversation

sanjeet006py
Copy link
Contributor

JIRA: HBASE-29626

…orrect and cleaner consumption in Coproc hooks
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@virajjasani virajjasani changed the title HBASE-29626: Refactor how server side scan metrics are populated for correct and cleaner consumption in Coproc hooks HBASE-29626: Refactor server side scan metrics for Coproc hooks Sep 24, 2025
Copy link
Contributor

@virajjasani virajjasani left a comment

Choose a reason for hiding this comment

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

Left minor comments, looks good overall

}

@Override
public long getFsReadTime() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove getFsReadTime() entirely? It's of no use anyways right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I wanted remove these from RpcCall interface but I saw that RpcCall is marked LimitedPrivate with visibility to Phoenix and Coprocs in general while ServerCall its HBase implementation is marked Private.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is recently introduced, we can remove it for IA.LP

Comment on lines -151 to -156
boolean isScanMetricsEnabled = scan.isScanMetricsEnabled();
ThreadLocalServerSideScanMetrics.setScanMetricsEnabled(isScanMetricsEnabled);
if (isScanMetricsEnabled) {
this.scannerInitMetrics = new ServerSideScanMetrics();
ThreadLocalServerSideScanMetrics.reset();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I am bit confused, do we really not need this at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The removed code in RegionScannerImpl was doing two things:

  • Capturing server side scan metrics even when RegionScanner is initialized and passing it to the next() call in RegionScannerImpl to update ServerSideScanMetrics from ScannerContext.
  • Resetting the state of thread local variable to start fresh for a scan.

For the first point given the call to RegionScannerImpl constructor and next() happens from same thread and its the same thread which is handling RSRpcServices#scan() call so, we can avoid passing around ServerSideScanMetrics from constructor to next() call if we populate ServerSideScanMetrics in RSRpcServices as done for some other scan metrics already.

For second point, I am taking care of resetting the thread local variables for each call in RSRpcServices#scan() call and its much cleaner also.

So, we are still doing same thing in RSRpcServices which we used to do in RegionScannerImpl it's just that its more concise and cleaner now. Please let me know if I am missing something. Thanks

Copy link
Contributor

@virajjasani virajjasani left a comment

Choose a reason for hiding this comment

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

+1, pending build results

@Apache-HBase

This comment has been minimized.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 47s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+1 💚 mvninstall 3m 59s master passed
+1 💚 compile 4m 5s master passed
+1 💚 checkstyle 0m 44s master passed
+1 💚 spotbugs 1m 51s master passed
+1 💚 spotless 0m 51s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 34s the patch passed
+1 💚 compile 3m 28s the patch passed
+1 💚 javac 3m 28s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 38s the patch passed
+1 💚 spotbugs 1m 43s the patch passed
+1 💚 hadoopcheck 12m 3s Patch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚 spotless 0m 44s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 10s The patch does not generate ASF License warnings.
42m 14s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7340/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7340
JIRA Issue HBASE-29626
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 896aa453ac24 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 3aa66b7
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 85 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7340/3/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 27s master passed
+1 💚 compile 1m 0s master passed
+1 💚 javadoc 0m 29s master passed
+1 💚 shadedjars 6m 19s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 11s the patch passed
+1 💚 compile 1m 1s the patch passed
+1 💚 javac 1m 1s the patch passed
+1 💚 javadoc 0m 27s the patch passed
+1 💚 shadedjars 6m 17s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 213m 59s hbase-server in the patch passed.
241m 14s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7340/3/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7340
JIRA Issue HBASE-29626
Optional Tests javac javadoc unit compile shadedjars
uname Linux 246464e43337 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 3aa66b7
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7340/3/testReport/
Max. process+thread count 3907 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7340/3/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@virajjasani virajjasani merged commit 2d88120 into apache:master Oct 3, 2025
1 check passed
virajjasani pushed a commit that referenced this pull request Oct 3, 2025
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.

3 participants