[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r670188869 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +boolean existInL1 = lruCache.containsBlock(cacheKey); +if (!existInL1 && updateCacheMetrics) { Review comment: Yes, we should care about the repeat situation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r670186736 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +boolean existInL1 = lruCache.containsBlock(cacheKey); +if (!existInL1 && updateCacheMetrics) { Review comment: If existInL1 is false, we will not check LRU cache here so that the miss will not be double counted. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r670171545 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +boolean existInL1 = lruCache.containsBlock(cacheKey); +if (!existInL1 && updateCacheMetrics) { + // If the block does not exist in L1, this check should be counted as a miss. + combinedCacheStats.lruCacheStats +.miss(caching, cacheKey.isPrimary(), cacheKey.getBlockType()); +} +return existInL1? Review comment: rectified in the last commit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r670057960 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +boolean existInL1 = lruCache.containsBlock(cacheKey); +if (!existInL1 && updateCacheMetrics) { + // If the block does not exist in L1, this check should be counted as a miss. + combinedCacheStats.lruCacheStats +.miss(caching, cacheKey.isPrimary(), cacheKey.getBlockType()); +} +return existInL1? Review comment: The former line is without space, should I add one here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r670057960 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +boolean existInL1 = lruCache.containsBlock(cacheKey); +if (!existInL1 && updateCacheMetrics) { + // If the block does not exist in L1, this check should be counted as a miss. + combinedCacheStats.lruCacheStats +.miss(caching, cacheKey.isPrimary(), cacheKey.getBlockType()); +} +return existInL1? Review comment: The former line is without space, should I add one here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r669275641 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +boolean existInL1 = lruCache.containsBlock(cacheKey); +if (!existInL1 && updateCacheMetrics) { + // If the block does not exist in L1, this check should be counted as a miss. + combinedCacheStats.lruCacheStats +.miss(false, cacheKey.isPrimary(), cacheKey.getBlockType()); Review comment: Fixed in the last commit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r669257177 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,7 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +return cacheKey.getBlockType().getCategory() == BlockCategory.DATA? Review comment: As in branch-1 it is also possible that data blocks are cached in L1, so that it is not a good way to check L1 or L2 according to the block type. I have update the logic in the last commit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [hbase] YutSean commented on a change in pull request #3474: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache
YutSean commented on a change in pull request #3474: URL: https://github.com/apache/hbase/pull/3474#discussion_r668398494 ## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java ## @@ -79,7 +79,7 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) { // TODO: is there a hole here, or just awkwardness since in the lruCache getBlock // we end up calling l2Cache.getBlock. -return lruCache.containsBlock(cacheKey)? +return cacheKey.getBlockType().getCategory() == BlockCategory.DATA? Review comment: You are right. Have fixed in the last commit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org