Skip to content

HBASE-23066 Allow cache on write during compactions when prefetching … - #707

Closed
jacob-leblanc wants to merge 1 commit into
apache:masterfrom
jacob-leblanc:HBASE-23066
Closed

HBASE-23066 Allow cache on write during compactions when prefetching …#707
jacob-leblanc wants to merge 1 commit into
apache:masterfrom
jacob-leblanc:HBASE-23066

Conversation

@jacob-leblanc

Copy link
Copy Markdown
Contributor

…is enabled

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec0m 37sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💚mvninstall5m 35smaster passed
💚compile0m 56smaster passed
💚checkstyle1m 20smaster passed
💚shadedjars4m 34sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 38smaster passed
💙spotbugs4m 3sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs4m 0smaster passed
_ Patch Compile Tests _
💚mvninstall4m 49sthe patch passed
💚compile0m 56sthe patch passed
💚javac0m 56sthe patch passed
💚checkstyle1m 20sthe patch passed
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 34spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 48sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 36sthe patch passed
💚findbugs4m 3sthe patch passed
_ Other Tests _
💚unit159m 57shbase-server in the patch passed.
💚asflicense0m 35sThe patch does not generate ASF License warnings.
216m 42s
SubsystemReport/Notes
DockerClient=19.03.3 Server=19.03.3 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-707/1/artifact/out/Dockerfile
GITHUB PR#707
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux fb96839beab8 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-707/out/precommit/personality/provided.sh
git revisionmaster / ba12d5b
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-707/1/testReport/
Max. process+thread count5023 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-707/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@ramkrish86

Copy link
Copy Markdown
Contributor

LGTM. Let's wait for some time for others to review.

* Configuration key to cache blocks when a compacted file is written, predicated on prefetching
* being enabled for the column family.
*/
public static final String PREFETCH_COMPACTED_BLOCKS_ON_WRITE_KEY =

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.

A bit confusing.. Are we doing the prefetch of the new compacted file once it is written?
Dont think so.. When we write the file, that time itself the caching happens. So it is cache on write. Why its called prefetch then? There is no extra fetch op happening right?

* @return true if blocks should be cached while writing during compaction, false if not
*/
public boolean shouldCacheCompactedBlocksOnWrite() {
return this.prefetchCompactedDataOnWrite && this.prefetchOnOpen;

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.

Oh.. So the cache on write (at compaction) happens iff prefetch config is ON ! Anyways in ur case the prefetch which is another config, is ON right? I think this is the reason why the new config you have named that way. But some how I feel that config name is bit misleading.

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.

Actually the cache size should be much bigger than the hot data set size if u want to do cache on compact. Because the compacted away data might be already in cache (Those are flused files or a result of another compaction). Those are recently been accessed also (by the compaction thread). This feature should be very carefully used.

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.

Thanks for looking at this. My understanding is that in cases where prefetch is enabled, the new file is going to be read into the cache after compaction completes anyway. So the cache size requirements are the same when this new setting is enabled. This is why I wanted to limit the scope of the cache on write to only apply where prefetching is enabled: it simply is a way to do the cache loading more efficiently while we are writing the data out rather than having to read it back after compaction is done which I've found is very expensive when data is in S3.

As far as the name goes, I struggled to come up with something intuitive - how do I explain in the name alone that this only applies when prefetching is on? I tried to convey "when prefetching, do the prefetch of compacted data on write." I'm not in love with the name and I'm open to suggestions. I didn't want to give the false impression that all compacted data is going to be cached on write. Maybe "cacheCompactedDataOnWriteIfPrefetching"? Is that too wordy?

@busbey

Copy link
Copy Markdown
Contributor

is this made obsolete by #919?

@virajjasani

Copy link
Copy Markdown
Contributor

is this made obsolete by #919?

I believe so. Closing this PR @jacob-leblanc@ramkrish86

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

@jacob-leblanc@Apache-HBase@ramkrish86@busbey@virajjasani@anoopsjohn