huaxiangsun commented on a change in pull request #3052:
URL: https://github.com/apache/hbase/pull/3052#discussion_r595548965



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterMetaBootstrap.java
##########
@@ -61,25 +60,25 @@ void assignMetaReplicas()
       throw new IllegalStateException("hbase:meta must be initialized first 
before we can " +
           "assign out its replicas");
     }
-    ServerName metaServername = 
MetaTableLocator.getMetaRegionLocation(this.master.getZooKeeper());
+
     for (int i = 1; i < numReplicas; i++) {
       // Get current meta state for replica from zk.
-      RegionState metaState = 
MetaTableLocator.getMetaRegionState(master.getZooKeeper(), i);
       RegionInfo hri = RegionReplicaUtil.getRegionInfoForReplica(
-          RegionInfoBuilder.FIRST_META_REGIONINFO, i);
-      LOG.debug(hri.getRegionNameAsString() + " replica region state from 
zookeeper=" + metaState);
-      if (metaServername.equals(metaState.getServerName())) {
-        metaState = null;
-        LOG.info(hri.getRegionNameAsString() +
-          " old location is same as current hbase:meta location; setting 
location as null...");
-      }

Review comment:
       I think it is a bad optimization. What it tries to do is to avoid 
assigning meta replica to the same region server where primary region is 
located. This part of old logic is untested as there is no unassign procedure 
for the meta replica region. It is ok to keep the original assignment and let 
balancer to move them apart.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to