hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1136741 - in /hadoop/common/trunk/hdfs: ./ src/java/org/apache/hadoop/hdfs/server/datanode/
Date Thu, 16 Jun 2011 23:35:12 GMT
Author: suresh
Date: Thu Jun 16 23:35:11 2011
New Revision: 1136741

URL: http://svn.apache.org/viewvc?rev=1136741&view=rev
Log:
HDFS-1692. In secure mode, Datanode process doesn't exit when disks fail. Contributed by Bharath
Mundlapudi.
        

Modified:
    hadoop/common/trunk/hdfs/CHANGES.txt
    hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
    hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
    hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java

Modified: hadoop/common/trunk/hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/CHANGES.txt?rev=1136741&r1=1136740&r2=1136741&view=diff
==============================================================================
--- hadoop/common/trunk/hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hdfs/CHANGES.txt Thu Jun 16 23:35:11 2011
@@ -751,6 +751,9 @@ Trunk (unreleased changes)
     HDFS-1656. Fixes an issue to do with fetching of delegation tokens in
     HftpFileSystem. Contributed by Kan Zhang.
 
+    HDFS-1692. In secure mode, Datanode process doesn't exit when disks 
+    fail. (Bharath Mundlapudi via suresh)
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java?rev=1136741&r1=1136740&r2=1136741&view=diff
==============================================================================
--- hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
(original)
+++ hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Thu Jun 16 23:35:11 2011
@@ -2280,6 +2280,13 @@ public class DataNode extends Configured
     } catch (Throwable e) {
       LOG.error(StringUtils.stringifyException(e));
       System.exit(-1);
+    } finally {
+      // We need to add System.exit here because either shutdown was called or
+      // some disk related conditions like volumes tolerated or volumes required
+      // condition was not met. Also, In secure mode, control will go to Jsvc
+      // and Datanode process hangs without System.exit.
+      LOG.warn("Exiting Datanode");
+      System.exit(0);
     }
   }
   

Modified: hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java?rev=1136741&r1=1136740&r2=1136741&view=diff
==============================================================================
--- hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
(original)
+++ hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
Thu Jun 16 23:35:11 2011
@@ -47,7 +47,7 @@ class DataXceiverServer implements Runna
   
   ServerSocket ss;
   DataNode datanode;
-  // Record all sockets opend for data transfer
+  // Record all sockets opened for data transfer
   Map<Socket, Socket> childSockets = Collections.synchronizedMap(
                                        new HashMap<Socket, Socket>());
   
@@ -140,19 +140,18 @@ class DataXceiverServer implements Runna
       } catch (SocketTimeoutException ignored) {
         // wake up to see if should continue to run
       } catch (IOException ie) {
-        LOG.warn(datanode.getMachineName() + ":DataXceiveServer: " 
-                                + StringUtils.stringifyException(ie));
+        LOG.warn(datanode.getMachineName() + ":DataXceiveServer: ", ie);
       } catch (Throwable te) {
-        LOG.error(datanode.getMachineName() + ":DataXceiveServer: Exiting due to:" 
-                                 + StringUtils.stringifyException(te));
+        LOG.error(datanode.getMachineName()
+            + ":DataXceiveServer: Exiting due to: ", te);
         datanode.shouldRun = false;
       }
     }
     try {
       ss.close();
     } catch (IOException ie) {
-      LOG.warn(datanode.getMachineName() + ":DataXceiveServer: " 
-                              + StringUtils.stringifyException(ie));
+      LOG.warn(datanode.getMachineName()
+          + ":DataXceiveServer: Close exception due to: ", ie);
     }
   }
   

Modified: hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java?rev=1136741&r1=1136740&r2=1136741&view=diff
==============================================================================
--- hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
(original)
+++ hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
Thu Jun 16 23:35:11 2011
@@ -879,7 +879,8 @@ public class FSDataset implements FSCons
           if (removedVols == null) {
             removedVols = new ArrayList<FSVolume>(1);
           }
-          removedVols.add(volumeList.get(idx));
+          removedVols.add(fsv);
+          fsv.shutdown(); 
           volumeList.set(idx, null); // Remove the volume
           numFailedVolumes++;
         }



Mime
View raw message