HBASE-12165 TestEndToEndSplitTransaction.testFromClientSideWhileSplitting fails -- DEBUGGING STRINGS

This commit is contained in:
stack 2014-10-02 21:10:45 -07:00
parent a17614d5b2
commit da9f2434b2
1 changed files with 13 additions and 6 deletions

View File

@ -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<HRegionInfo, ServerName> regions = MetaScanner.allTableRegions(conf, null,
tableName, false);
if (regions.size() == 0) {
@ -341,7 +341,7 @@ public class TestEndToEndSplitTransaction {
}
void verifyTableRegions(Set<HRegionInfo> 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<HRegionInfo> 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) {