shahrs87 commented on code in PR #6437:
URL: https://github.com/apache/hadoop/pull/6437#discussion_r1449133212


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -1463,21 +1463,28 @@ private void markBlockAsCorrupt(BlockToMarkCorrupt b,
         b.getReason(), b.getReasonCode());
 
     NumberReplicas numberOfReplicas = countNodes(b.getStored());
-    boolean hasEnoughLiveReplicas = numberOfReplicas.liveReplicas() >=
-        expectedReplicas;
+    final int numUsableReplicas = numberOfReplicas.liveReplicas() +
+        numberOfReplicas.decommissioning() +
+        numberOfReplicas.liveEnteringMaintenanceReplicas();
+    boolean hasEnoughLiveReplicas = numUsableReplicas >=
+        expectedRedundancies;
+
     boolean minReplicationSatisfied =
         numberOfReplicas.liveReplicas() >= minReplication;

Review Comment:
   ```suggestion
           numUsableReplicas >= minReplication;
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to