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

This commit is contained in:
Toshihiro Suzuki 2018-08-27 23:40:03 +09:00
parent f1d9377a7f
commit bd0435892a
1 changed files with 4 additions and 3 deletions

View File

@ -175,12 +175,13 @@ public class RegionReplicaUtil {
return regions; return regions;
} }
List<RegionInfo> hRegionInfos = new ArrayList<>((newReplicaCount) * regions.size()); List<RegionInfo> hRegionInfos = new ArrayList<>((newReplicaCount) * regions.size());
for (int i = 0; i < regions.size(); i++) { for (RegionInfo ri : regions) {
if (RegionReplicaUtil.isDefaultReplica(regions.get(i))) { 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 // region level replica index starts from 0. So if oldReplicaCount was 2 then the max replicaId for
// the existing regions would be 1 // the existing regions would be 1
for (int j = oldReplicaCount; j < newReplicaCount; j++) { for (int j = oldReplicaCount; j < newReplicaCount; j++) {
hRegionInfos.add(RegionReplicaUtil.getRegionInfoForReplica(regions.get(i), j)); hRegionInfos.add(RegionReplicaUtil.getRegionInfoForReplica(ri, j));
} }
} }
} }