You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/05/19 09:53:16 UTC

[GitHub] [ozone] bshashikant commented on a change in pull request #2243: HDDS-5219. Limit number of bad volumes by dfs.datanode.failed.volumes.tolerated

bshashikant commented on a change in pull request #2243:
URL: https://github.com/apache/ozone/pull/2243#discussion_r635087420



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/MutableVolumeSet.java
##########
@@ -522,6 +539,19 @@ private void stopDiskChecker() {
     return ImmutableMap.copyOf(volumeStateMap);
   }
 
+  public boolean hasEnoughVolumes() {
+    int maxVolumeFailuresTolerated = conf.getInt(
+        DFSConfigKeysLegacy.DFS_DATANODE_FAILED_VOLUMES_TOLERATED_KEY,
+        DFSConfigKeysLegacy.DFS_DATANODE_FAILED_VOLUMES_TOLERATED_DEFAULT);
+
+    if (maxVolumeFailuresTolerated ==
+        DataNode.MAX_VOLUME_FAILURE_TOLERATED_LIMIT) {
+      return getVolumesList().size() >= 1;
+    } else {
+      return getFailedVolumesList().size() <= maxVolumeFailuresTolerated;

Review comment:
       Can you add some comments here?




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org