Uh oh!
There was an error while loading. Please reload this page.
HBASE-23355 Bypass the prefetch operation if HFiles are generated through flush or compaction - #909
HBASE-23355 Bypass the prefetch operation if HFiles are generated through flush or compaction#909chenxu14 wants to merge 1 commit into
Conversation
through flush or compaction
Apache-HBase
commented
Dec 6, 2019
💔 -1 overall
This message was automatically generated. |
| private RegionCoprocessorHost coprocessorHost; | ||
| private boolean prefetchOnOpen = false; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Just because the PreadREader uses the Context you are adding it here and StorefileInfo?
There was a problem hiding this comment.
Yes, use it to determin whether the prefetch operation is needed.
Thanks for your review @ramkrish86
saintstack
commented
Dec 13, 2019
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
commented
Dec 14, 2019
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()
The double cache what I understand is that we may cache the same block twice through cacheOnWrite and prefetchOnFlush(Pardon the name) or prefetchOnCompaction, |
ramkrish86
commented
Dec 16, 2019
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
commented
Jan 2, 2020
How to progress here? We do prefetch on open but not anywhere else which seems good. You like this patch @ramkrish86 ? |
anoopsjohn
commented
Jan 4, 2020
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
commented
Jan 4, 2020
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
commented
Jan 6, 2020
yes, that is |
Apache-HBase
commented
Feb 6, 2020
🎊 +1 overall
This message was automatically generated. |
ndimiduk
commented
Sep 25, 2020
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
commented
Mar 15, 2021
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). |
No description provided.