Skip to content

Conversation

@apurtell
Copy link
Contributor

@apurtell apurtell commented May 23, 2019

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

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 57 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 3 new or modified test files.
_ master Compile Tests _
0 mvndep 31 Maven dependency ordering for branch
+1 mvninstall 256 master passed
+1 compile 198 master passed
+1 checkstyle 165 master passed
+1 shadedjars 279 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 588 master passed
+1 javadoc 133 master passed
_ Patch Compile Tests _
0 mvndep 14 Maven dependency ordering for patch
+1 mvninstall 251 the patch passed
+1 compile 207 the patch passed
+1 cc 207 the patch passed
+1 javac 207 the patch passed
-1 checkstyle 74 hbase-server: The patch generated 1 new + 47 unchanged - 0 fixed = 48 total (was 47)
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 278 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 1053 Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.0.3 3.1.2.
+1 hbaseprotoc 191 the patch passed
+1 findbugs 601 the patch passed
+1 javadoc 125 the patch passed
_ Other Tests _
+1 unit 36 hbase-protocol-shaded in the patch passed.
+1 unit 29 hbase-hadoop-compat in the patch passed.
+1 unit 32 hbase-hadoop2-compat in the patch passed.
+1 unit 24 hbase-protocol in the patch passed.
+1 unit 193 hbase-client in the patch passed.
+1 unit 7747 hbase-server in the patch passed.
-1 unit 321 hbase-rest in the patch failed.
+1 asflicense 168 The patch does not generate ASF License warnings.
15361
Reason Tests
Failed junit tests hadoop.hbase.rest.model.TestStorageClusterStatusModel
hadoop.hbase.rest.TestSecureRESTServer
Subsystem Report/Notes
Docker Client=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 Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc
uname Linux 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 tool maven
Personality /testptch/patchprocess/precommit/personality/provided.sh
git revision master / 8e47c8e
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/artifact/out/diff-checkstyle-hbase-server.txt
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/artifact/out/patch-unit-hbase-rest.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/testReport/
Max. process+thread count 4887 (vs. ulimit of 10000)
modules C: hbase-protocol-shaded hbase-hadoop-compat hbase-hadoop2-compat hbase-protocol hbase-client hbase-server hbase-rest U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/1/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Override
public int getStoreRefCount() {
return this.storeEngine.getStoreFileManager().getStorefiles().stream()
.filter(sf -> { return sf.getReader() != null; })
Copy link
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
Contributor Author

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

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

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

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

@apurtell apurtell requested a review from Apache9 May 23, 2019 19:10
@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 52 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 2 new or modified test files.
_ master Compile Tests _
0 mvndep 23 Maven dependency ordering for branch
+1 mvninstall 242 master passed
+1 compile 168 master passed
+1 checkstyle 142 master passed
+1 shadedjars 266 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 524 master passed
+1 javadoc 110 master passed
_ Patch Compile Tests _
0 mvndep 15 Maven dependency ordering for patch
+1 mvninstall 236 the patch passed
+1 compile 169 the patch passed
+1 cc 169 the patch passed
+1 javac 169 the patch passed
+1 checkstyle 142 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 269 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 986 Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.0.3 3.1.2.
+1 hbaseprotoc 167 the patch passed
+1 findbugs 548 the patch passed
+1 javadoc 113 the patch passed
_ Other Tests _
+1 unit 37 hbase-protocol-shaded in the patch passed.
+1 unit 30 hbase-hadoop-compat in the patch passed.
+1 unit 36 hbase-hadoop2-compat in the patch passed.
+1 unit 24 hbase-protocol in the patch passed.
+1 unit 199 hbase-client in the patch passed.
-1 unit 14225 hbase-server in the patch failed.
+1 asflicense 177 The patch does not generate ASF License warnings.
22841
Reason Tests
Failed junit tests hadoop.hbase.replication.TestMasterReplication
Subsystem Report/Notes
Docker Client=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 Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc
uname Linux 9b4edc2e79a8 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build tool maven
Personality /testptch/patchprocess/precommit/personality/provided.sh
git revision master / 6b899cc
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/3/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/3/testReport/
Max. process+thread count 5024 (vs. ulimit of 10000)
modules C: hbase-protocol-shaded hbase-hadoop-compat hbase-hadoop2-compat hbase-protocol hbase-client hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/3/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

/**
* @return Reference count over store
*/
int getStoreRefCount();
Copy link
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
Contributor

Other than Duo's comment , LGTM. +1

@apurtell
Copy link
Contributor Author

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

@apurtell
Copy link
Contributor Author

TestMasterReplication issue does not seem related, but will check

@apurtell
Copy link
Contributor Author

Updated patch removes changes to Store.

@apurtell
Copy link
Contributor Author

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

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 49 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 2 new or modified test files.
_ master Compile Tests _
0 mvndep 30 Maven dependency ordering for branch
+1 mvninstall 265 master passed
+1 compile 173 master passed
+1 checkstyle 146 master passed
+1 shadedjars 267 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 544 master passed
+1 javadoc 121 master passed
_ Patch Compile Tests _
0 mvndep 16 Maven dependency ordering for patch
+1 mvninstall 242 the patch passed
+1 compile 174 the patch passed
+1 cc 174 the patch passed
+1 javac 174 the patch passed
+1 checkstyle 147 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 266 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 1004 Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.0.3 3.1.2.
+1 hbaseprotoc 166 the patch passed
+1 findbugs 582 the patch passed
+1 javadoc 111 the patch passed
_ Other Tests _
+1 unit 36 hbase-protocol-shaded in the patch passed.
+1 unit 31 hbase-hadoop-compat in the patch passed.
+1 unit 36 hbase-hadoop2-compat in the patch passed.
+1 unit 24 hbase-protocol in the patch passed.
+1 unit 202 hbase-client in the patch passed.
-1 unit 15757 hbase-server in the patch failed.
+1 asflicense 154 The patch does not generate ASF License warnings.
20961
Reason Tests
Failed junit tests hadoop.hbase.client.TestFromClientSide
hadoop.hbase.quotas.TestQuotaAdmin
Subsystem Report/Notes
Docker Client=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 Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc
uname Linux f9c6cd2242b4 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build tool maven
Personality /testptch/patchprocess/precommit/personality/provided.sh
git revision master / ca00cbe
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/4/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/4/testReport/
Max. process+thread count 4950 (vs. ulimit of 10000)
modules C: hbase-protocol-shaded hbase-hadoop-compat hbase-hadoop2-compat hbase-protocol hbase-client hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-248/4/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@xcangCRM
Copy link
Contributor

+1

@apurtell
Copy link
Contributor Author

Thank you @Apache9 and @xcangCRM for the reviews!

@apurtell apurtell merged commit 98a1552 into apache:master May 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 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.

4 participants