richardantal commented on code in PR #6448:
URL: https://github.com/apache/hbase/pull/6448#discussion_r2013726194


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java:
##########
@@ -1157,19 +1157,22 @@ private void finishActiveMasterInitialization() throws 
IOException, InterruptedE
       int replicasNumInConf =
         conf.getInt(HConstants.META_REPLICAS_NUM, 
HConstants.DEFAULT_META_REPLICA_NUM);
       TableDescriptor metaDesc = 
tableDescriptors.get(TableName.META_TABLE_NAME);
-      if (metaDesc.getRegionReplication() != replicasNumInConf) {
+      int existingReplicasCount =
+        
assignmentManager.getRegionStates().getRegionsOfTable(TableName.META_TABLE_NAME).size();
+
+      if (
+        metaDesc.getRegionReplication() != replicasNumInConf
+          || existingReplicasCount != metaDesc.getRegionReplication()
+      ) {

Review Comment:
   existingReplicasCount reflects the  in-memory state of the AssignmentManager.
   In this case it will be 1 because only the FIRST_META_REGIONINFO will be 
there.
   
   You are right the problem is that no assignment procedure to be triggered on 
the meta replicas because
   metaDesc.getRegionReplication() reflects the root.dir state (three, since 
it's a previous used rootdir), then we never update the meta descriptor and 
this cause.
   



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to