From da9f2434b2ad9e85a7f726bb5334568ac772ec90 Mon Sep 17 00:00:00 2001 From: stack Date: Thu, 2 Oct 2014 21:10:45 -0700 Subject: [PATCH] HBASE-12165 TestEndToEndSplitTransaction.testFromClientSideWhileSplitting fails -- DEBUGGING STRINGS --- .../TestEndToEndSplitTransaction.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java index 67a8f190373..d2164d1853f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java @@ -235,7 +235,7 @@ public class TestEndToEndSplitTransaction { public void run() { try { Random random = new Random(); - for (int i=0; i< 5; i++) { + for (int i= 0; i< 5; i++) { NavigableMap regions = MetaScanner.allTableRegions(conf, null, tableName, false); if (regions.size() == 0) { @@ -341,7 +341,7 @@ public class TestEndToEndSplitTransaction { } void verifyTableRegions(Set regions) { - log("Verifying " + regions.size() + " regions"); + log("Verifying " + regions.size() + " regions: " + regions); byte[][] startKeys = new byte[regions.size()][]; byte[][] endKeys = new byte[regions.size()][]; @@ -428,14 +428,16 @@ public class TestEndToEndSplitTransaction { Table metaTable = new HTable(conf, TableName.META_TABLE_NAME); try { - while (System.currentTimeMillis() - start < timeout) { - Result result = getRegionRow(metaTable, regionName); + Result result = null; + HRegionInfo region = null; + while ((System.currentTimeMillis() - start) < timeout) { + result = getRegionRow(metaTable, regionName); if (result == null) { break; } - HRegionInfo region = HRegionInfo.getHRegionInfo(result); - if(region.isSplitParent()) { + region = HRegionInfo.getHRegionInfo(result); + if (region.isSplitParent()) { log("found parent region: " + region.toString()); PairOfSameType pair = HRegionInfo.getDaughterRegions(result); daughterA = pair.getFirst(); @@ -444,6 +446,11 @@ public class TestEndToEndSplitTransaction { } Threads.sleep(100); } + if (daughterA == null || daughterB == null) { + throw new IOException("Failed to get daughters, daughterA=" + daughterA + ", daughterB=" + + daughterB + ", timeout=" + timeout + ", result=" + result + ", regionName=" + regionName + + ", region=" + region); + } //if we are here, this means the region split is complete or timed out if (waitForDaughters) {