You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/01/24 18:06:53 UTC
[hbase] branch branch-2 updated: HBASE-23733 [Flakey Tests]
TestSplitTransactionOnCluster
This is an automated email from the ASF dual-hosted git repository.
stack 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 cfe569c HBASE-23733 [Flakey Tests] TestSplitTransactionOnCluster
cfe569c is described below
commit cfe569cf6b544213188a276408e7197d697e6edf
Author: stack <st...@apache.org>
AuthorDate: Fri Jan 24 10:06:18 2020 -0800
HBASE-23733 [Flakey Tests] TestSplitTransactionOnCluster
---
.../TestSplitTransactionOnCluster.java | 28 +++++++++++++++-------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
index 2fb822e..72b6835 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -84,6 +84,7 @@ import org.apache.hadoop.hbase.master.assignment.RegionStateNode;
import org.apache.hadoop.hbase.master.assignment.RegionStates;
import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
import org.apache.hadoop.hbase.regionserver.compactions.CompactionContext;
+import org.apache.hadoop.hbase.regionserver.compactions.CompactionProgress;
import org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputController;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
@@ -360,10 +361,8 @@ public class TestSplitTransactionOnCluster {
final TableName tableName = TableName.valueOf(name.getMethodName());
// Create table then get the single region for our new table.
- Table t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY);
- List<HRegion> regions = cluster.getRegions(tableName);
- RegionInfo hri = getAndCheckSingleTableRegion(regions);
-
+ Table t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY); List<HRegion> regions =
+ cluster.getRegions(tableName); RegionInfo hri = getAndCheckSingleTableRegion(regions);
int tableRegionIndex = ensureTableRegionNotOnSameServerAsMeta(admin, hri);
// Turn off balancer so it doesn't cut in and mess up our placements.
@@ -380,20 +379,31 @@ public class TestSplitTransactionOnCluster {
admin.splitRegionAsync(hri.getRegionName()).get(2, TimeUnit.MINUTES);
// Get daughters
List<HRegion> daughters = checkAndGetDaughters(tableName);
- HRegion daughterRegion = daughters.get(0);
// Now split one of the daughters.
+ HRegion daughterRegion = daughters.get(0);
RegionInfo daughter = daughterRegion.getRegionInfo();
LOG.info("Daughter we are going to split: " + daughter);
- // Compact first to ensure we have cleaned up references -- else the split
- // will fail.
+ // Compact first to ensure we have cleaned up references -- else the split will fail.
+ // May be a compaction going already so compact will return immediately; if so, wait until
+ // compaction completes.
daughterRegion.compact(true);
- daughterRegion.getStores().get(0).closeAndArchiveCompactedFiles();
+ HStore store = daughterRegion.getStores().get(0);
+ CompactionProgress progress = store.getCompactionProgress();
+ if (progress != null) {
+ while (progress.getProgressPct() < 1) {
+ LOG.info("Waiting {}", progress);
+ Threads.sleep(1000);
+ }
+ }
+ store.closeAndArchiveCompactedFiles();
for (int i = 0; i < 100; i++) {
if (!daughterRegion.hasReferences()) {
+ LOG.info("Break -- no references in {}", daughterRegion);
break;
}
Threads.sleep(100);
}
+ LOG.info("Finished {} references={}", daughterRegion, daughterRegion.hasReferences());
assertFalse("Waiting for reference to be compacted", daughterRegion.hasReferences());
LOG.info("Daughter hri before split (has been compacted): " + daughter);
admin.splitRegionAsync(daughter.getRegionName()).get(2, TimeUnit.MINUTES);