Skip to content

HBASE-22463 Some paths in HFileScannerImpl did not consider block#release which will exhaust the ByteBuffAllocator - #257

Merged
openinx merged 1 commit into
apache:HBASE-21879from
openinx:HBASE-21879
May 30, 2019
Merged

HBASE-22463 Some paths in HFileScannerImpl did not consider block#release which will exhaust the ByteBuffAllocator#257
openinx merged 1 commit into
apache:HBASE-21879from
openinx:HBASE-21879

Conversation

@openinx

Copy link
Copy Markdown
Member

No description provided.

@openinxopeninx changed the title Some paths in HFileScannerImpl did not consider block#release which will exhaust the ByteBuffAllocatorHBASE-22463 Some paths in HFileScannerImpl did not consider block#release which will exhaust the ByteBuffAllocatorMay 28, 2019
@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec55Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 8 new or modified test files.
_ HBASE-21879 Compile Tests _
0mvndep25Maven dependency ordering for branch
+1mvninstall269HBASE-21879 passed
+1compile75HBASE-21879 passed
+1checkstyle85HBASE-21879 passed
+1shadedjars281branch has no errors when building our shaded downstream artifacts.
-1findbugs216hbase-server in HBASE-21879 has 11 extant Findbugs warnings.
+1javadoc50HBASE-21879 passed
_ Patch Compile Tests _
0mvndep15Maven dependency ordering for patch
+1mvninstall261the patch passed
+1compile78the patch passed
+1javac78the patch passed
-1checkstyle78hbase-server: The patch generated 1 new + 86 unchanged - 3 fixed = 87 total (was 89)
+1whitespace0The patch has no whitespace issues.
+1shadedjars295patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck701Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1findbugs274the patch passed
+1javadoc58the patch passed
_ Other Tests _
-1unit21086hbase-server in the patch failed.
+1unit60hbase-external-blockcache in the patch passed.
+1asflicense71The patch does not generate ASF License warnings.
24174
ReasonTests
Failed junit testshadoop.hbase.client.TestCloneSnapshotFromClientNormal
hadoop.hbase.master.TestMasterMetricsWrapper
hadoop.hbase.client.TestSnapshotTemporaryDirectoryWithRegionReplicas
hadoop.hbase.replication.TestReplicationKillSlaveRS
hadoop.hbase.replication.TestReplicationKillSlaveRSWithSeparateOldWALs
hadoop.hbase.client.TestFromClientSide3
hadoop.hbase.client.TestAdmin2
hadoop.hbase.master.procedure.TestTruncateTableProcedure
hadoop.hbase.tool.TestLoadIncrementalHFiles
hadoop.hbase.master.TestAssignmentManagerMetrics
hadoop.hbase.client.replication.TestReplicationAdminWithClusters
hadoop.hbase.master.procedure.TestProcedurePriority
hadoop.hbase.namespace.TestNamespaceAuditor
hadoop.hbase.replication.TestReplicationDisableInactivePeer
hadoop.hbase.client.TestAsyncTableAdminApi
hadoop.hbase.master.procedure.TestSCPWithReplicasWithoutZKCoordinated
hadoop.hbase.replication.TestReplicationSmallTestsSync
hadoop.hbase.client.TestFromClientSide
hadoop.hbase.master.procedure.TestSCPWithoutZKCoordinated
hadoop.hbase.replication.TestReplicationStatus
hadoop.hbase.client.TestFromClientSideWithCoprocessor
hadoop.hbase.client.TestSnapshotDFSTemporaryDirectory
hadoop.hbase.tool.TestSecureLoadIncrementalHFiles
hadoop.hbase.client.replication.TestReplicationAdmin
hadoop.hbase.replication.TestReplicationSmallTests
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/1/artifact/out/Dockerfile
GITHUB PR#257
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 0c865cb1fff9 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 revisionHBASE-21879 / b673000
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
findbugshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/1/artifact/out/branch-findbugs-hbase-server-warnings.html
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/1/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/1/testReport/
Max. process+thread count5126 (vs. ulimit of 10000)
modulesC: hbase-server hbase-external-blockcache U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/1/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

