Skip to content

HBASE-22459 Expose store reader reference count - #248

Merged
apurtell merged 1 commit into
apache:masterfrom
apurtell:HBASE-22459
May 30, 2019
Merged

HBASE-22459 Expose store reader reference count#248
apurtell merged 1 commit into
apache:masterfrom
apurtell:HBASE-22459

Conversation

@apurtell

@apurtellapurtell commented May 23, 2019

Copy link
Copy Markdown
Contributor

Expose the reference count over a region's store file readers as a metric in region metrics and also as a new field in RegionLoad. This will make visible the reader reference count over all stores in the region to both metrics capture and anything that consumes ClusterStatus, like the shell's status command and the master UI.

Coprocessors that wrap scanners might leak them, which will leak readers. We log when this happens but in order to notice the increasing trend of reference counts you have to scrape log output. It would be better if this information is also available as a metric.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec57Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 3 new or modified test files.
_ master Compile Tests _
0mvndep31Maven dependency ordering for branch
+1mvninstall256master passed
+1compile198master passed
+1checkstyle165master passed
+1shadedjars279branch has no errors when building our shaded downstream artifacts.
+1findbugs588master passed
+1javadoc133master passed
_ Patch Compile Tests _
0mvndep14Maven dependency ordering for patch
+1mvninstall251the patch passed
+1compile207the patch passed
+1cc207the patch passed
+1javac207the patch passed
-1checkstyle74hbase-server: The patch generated 1 new + 47 unchanged - 0 fixed = 48 total (was 47)
+1whitespace0The patch has no whitespace issues.
+1shadedjars278patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck1053Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.0.3 3.1.2.
+1hbaseprotoc191the patch passed
+1findbugs601the patch passed
+1javadoc125the patch passed
_ Other Tests _
+1unit36hbase-protocol-shaded in the patch passed.
+1unit29hbase-hadoop-compat in the patch passed.
+1unit32hbase-hadoop2-compat in the patch passed.
+1unit24hbase-protocol in the patch passed.
+1unit193hbase-client in the patch passed.
+1unit7747hbase-server in the patch passed.
-1unit321hbase-rest in the patch failed.
+1asflicense168The patch does not generate ASF License warnings.
15361
ReasonTests
Failed junit testshadoop.hbase.rest.model.TestStorageClusterStatusModel
hadoop.hbase.rest.TestSecureRESTServer
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/artifact/out/Dockerfile
GITHUB PR#248
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc
unameLinux eed98d3cfd52 4.4.0-131-generic #157~14.04.1-Ubuntu SMP Fri Jul 13 08:53:17 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 8e47c8e
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/artifact/out/patch-unit-hbase-rest.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/testReport/
Max. process+thread count4887 (vs. ulimit of 10000)
modulesC: hbase-protocol-shaded hbase-hadoop-compat hbase-hadoop2-compat hbase-protocol hbase-client hbase-server hbase-rest U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

