Skip to content

HBASE-26649 Support meta replica LoadBalance mode for RegionLocator#g… - #4078

Closed
huaxiangsun wants to merge 1 commit into
apache:branch-2from
huaxiangsun:b2.HBASE-26649
Closed

HBASE-26649 Support meta replica LoadBalance mode for RegionLocator#g…#4078
huaxiangsun wants to merge 1 commit into
apache:branch-2from
huaxiangsun:b2.HBASE-26649

Conversation

@huaxiangsun

Copy link
Copy Markdown
Contributor

…etAllRegionLocations()

Signed-off-by: Duo Zhang zhangduo@apache.org

@huaxiangsunhuaxiangsun added the backport This PR is a back port of some issue or issues already committed to master label Jan 28, 2022
@huaxiangsun

Copy link
Copy Markdown
ContributorAuthor

Hi @Apache9, please review backport as there are some difference between master and branch-2, thanks.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 33sDocker 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.
_ branch-2 Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for branch
+1 💚mvninstall3m 52sbranch-2 passed
+1 💚compile4m 19sbranch-2 passed
+1 💚checkstyle1m 42sbranch-2 passed
+1 💚spotbugs3m 18sbranch-2 passed
_ Patch Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for patch
+1 💚mvninstall3m 30sthe patch passed
+1 💚compile4m 24sthe patch passed
+1 💚javac4m 24sthe patch passed
-0 ⚠️checkstyle0m 34shbase-client: The patch generated 3 new + 76 unchanged - 0 fixed = 79 total (was 76)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck12m 38sPatch does not cause any errors with Hadoop 3.1.2 3.2.1.
+1 💚spotbugs3m 43sthe patch passed
_ Other Tests _
+1 💚asflicense0m 29sThe patch does not generate ASF License warnings.
49m 29s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4078
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
unameLinux 76054138f793 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 76eb1b0
Default JavaAdoptOpenJDK-1.8.0_282-b08
checkstylehttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-client.txt
Max. process+thread count96 (vs. ulimit of 12500)
modulesC: hbase-client hbase-server U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/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 🆗reexec0m 29sDocker mode activated.
-0 ⚠️yetus0m 7sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for branch
+1 💚mvninstall4m 27sbranch-2 passed
+1 💚compile1m 43sbranch-2 passed
+1 💚shadedjars7m 24sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 11sbranch-2 passed
_ Patch Compile Tests _
+0 🆗mvndep0m 22sMaven dependency ordering for patch
+1 💚mvninstall4m 14sthe patch passed
+1 💚compile1m 41sthe patch passed
+1 💚javac1m 41sthe patch passed
+1 💚shadedjars7m 18spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 9sthe patch passed
_ Other Tests _
+1 💚unit3m 0shbase-client in the patch passed.
+1 💚unit136m 44shbase-server in the patch passed.
172m 48s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4078
Optional Testsjavac javadoc unit shadedjars compile
unameLinux c271af92574e 4.15.0-156-generic #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 76eb1b0
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/testReport/
Max. process+thread count4039 (vs. ulimit of 12500)
modulesC: hbase-client hbase-server U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/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 🆗reexec1m 4sDocker mode activated.
-0 ⚠️yetus0m 7sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for branch
+1 💚mvninstall4m 13sbranch-2 passed
+1 💚compile1m 31sbranch-2 passed
+1 💚shadedjars7m 11sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 4sbranch-2 passed
_ Patch Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for patch
+1 💚mvninstall3m 59sthe patch passed
+1 💚compile1m 31sthe patch passed
+1 💚javac1m 31sthe patch passed
+1 💚shadedjars7m 14spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 2sthe patch passed
_ Other Tests _
+1 💚unit2m 43shbase-client in the patch passed.
+1 💚unit235m 40shbase-server in the patch passed.
270m 21s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#4078
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 718f07a20a07 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 revisionbranch-2 / 76eb1b0
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/testReport/
Max. process+thread count2623 (vs. ulimit of 12500)
modulesC: hbase-client hbase-server U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@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.

Sorry I do not think this is ready to go, also for the master PR. Haven't realized we have added a rpc call in the getMetaScan method. We should try to find another better way to do this.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.apache.hadoop.hbase.client.RegionLocator.LOCATOR_META_REPLICAS_MODE;

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.

Put static import on top

if (conn != null) {
try {
try (Table metaTable = getMetaHTable(conn)) {
numOfReplicas = metaTable.getDescriptor().getRegionReplication();

@Apache9Apache9Jan 30, 2022

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.

Ah, this is a bit painful... We used to expect getMetaScan to only contain memory operations but here we will have network io... And everytime we call this method it will generate a rpc calll...

Looking at the code above, in the async code we also have this and we even introduce a blocking rpc call. I haven't realized this when reviewing the PR for master, but obviously it is incorrect, we should not do blocking call in the async code. We should try to find a better way...

@huaxiangsunhuaxiangsunJan 31, 2022

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Nice find! Let me back out the master changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I reverted the commit to the master. You are right, the network call is bad. How about changing getMetaScan from a static method to a non-static one, so it can use a cached meta Replica count? Need to handle the case that meta replica count is changed dynamically.

…etAllRegionLocations()
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

backportThis PR is a back port of some issue or issues already committed to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@huaxiangsun@Apache-HBase@Apache9