Skip to content

HBASE-23355 Bypass the prefetch operation if HFiles are generated through flush or compaction - #909

Closed
chenxu14 wants to merge 1 commit into
apache:masterfrom
chenxu14:HBASE-23355
Closed

HBASE-23355 Bypass the prefetch operation if HFiles are generated through flush or compaction#909
chenxu14 wants to merge 1 commit into
apache:masterfrom
chenxu14:HBASE-23355

Conversation

@chenxu14

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 8sDocker 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.
+1 💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall5m 29smaster passed
+1 💚compile0m 58smaster passed
+1 💚checkstyle1m 21smaster passed
+1 💚shadedjars4m 37sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 45smaster passed
+0 🆗spotbugs4m 12sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs4m 11smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 57sthe patch passed
+1 💚compile0m 55sthe patch passed
+1 💚javac0m 55sthe patch passed
+1 💚checkstyle1m 19sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚shadedjars4m 36spatch has no errors when building our shaded downstream artifacts.
+1 💚hadoopcheck15m 50sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 💚javadoc0m 35sthe patch passed
+1 💚findbugs4m 16sthe patch passed
_ Other Tests _
-1 ❌unit269m 40shbase-server in the patch failed.
+1 💚asflicense0m 33sThe patch does not generate ASF License warnings.
327m 37s
ReasonTests
Failed junit testshadoop.hbase.client.TestAdmin2
SubsystemReport/Notes
DockerClient=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-909/1/artifact/out/Dockerfile
GITHUB PR#909
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 5c8623d7c56a 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-909/out/precommit/personality/provided.sh
git revisionmaster / 9c82a65
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-909/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-909/1/testReport/
Max. process+thread count5040 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-909/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.


private RegionCoprocessorHost coprocessorHost;

private boolean prefetchOnOpen = false;

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.

The trick is here. By default it will be false and only for region open and the bulk load you will make it true. Good. LGTM.

private final boolean prefetchOnOpen;

public ReaderContext(Path filePath, FSDataInputStreamWrapper fsdis, long fileSize,
HFileSystem hfs, boolean primaryReplicaReader, ReaderType type) {

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.

Just because the PreadREader uses the Context you are adding it here and StorefileInfo?

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.

Yes, use it to determin whether the prefetch operation is needed.
Thanks for your review @ramkrish86

@saintstack

Copy link
Copy Markdown
Contributor

Patch looks good. Where is the new addition being exploited though? I don't see it in here. Also, while we have tests to prove the new addtions work, what about the original supposition by Anoop -- double cache. Are we NOT double caching after this fix?

Thanks.

@chenxu14

Copy link
Copy Markdown
ContributorAuthor

Where is the new addition being exploited though? 

We declared a prefetchOnOpen variable in ReaderContext, it’s default value is false (means Prefetch is not performed by default), But when region opens(code in HStore#openStoreFiles) or bulkload happend, we will modify the prefetchOnOpen value according to CacheConf#shouldPrefetchOnOpen()

what about the original supposition by Anoop -- double cache. Are we NOT double caching after this fix?

The double cache what I understand is that we may cache the same block twice through cacheOnWrite and prefetchOnFlush(Pardon the name) or prefetchOnCompaction,
So here we ignore the flush and compaction case when do prefect.

@ramkrish86

Copy link
Copy Markdown
Contributor

As I said in the other JIRA, already double cache was not happening at the code level - means an already cached block is never cached by the HFileReaderImpl#readBlock() call. But this patch by design will avoid the caching to happen during compaction and flushes.

@saintstack

Copy link
Copy Markdown
Contributor

How to progress here? We do prefetch on open but not anywhere else which seems good. You like this patch @ramkrish86 ?

@anoopsjohn

Copy link
Copy Markdown
Contributor

So after this patch if prefetch config is ON, that will be honored at region open time alone. And also for bulk loaded files. correct? Say the cache on write (flush) and cache on compaction are turned off, we will NOT do eager caching at all? Sorry its been some time since I see this so totally forgot.

@anoopsjohn

Copy link
Copy Markdown
Contributor

another thing. Not related to this item directly. when we open a replica region, that will also open the HFiles there and will do the prefetch. Should we not do? Anyways another topic of discuss and so another jira. cc @saintstack

@chenxu14

Copy link
Copy Markdown
ContributorAuthor

So after this patch if prefetch config is ON, that will be honored at region open time alone. And also for bulk loaded files. correct?

yes, that is

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 35sDocker 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.
+1 💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall8m 19smaster passed
+1 💚compile1m 27smaster passed
+1 💚checkstyle1m 27smaster passed
+1 💚shadedjars5m 11sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 37smaster passed
+0 🆗spotbugs4m 39sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs4m 38smaster passed
_ Patch Compile Tests _
+1 💚mvninstall5m 26sthe patch passed
+1 💚compile1m 0sthe patch passed
+1 💚javac1m 0sthe patch passed
+1 💚checkstyle1m 14sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚shadedjars5m 4spatch has no errors when building our shaded downstream artifacts.
+1 💚hadoopcheck17m 24sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 💚javadoc0m 36sthe patch passed
+1 💚findbugs4m 46sthe patch passed
_ Other Tests _
+1 💚unit98m 46shbase-server in the patch passed.
+1 💚asflicense0m 29sThe patch does not generate ASF License warnings.
163m 48s
SubsystemReport/Notes
DockerClient=19.03.4 Server=19.03.4 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-909/1/artifact/out/Dockerfile
GITHUB PR#909
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux bca9b2143a46 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-909/out/precommit/personality/provided.sh
git revisionmaster / 5b4545d
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-909/1/testReport/
Max. process+thread count6576 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-909/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.

@ndimiduk

Copy link
Copy Markdown
Member

This one seems good for block cache efficiency. Can we get a refresh on the patch, and maybe a PR for branch-2? Reviewers are happy?

@saintstack

Copy link
Copy Markdown
Contributor

Any update @chenxu14 This patch is almost there (I closed others of yours just now that have not had updates... can reopen if you around).

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.

6 participants

@chenxu14@Apache-HBase@saintstack@ramkrish86@anoopsjohn@ndimiduk