From 14087cc919da9f2e0b1a68f701f6365ad9d1d71f Mon Sep 17 00:00:00 2001 From: zhangduo Date: Fri, 22 Jun 2018 16:44:36 +0800 Subject: [PATCH] HBASE-20775 TestMultiParallel is flakey --- .../apache/hadoop/hbase/client/ConnectionImplementation.java | 11 +++++++---- hbase-server/pom.xml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index 53e4b7fe1b..1176cbdd5d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -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(); } diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index e9daf93aae..473b7409de 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -19,6 +19,7 @@ * limitations under the License. */ --> + 4.0.0 hbase-build-configuration -- 2.11.4.GIT