…ease which will exhaust the ByteBuffAllocator
@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec152Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 8 new or modified test files.
_ HBASE-21879 Compile Tests _
0mvndep25Maven dependency ordering for branch
+1mvninstall268HBASE-21879 passed
+1compile73HBASE-21879 passed
+1checkstyle87HBASE-21879 passed
+1shadedjars278branch has no errors when building our shaded downstream artifacts.
-1findbugs181hbase-server in HBASE-21879 has 11 extant Findbugs warnings.
+1javadoc45HBASE-21879 passed
_ Patch Compile Tests _
0mvndep13Maven dependency ordering for patch
+1mvninstall254the patch passed
+1compile74the patch passed
+1javac74the patch passed
+1checkstyle78hbase-server: The patch generated 0 new + 86 unchanged - 3 fixed = 86 total (was 89)
+1checkstyle9The patch passed checkstyle in hbase-external-blockcache
+1whitespace0The patch has no whitespace issues.
+1shadedjars273patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck517Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1findbugs219the patch passed
+1javadoc44the patch passed
_ Other Tests _
+1unit7887hbase-server in the patch passed.
+1unit40hbase-external-blockcache in the patch passed.
+1asflicense51The patch does not generate ASF License warnings.
10702
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/2/artifact/out/Dockerfile
GITHUB PR#257
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux dbe3f6b9dea3 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 revisionHBASE-21879 / b673000
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
findbugshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/2/artifact/out/branch-findbugs-hbase-server-warnings.html
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/2/testReport/
Max. process+thread count4956 (vs. ulimit of 10000)
modulesC: hbase-server hbase-external-blockcache U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-257/2/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

return;
}
// We don't have to keep ref to EXCLUSIVE type of block
if (this.curBlock != null && this.curBlock.usesSharedMemory()) {

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.

There is a concern here. Even if the block is on an exclusive heap memory area, we will keep ref to that in this list. In a Phoenix Aggregation kind of use case where many blocks might get fetched and not immediately shipped, we are keeping the ref unwantedly here for longer time. This makes the GC not able to reclaim the heap memory area for the blocks. This might be a hidden bomb IMO. Its not good to remove the MemType. Lets create the block with memory type as EXCLUSIVE when the block data is on heap. The block might be coming from LRU cache or by fetching the block data from HDFS into heap memory area. When the block comes from off heap BC or if it is backed by a BB from the pool (While reading from HDFS, read into pooled BB) lets create the block with mem type as SHARED. Every block can have the retain and release method but let the EXCLUSIVE types do a noop here.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

FIled an separate issue for this: https://issues.apache.org/jira/browse/HBASE-21879. Let finish that in an new one because I believe it's will be many changes , also can helop to make this PR forward.

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 already as part of this JIRA you removed the MEMTYPE and so even the bucket cache engines like FileIOEngine will remove the memtype and so all the blocks will go through the release() way by adding to prevBlocks and then getting released. The new PR #268 will remove the need for addition to prevBlocks as it is a noop. So now both bucket cache and read from HDFS both will create onheap/offheap blocks and the type of block will determine what it is .

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

High level one comment is added. Did not check the remaining part of the patch

// The first key in the current block 'seekToBlock' is greater than the given
// seekBefore key. We will go ahead by reading the next block that satisfies the
// given key. Return the current block before reading the next one.
seekToBlock.release();

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.

This fix is there as part of some other issue fix right?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yeah, similar to the issue: https://issues.apache.org/jira/browse/HBASE-22480. Discussed with binlijin before, his patch can apply to branch-2.x and need not to apply to master branch, once the HBASE-21879 get merged into master, then this bug will be fixed in this patch.

// Promote this to L1.
if (result != null) {
if (caching) {
if (result instanceof HFileBlock && ((HFileBlock) result).usesSharedMemory()) {

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.

As part of the new issue, we have to handle here also.. Because when it is shared memory, we can not keep the block as is in LRU cache.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Here, the following cacheBlock in LruBlockCache, we have a asReferencedHeapBlock method which will deepClone the shared memory into a heap one and cache the heap one. so there we no need to do extra check & deepClone now, it's safe to remove this.

https://github.com/apache/hbase/pull/257/files/800726459ced6d868abcfd871aa75f0e60c6d275#diff-e300bc9c680e6ccde942561c4c0b5a3dR528

@anoopsjohnanoopsjohn 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. Lets address the comment as part of already raised issue. Just asked another Q. Seems the fix as part of another issue is also here in this. Any way u will merge. Fine.

@openinx
openinx merged commit 68c5129 into apache:HBASE-21879May 30, 2019
asfgit pushed a commit that referenced this pull request May 31, 2019
asfgit pushed a commit that referenced this pull request Jun 18, 2019
asfgit pushed a commit that referenced this pull request Jun 24, 2019
openinx added a commit to openinx/hbase that referenced this pull request Jun 25, 2019
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

@openinx@Apache-HBase@ramkrish86@anoopsjohn