HBASE-13192. IntegrationTestBulkLoad doesn't wait for table modification sometimes leading to spurious test failures.

This commit is contained in:
Devaraj Das 2015-03-11 13:55:01 -07:00
parent 5bf98d0827
commit 2adec36b2f
1 changed files with 6 additions and 5 deletions

View File

@ -1750,7 +1750,8 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
setFirst(0);
setSecond(0);
}};
for (int i = 0; status.getFirst() != 0 && i < 500; i++) { // wait up to 500 seconds
int i = 0;
do {
status = admin.getAlterStatus(desc.getTableName());
if (status.getSecond() != 0) {
LOG.debug(status.getSecond() - status.getFirst() + "/" + status.getSecond()
@ -1760,9 +1761,9 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
LOG.debug("All regions updated.");
break;
}
}
if (status.getSecond() != 0) {
throw new IOException("Failed to update replica count after 500 seconds.");
} while (status.getFirst() != 0 && i++ < 500);
if (status.getFirst() != 0) {
throw new IOException("Failed to update all regions even after 500 seconds.");
}
}
@ -1774,7 +1775,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
admin.disableTable(table);
HTableDescriptor desc = admin.getTableDescriptor(table);
desc.setRegionReplication(replicaCount);
modifyTableSync(admin, desc);
admin.modifyTable(desc.getTableName(), desc);
admin.enableTable(table);
}