HBASE-20775 TestMultiParallel is flakey

This commit is contained in:
zhangduo 2018-06-22 16:44:36 +08:00
parent 177458d9d0
commit 14087cc919
2 changed files with 8 additions and 4 deletions

View File

@ -799,6 +799,7 @@ class ConnectionImplementation implements ClusterConnection, Closeable {
s.setConsistency(Consistency.TIMELINE);
}
int maxAttempts = (retry ? numTries : 1);
boolean relocateMeta = false;
for (int tries = 0; ; tries++) {
if (tries >= maxAttempts) {
throw new NoServerForRegionException("Unable to find region for "
@ -825,6 +826,10 @@ class ConnectionImplementation implements ClusterConnection, Closeable {
return locations;
}
}
if (relocateMeta) {
relocateRegion(TableName.META_TABLE_NAME, HConstants.EMPTY_START_ROW,
RegionInfo.DEFAULT_REPLICA_ID);
}
s.resetMvccReadPoint();
try (ReversedClientScanner rcs =
new ReversedClientScanner(conf, s, TableName.META_TABLE_NAME, this, rpcCallerFactory,
@ -904,10 +909,8 @@ class ConnectionImplementation implements ClusterConnection, Closeable {
throw e;
}
// Only relocate the parent region if necessary
if(!(e instanceof RegionOfflineException ||
e instanceof NoServerForRegionException)) {
relocateRegion(TableName.META_TABLE_NAME, metaStartKey, replicaId);
}
relocateMeta =
!(e instanceof RegionOfflineException || e instanceof NoServerForRegionException);
} finally {
userRegionLock.unlock();
}

View File

@ -19,6 +19,7 @@
* limitations under the License.
*/
-->
<!-- for testing -->
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hbase-build-configuration</artifactId>