Comment threadhbase-protocol-shaded/src/main/protobuf/ClusterStatus.proto
Comment threadhbase-protocol/src/main/protobuf/ClusterStatus.proto
@Override
public int getStoreRefCount() {
return this.storeEngine.getStoreFileManager().getStorefiles().stream()
.filter(sf -> { return sf.getReader() != null; })

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.

sf -> sf.getReader() != null is enough?

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.

Ok. This style is new to me

return this.storeEngine.getStoreFileManager().getStorefiles().stream()
.filter(sf -> { return sf.getReader() != null; })
.filter(HStoreFile::isHFile)
.mapToInt(sf -> sf.getRefCount())

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.

HStoreFile::getRefCount is better?

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.

Ok

/**
* @return Reference count over store
*/
int getStoreRefCount();

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.

So here we also expose this value to CP, not only through metrics?

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 think it would be good to have this in the interface to avoid some casting but is not required probably

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.

If you mean this code sniff
for (Store store : region.stores.values()) {
tempNumStoreFiles += store.getStorefilesCount();
tempStoreRefCount += store.getStoreRefCount();
tempMemstoreSize += store.getMemStoreSize().getDataSize();
tempStoreFileSize += store.getStorefilesSize();
OptionalLong storeMaxStoreFileAge = store.getMaxStoreFileAge();

Actually you can just change the for (Store store : region.stores.values()) { to for (HStore store : region.stores.values()) {, as the region is a HRegion.

@apurtell

Copy link
Copy Markdown
ContributorAuthor

Bah need to fix TestStorageClusterStatusModel and maybe the other one. Back soon

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec52Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 2 new or modified test files.
_ master Compile Tests _
0mvndep23Maven dependency ordering for branch
+1mvninstall242master passed
+1compile168master passed
+1checkstyle142master passed
+1shadedjars266branch has no errors when building our shaded downstream artifacts.
+1findbugs524master passed
+1javadoc110master passed
_ Patch Compile Tests _
0mvndep15Maven dependency ordering for patch
+1mvninstall236the patch passed
+1compile169the patch passed
+1cc169the patch passed
+1javac169the patch passed
+1checkstyle142the patch passed
+1whitespace0The patch has no whitespace issues.
+1shadedjars269patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck986Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.0.3 3.1.2.
+1hbaseprotoc167the patch passed
+1findbugs548the patch passed
+1javadoc113the patch passed
_ Other Tests _
+1unit37hbase-protocol-shaded in the patch passed.
+1unit30hbase-hadoop-compat in the patch passed.
+1unit36hbase-hadoop2-compat in the patch passed.
+1unit24hbase-protocol in the patch passed.
+1unit199hbase-client in the patch passed.
-1unit14225hbase-server in the patch failed.
+1asflicense177The patch does not generate ASF License warnings.
22841
ReasonTests
Failed junit testshadoop.hbase.replication.TestMasterReplication
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/3/artifact/out/Dockerfile
GITHUB PR#248
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc
unameLinux 9b4edc2e79a8 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 6b899cc
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/3/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/3/testReport/
Max. process+thread count5024 (vs. ulimit of 10000)
modulesC: hbase-protocol-shaded hbase-hadoop-compat hbase-hadoop2-compat hbase-protocol hbase-client hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/3/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

/**
* @return Reference count over store
*/
int getStoreRefCount();

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.

If you mean this code sniff
for (Store store : region.stores.values()) {
tempNumStoreFiles += store.getStorefilesCount();
tempStoreRefCount += store.getStoreRefCount();
tempMemstoreSize += store.getMemStoreSize().getDataSize();
tempStoreFileSize += store.getStorefilesSize();
OptionalLong storeMaxStoreFileAge = store.getMaxStoreFileAge();

Actually you can just change the for (Store store : region.stores.values()) { to for (HStore store : region.stores.values()) {, as the region is a HRegion.

@xcangCRM

Copy link
Copy Markdown
Contributor

Other than Duo's comment , LGTM. +1

@apurtell

Copy link
Copy Markdown
ContributorAuthor

No problem, will remove from Store and leave in HStore only. Back soon.

@apurtell

Copy link
Copy Markdown
ContributorAuthor

TestMasterReplication issue does not seem related, but will check

@apurtell

Copy link
Copy Markdown
ContributorAuthor

Updated patch removes changes to Store.

@apurtell

Copy link
Copy Markdown
ContributorAuthor

Last version of patch got a clean precommit run on the JIRA. No reason to think the interface change in the latest patch would affect that.
https://issues.apache.org/jira/browse/HBASE-22459?focusedCommentId=16847138&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16847138

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec49Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 2 new or modified test files.
_ master Compile Tests _
0mvndep30Maven dependency ordering for branch
+1mvninstall265master passed
+1compile173master passed
+1checkstyle146master passed
+1shadedjars267branch has no errors when building our shaded downstream artifacts.
+1findbugs544master passed
+1javadoc121master passed
_ Patch Compile Tests _
0mvndep16Maven dependency ordering for patch
+1mvninstall242the patch passed
+1compile174the patch passed
+1cc174the patch passed
+1javac174the patch passed
+1checkstyle147the patch passed
+1whitespace0The patch has no whitespace issues.
+1shadedjars266patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck1004Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.0.3 3.1.2.
+1hbaseprotoc166the patch passed
+1findbugs582the patch passed
+1javadoc111the patch passed
_ Other Tests _
+1unit36hbase-protocol-shaded in the patch passed.
+1unit31hbase-hadoop-compat in the patch passed.
+1unit36hbase-hadoop2-compat in the patch passed.
+1unit24hbase-protocol in the patch passed.
+1unit202hbase-client in the patch passed.
-1unit15757hbase-server in the patch failed.
+1asflicense154The patch does not generate ASF License warnings.
20961
ReasonTests
Failed junit testshadoop.hbase.client.TestFromClientSide
hadoop.hbase.quotas.TestQuotaAdmin
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/4/artifact/out/Dockerfile
GITHUB PR#248
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc
unameLinux f9c6cd2242b4 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / ca00cbe
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/4/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/4/testReport/
Max. process+thread count4950 (vs. ulimit of 10000)
modulesC: hbase-protocol-shaded hbase-hadoop-compat hbase-hadoop2-compat hbase-protocol hbase-client hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/4/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@xcangCRM

Copy link
Copy Markdown
Contributor

+1

@apurtell

Copy link
Copy Markdown
ContributorAuthor

Thank you @Apache9 and @xcangCRM for the reviews!

@apurtell
apurtell merged commit 98a1552 into apache:masterMay 30, 2019
@apurtell
apurtell deleted the HBASE-22459 branch May 30, 2019 22:04
infraio pushed a commit to infraio/hbase that referenced this pull request Aug 17, 2020
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.

4 participants

@apurtell@Apache-HBase@xcangCRM@Apache9