Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

huaxiangsun
Copy link
Contributor

…etAllRegionLocations()

Signed-off-by: Duo Zhang [email protected]

@huaxiangsun huaxiangsun 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
Contributor Author

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

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 33s 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.
_ branch-2 Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for branch
+1 💚 mvninstall 3m 52s branch-2 passed
+1 💚 compile 4m 19s branch-2 passed
+1 💚 checkstyle 1m 42s branch-2 passed
+1 💚 spotbugs 3m 18s branch-2 passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
+1 💚 mvninstall 3m 30s the patch passed
+1 💚 compile 4m 24s the patch passed
+1 💚 javac 4m 24s the patch passed
-0 ⚠️ checkstyle 0m 34s hbase-client: The patch generated 3 new + 76 unchanged - 0 fixed = 79 total (was 76)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 12m 38s Patch does not cause any errors with Hadoop 3.1.2 3.2.1.
+1 💚 spotbugs 3m 43s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 29s The patch does not generate ASF License warnings.
49m 29s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2 / 76eb1b0
Default Java AdoptOpenJDK-1.8.0_282-b08
checkstyle https://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 count 96 (vs. ulimit of 12500)
modules C: hbase-client hbase-server U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 29s Docker mode activated.
-0 ⚠️ yetus 0m 7s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+0 🆗 mvndep 0m 18s Maven dependency ordering for branch
+1 💚 mvninstall 4m 27s branch-2 passed
+1 💚 compile 1m 43s branch-2 passed
+1 💚 shadedjars 7m 24s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 11s branch-2 passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 22s Maven dependency ordering for patch
+1 💚 mvninstall 4m 14s the patch passed
+1 💚 compile 1m 41s the patch passed
+1 💚 javac 1m 41s the patch passed
+1 💚 shadedjars 7m 18s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 9s the patch passed
_ Other Tests _
+1 💚 unit 3m 0s hbase-client in the patch passed.
+1 💚 unit 136m 44s hbase-server in the patch passed.
172m 48s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2 / 76eb1b0
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/testReport/
Max. process+thread count 4039 (vs. ulimit of 12500)
modules C: hbase-client hbase-server U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 4s Docker mode activated.
-0 ⚠️ yetus 0m 7s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for branch
+1 💚 mvninstall 4m 13s branch-2 passed
+1 💚 compile 1m 31s branch-2 passed
+1 💚 shadedjars 7m 11s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 4s branch-2 passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
+1 💚 mvninstall 3m 59s the patch passed
+1 💚 compile 1m 31s the patch passed
+1 💚 javac 1m 31s the patch passed
+1 💚 shadedjars 7m 14s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 2s the patch passed
_ Other Tests _
+1 💚 unit 2m 43s hbase-client in the patch passed.
+1 💚 unit 235m 40s hbase-server in the patch passed.
270m 21s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2 / 76eb1b0
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/testReport/
Max. process+thread count 2623 (vs. ulimit of 12500)
modules C: hbase-client hbase-server U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4078/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@Apache9 Apache9 left a comment

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.

@@ -53,6 +54,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.apache.hadoop.hbase.client.RegionLocator.LOCATOR_META_REPLICAS_MODE;
Copy link
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();
Copy link
Contributor

@Apache9 Apache9 Jan 30, 2022

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

Copy link
Contributor Author

@huaxiangsun huaxiangsun Jan 31, 2022

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
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport This 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