jhungund commented on code in PR #5856:
URL: https://github.com/apache/hbase/pull/5856#discussion_r1583300564


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDataTieringManager.java:
##########
@@ -263,47 +264,56 @@ public void testPickColdDataFiles() {
   @Test
   public void testBlockEvictions() throws Exception {
     long capacitySize = 40 * 1024;
-    int writeThreads = 3;
-    int writerQLen = 64;
+    int writeThreads = 1;
+    int writerQLen = 4;
     int[] bucketSizes = new int[] { 8 * 1024 + 1024 };
 
-    // Setup: Create a bucket cache with lower capacity
-    BucketCache bucketCache = new BucketCache("file:" + testDir + 
"/bucket.cache", capacitySize,
-      8192, bucketSizes, writeThreads, writerQLen, testDir + 
"/bucket.persistence",
-      DEFAULT_ERROR_TOLERATION_DURATION, defaultConf);
-
-    // Create three Cache keys with cold data files and a block with hot data.
-    // hStoreFiles.get(3) is a cold data file, while hStoreFiles.get(0) is a 
hot file.
-    Set<BlockCacheKey> cacheKeys = new HashSet<>();
-    cacheKeys.add(new BlockCacheKey(hStoreFiles.get(3).getPath(), 0, true, 
BlockType.DATA));
-    cacheKeys.add(new BlockCacheKey(hStoreFiles.get(3).getPath(), 8192, true, 
BlockType.DATA));
-    cacheKeys.add(new BlockCacheKey(hStoreFiles.get(0).getPath(), 0, true, 
BlockType.DATA));
-
-    // Create dummy data to be cached and fill the cache completely.
-    CacheTestUtils.HFileBlockPair[] blocks = 
CacheTestUtils.generateHFileBlocks(8192, 3);
-
-    int blocksIter = 0;
-    for (BlockCacheKey key : cacheKeys) {
-      bucketCache.cacheBlock(key, blocks[blocksIter++].getBlock());
-      // Ensure that the block is persisted to the file.
-      Waiter.waitFor(defaultConf, 10000, 100, () -> 
(bucketCache.getBackingMap().containsKey(key)));
-    }
+    // disable any prefetch in parallel to test execution
+    defaultConf.setBoolean(CacheConfig.PREFETCH_BLOCKS_ON_OPEN_KEY, false);

Review Comment:
   There have been intermittent failures in these tests where the block counts 
different than expected at different points. I did observe the prefetch kicking 
in during those failures. Hence, I tried to fix these failures. But I realise, 
it is better to keep these test fixes different from this original change. I 
will remove these changes in the new patch set.



-- 
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

Reply via email to