You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by br...@apache.org on 2018/08/28 06:34:17 UTC

hbase git commit: HBASE-21084 When cloning a snapshot including a split parent region, the split parent region of the cloned table will be online - addendum

Repository: hbase
Updated Branches:
  refs/heads/master f1d9377a7 -> bd0435892


HBASE-21084 When cloning a snapshot including a split parent region, the split parent region of the cloned table will be online - addendum


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bd043589
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bd043589
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bd043589

Branch: refs/heads/master
Commit: bd0435892a784a36cccde4ef7b68ac8e24c711f7
Parents: f1d9377
Author: Toshihiro Suzuki <br...@gmail.com>
Authored: Mon Aug 27 23:40:03 2018 +0900
Committer: Toshihiro Suzuki <br...@gmail.com>
Committed: Tue Aug 28 15:34:01 2018 +0900

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/client/RegionReplicaUtil.java     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bd043589/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionReplicaUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionReplicaUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionReplicaUtil.java
index 9c5af37..259f581 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionReplicaUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionReplicaUtil.java
@@ -175,12 +175,13 @@ public class RegionReplicaUtil {
       return regions;
     }
     List<RegionInfo> hRegionInfos = new ArrayList<>((newReplicaCount) * regions.size());
-    for (int i = 0; i < regions.size(); i++) {
-      if (RegionReplicaUtil.isDefaultReplica(regions.get(i))) {
+    for (RegionInfo ri : regions) {
+      if (RegionReplicaUtil.isDefaultReplica(ri) &&
+        (!ri.isOffline() || (!ri.isSplit() && !ri.isSplitParent()))) {
         // region level replica index starts from 0. So if oldReplicaCount was 2 then the max replicaId for
         // the existing regions would be 1
         for (int j = oldReplicaCount; j < newReplicaCount; j++) {
-          hRegionInfos.add(RegionReplicaUtil.getRegionInfoForReplica(regions.get(i), j));
+          hRegionInfos.add(RegionReplicaUtil.getRegionInfoForReplica(ri, j));
         }
       }
     }