Uh oh!
There was an error while loading. Please reload this page.
HBASE-27752: Update the block cache and list of prefetched files upon region movement - #5194
Conversation
Apache-HBase
commented
Apr 20, 2023
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 20, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 20, 2023
💔 -1 overall
This message was automatically generated. |
wchevreuil
left a comment
There was a problem hiding this comment.
Looks like this change has impacted TestPrefetchRSClose.testPrefetchPersistence?
| rsServices.getBlockCache().ifPresent(blockCache -> { | ||
| if (blockCache instanceof CombinedBlockCache) { | ||
| BlockCache l2 = ((CombinedBlockCache)blockCache).getSecondLevelCache(); | ||
| if (l2 instanceof BucketCache) { | ||
| if (region.getReadOnlyConfiguration().get(PREFETCH_PERSISTENCE_PATH_KEY) != null) { | ||
| LOG.info("Closing region {} during a graceful stop, and prefetch persistence is on, " | ||
| + "so setting evict on close to false. ", region.getRegionInfo().getEncodedName()); | ||
| region.getStores().forEach(s -> s.getCacheConfig().setEvictOnClose(false)); | ||
| } | ||
| } | ||
| } | ||
| }); | ||
There was a problem hiding this comment.
I know I've done something similar in UnassignRegionHandler for HBASE-27474, but I wonder now if we should move these logic about evict decision to a related methods in HRegion.
Apache-HBase
commented
Apr 26, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 27, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 27, 2023
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 27, 2023
💔 -1 overall
This message was automatically generated. |
| return close(abort, false, false); | ||
| } | ||
| public Map<byte[], List<HStoreFile>> close(boolean abort, boolean isGracefulStop) |
There was a problem hiding this comment.
I think there's some confusion with the parameters here. We should keep the original signature public Map<byte[], List<HStoreFile>> close(boolean abort, boolean ignoreStatus) and pass ignoreStatus along in the delegating call (here we are always forcing it to false). Could it be behind the latest UT failureS?
There was a problem hiding this comment.
@wchevreuil I have addressed this feedback. However, the previous UTs are probably not failing with this change here. Let's wait for the pre-commit to see how it goes this time.
Apache-HBase
commented
Apr 28, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 28, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 28, 2023
🎊 +1 overall
This message was automatically generated. |
| return close(abort, false); | ||
| } | ||
| public Map<byte[], List<HStoreFile>> close(boolean abort, boolean ignoreStatus) |
| */ | ||
| public Map<byte[], List<HStoreFile>> close(boolean abort, boolean ignoreStatus) | ||
| throws IOException { | ||
| public Map<byte[], List<HStoreFile>> close(boolean abort, boolean ignoreStatus, |
There was a problem hiding this comment.
Nit: update javadoc with the additional param.
Apache-HBase
commented
May 2, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 2, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 2, 2023
🎊 +1 overall
This message was automatically generated. |
| LOG.debug("Prefetch cancelled for {}", path); | ||
| } | ||
| prefetchCompleted.remove(path.getName()); | ||
| LOG.debug("Removing filename from the prefetched persistence list: " + path.getName()); |
There was a problem hiding this comment.
Nit: use parameterised log4j messaging.
Apache-HBase
commented
May 3, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2023
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
May 4, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 4, 2023
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 4, 2023
🎊 +1 overall
This message was automatically generated. |
Kota-SH
commented
May 4, 2023
Thank you, @wchevreuil |
…apache#5194) Co-authored-by: Shanmukha Kota <skota@cloudera.com> (cherry picked from commit ece8d01)
…apache#5194) Co-authored-by: Shanmukha Kota <skota@cloudera.com> (cherry picked from commit ece8d01)
…#5194) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
…ion movement (apache#5194) (apache#5222) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> (cherry picked from commit ece8d01) Change-Id: Ia5e78112b49c576e094c9479001e4de9abb006fe
The prefetch persistence feature requires setting evict on close to false to avoid evictions during a graceful restart. This however causes problems for normal moves (such as those triggered by balancer or manual movement), as now the blocks for moved regions would stay in the cache indefinitely.
Blocks in BucketCache should not be evicted when cache/prefetch persistence is enabled and should be evicted when a region is closed due to other reasons.
Jira: https://issues.apache.org/jira/browse/HBASE-27752