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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java:
##########
@@ -506,14 +506,17 @@ private void 
removeReplicaColumnsIfNeeded(MasterProcedureEnv env) throws IOExcep
   private void assignNewReplicasIfNeeded(MasterProcedureEnv env) throws 
IOException {
     final int oldReplicaCount = 
unmodifiedTableDescriptor.getRegionReplication();
     final int newReplicaCount = modifiedTableDescriptor.getRegionReplication();
-    if (newReplicaCount <= oldReplicaCount) {
+    int existingReplicasCount = env.getAssignmentManager().getRegionStates()
+      .getRegionsOfTable(modifiedTableDescriptor.getTableName()).size();
+    if (newReplicaCount <= Math.min(oldReplicaCount, existingReplicasCount)) {

Review Comment:
   Yes, I got that. My point is why are you considering the ZK info at all? The 
issue we are trying to fix is the fact that ZK info is incorrect, so we 
shouldn't take it into account here. Can't we just rely on oldReplicaCount and 
newReplicaCount info?



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