lokeshj1703 commented on a change in pull request #628: HDDS-1008. Invalidate 
closed container replicas on a failed volume.
URL: https://github.com/apache/hadoop-ozone/pull/628#discussion_r388125111
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/VolumeSet.java
 ##########
 @@ -239,23 +249,24 @@ private void checkAllVolumes() throws IOException {
    * @param failedVolumes
    */
   private void handleVolumeFailures(Set<HddsVolume> failedVolumes) {
-    for (HddsVolume v: failedVolumes) {
-      this.writeLock();
-      try {
+    this.writeLock();
+    try {
+      for (HddsVolume v : failedVolumes) {
         // Immediately mark the volume as failed so it is unavailable
         // for new containers.
-        volumeMap.remove(v.getHddsRootDir().getPath());
-        failedVolumeMap.putIfAbsent(v.getHddsRootDir().getPath(), v);
-      } finally {
-        this.writeUnlock();
+        failVolume(v.getHddsRootDir().getPath());
       }
-
-      // TODO:
-      // 1. Mark all closed containers on the volume as unhealthy.
-      // 2. Consider stopping IO on open containers and tearing down
-      //    active pipelines.
-      // 3. Handle Ratis log disk failure.
+      if (failedVolumeListener != null) {
 
 Review comment:
   Yes we can move it outside. But I think there is a race condition in marking 
a volume as failed. A container in process of creation can still get created on 
the failed volume. We can handle it as part of separate jira though.

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


With regards,
Apache Git Services

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

Reply via email to