Skip to content

HBASE-23561 Look up of Region in Master by encoded region name is O(n) - #1193

Merged
wchevreuil merged 1 commit into
apache:masterfrom
mwkang:HBASE-23561
Feb 21, 2020
Merged

HBASE-23561 Look up of Region in Master by encoded region name is O(n)#1193
wchevreuil merged 1 commit into
apache:masterfrom
mwkang:HBASE-23561

Conversation

@mwkang

Copy link
Copy Markdown
Contributor

This is my first PR using github.
If something is wrong. please let me know.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec2m 4sDocker 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.
-0 ⚠️test4tests0m 0sThe 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.
_ master Compile Tests _
+1 💚mvninstall5m 37smaster passed
+1 💚compile0m 57smaster passed
+1 💚checkstyle1m 7smaster passed
+1 💚shadedjars4m 40sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 37smaster passed
+0 🆗spotbugs4m 15sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs4m 14smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 59sthe patch passed
+1 💚compile0m 59sthe patch passed
+1 💚javac0m 59sthe patch passed
+1 💚checkstyle1m 8sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚shadedjars4m 42spatch has no errors when building our shaded downstream artifacts.
+1 💚hadoopcheck16m 10sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 💚javadoc0m 38sthe patch passed
+1 💚findbugs4m 14sthe patch passed
_ Other Tests _
-1 ❌unit65m 8shbase-server in the patch failed.
+1 💚asflicense0m 35sThe patch does not generate ASF License warnings.
124m 29s
SubsystemReport/Notes
DockerClient=19.03.6 Server=19.03.6 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1193/1/artifact/out/Dockerfile
GITHUB PR#1193
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 4718f2be10ea 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/Base-PreCommit-GitHub-PR_PR-1193/out/precommit/personality/provided.sh
git revisionmaster / fe0d49b
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1193/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1193/1/testReport/
Max. process+thread count9750 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1193/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

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

LGTM.

The test failure reported is not an actual UT failure, somehow the jenkins process didn't terminate properly. Triggered a rebuild, just in case, planning to merge this later today if we get a green.

@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.
-0 ⚠️test4tests0m 0sThe 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.
_ master Compile Tests _
+1 💚mvninstall5m 35smaster passed
+1 💚compile0m 57smaster passed
+1 💚checkstyle1m 9smaster passed
+1 💚shadedjars4m 41sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 39smaster passed
+0 🆗spotbugs4m 18sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs4m 15smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 58sthe patch passed
+1 💚compile0m 57sthe patch passed
+1 💚javac0m 57sthe patch passed
+1 💚checkstyle1m 4sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚shadedjars4m 43spatch has no errors when building our shaded downstream artifacts.
+1 💚hadoopcheck16m 2sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 💚javadoc0m 37sthe patch passed
+1 💚findbugs4m 26sthe patch passed
_ Other Tests _
+1 💚unit64m 58shbase-server in the patch passed.
+1 💚asflicense0m 38sThe patch does not generate ASF License warnings.
122m 46s
SubsystemReport/Notes
DockerClient=19.03.6 Server=19.03.6 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1193/2/artifact/out/Dockerfile
GITHUB PR#1193
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 15416d7d2cb0 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/Base-PreCommit-GitHub-PR_PR-1193/out/precommit/personality/provided.sh
git revisionmaster / fe0d49b
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1193/2/testReport/
Max. process+thread count9839 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1193/2/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

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

@wchevreuil

Copy link
Copy Markdown
Contributor

Got a green, let me merge this PR. Thanks for the contribution, @mwkang !

@wchevreuil
wchevreuil merged commit 3ab0135 into apache:masterFeb 21, 2020

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

Thank you for working on this @mwkang It looks good. Only question is if the methods where we modify the two maps are sure to only have a single thread accessing them at at a time. I think they should be good because synchronize or locks are taken at a higher level by accessors IIRC. Might be worth a check.

@mwkang

mwkang commented Feb 23, 2020

Copy link
Copy Markdown
ContributorAuthor

@saintstack I think it looks okay. However, I am not sure only a single thread accessing them. And as you have already mentioned, If I want to synchronize two maps, I should use synchronize or locks. It was my mistake. I didn't think about it then. Should do I use synchronized or locks?

@mwkang

mwkang commented Feb 23, 2020

Copy link
Copy Markdown
ContributorAuthor

I think the current code may have different values for the two maps.
What do you think about changing it like below?

// ...privatefinalObjectregionsMapLock = newObject();
// ...RegionStateNodecreateRegionStateNode(RegionInforegionInfo) {
synchronized (regionsMapLock) {
RegionStateNodenode = regionsMap.computeIfAbsent(regionInfo.getRegionName(), key -> newRegionStateNod(regionInfo, regionInTransition));
encodedRegionsMap.putIfAbsent(node.getRegionInfo().getEncodedName(), node);
returnnode;
}
}

Also there is a remove logic, it seems safe to use a synchronized.

publicvoiddeleteRegion(finalRegionInforegionInfo) {
synchronized (regionsMapLock) {
RegionStateNoderemoveNode = regionsMap.remove(regionInfo.getRegionName());
encodedRegionsMap.remove(regionInfo.getEncodedName(), removeNode);
}
// ...
}

thangTang pushed a commit to thangTang/hbase that referenced this pull request Apr 16, 2020
apache#1193)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
thangTang pushed a commit to thangTang/hbase that referenced this pull request Apr 16, 2020
apache#1193)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Feb 21, 2023
apache#1193)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Feb 27, 2023
apache#1193)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
ndimiduk pushed a commit that referenced this pull request Mar 1, 2023
#1193)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Mar 1, 2023
apache#1193)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
ndimiduk pushed a commit that referenced this pull request Mar 3, 2023
#1193)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
Signed-off-by: Viraj Jasani <vjasani@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.

5 participants

@mwkang@Apache-HBase@wchevreuil@saintstack@virajjasani