You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by hu...@apache.org on 2020/03/27 00:21:16 UTC
[hbase] branch branch-2 updated: HBASE-23853 [Flakey Test]
TestBlockEvictionFromClient#testBlockRefCountAfterSplits (#1363) (#1366)
This is an automated email from the ASF dual-hosted git repository.
huaxiangsun pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new 5d5d845 HBASE-23853 [Flakey Test] TestBlockEvictionFromClient#testBlockRefCountAfterSplits (#1363) (#1366)
5d5d845 is described below
commit 5d5d845feac4f7feb03df774b16b89f73e9a497a
Author: huaxiangsun <62...@users.noreply.github.com>
AuthorDate: Thu Mar 26 17:21:01 2020 -0700
HBASE-23853 [Flakey Test] TestBlockEvictionFromClient#testBlockRefCountAfterSplits (#1363) (#1366)
Signed-off-by: Jan Hentschel <ja...@ultratendency.com>
Signed-off-by: Viraj Jasani <vj...@apache.org>
Signed-off-by: <st...@apache.org>
---
.../hbase/client/TestBlockEvictionFromClient.java | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java
index 24596b5..f4f5e36 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionLocation;
+import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
@@ -50,6 +51,7 @@ import org.apache.hadoop.hbase.io.hfile.CacheConfig;
import org.apache.hadoop.hbase.io.hfile.CachedBlock;
import org.apache.hadoop.hbase.io.hfile.CombinedBlockCache;
import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
+import org.apache.hadoop.hbase.regionserver.BloomType;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.HStore;
import org.apache.hadoop.hbase.regionserver.InternalScanner;
@@ -556,8 +558,17 @@ public class TestBlockEvictionFromClient {
@Test
public void testBlockRefCountAfterSplits() throws IOException, InterruptedException {
- final TableName tableName = TableName.valueOf(name.getMethodName());
- try (Table table = TEST_UTIL.createTable(tableName, FAMILIES_1, 1, 1024)) {
+ Table table = null;
+ try {
+ final TableName tableName = TableName.valueOf(name.getMethodName());
+ HTableDescriptor desc = TEST_UTIL.createTableDescriptor(tableName);
+ // This test expects rpc refcount of cached data blocks to be 0 after split. After split,
+ // two daughter regions are opened and a compaction is scheduled to get rid of reference
+ // of the parent region hfiles. Compaction will increase refcount of cached data blocks by 1.
+ // It is flakey since compaction can kick in anytime. To solve this issue, table is created
+ // with compaction disabled.
+ desc.setCompactionEnabled(false);
+ table = TEST_UTIL.createTable(desc, FAMILIES_1, null, BloomType.ROW, 1024, null);
// get the block cache and region
RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName);
String regionName = locator.getAllRegionLocations().get(0).getRegion().getEncodedName();
@@ -599,6 +610,10 @@ public class TestBlockEvictionFromClient {
// Though the split had created the HalfStorefileReader - the firstkey and lastkey scanners
// should be closed inorder to return those blocks
iterateBlockCache(cache, iterator);
+ } finally {
+ if (table != null) {
+ table.close();
+ }
}
}