[ 
https://issues.apache.org/jira/browse/HDFS-2271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13087123#comment-13087123
 ] 

Suresh Srinivas commented on HDFS-2271:
---------------------------------------

Uma, can you please keep the description brief and add the details description 
to a comment to avoid lengthy emails.

> startJournalSpool should invoke ProcessIOError with failed storage 
> directories if createEditLogFile throws any exception.  
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-2271
>                 URL: https://issues.apache.org/jira/browse/HDFS-2271
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 0.22.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>
> If createEditsLogFile failes in startJournalSpool of BackUpStorage, 
> BackUPNode will proceed with following exceptions. 
> 2011-04-09 21:24:43,892 ERROR namenode.FSNamesystem 
> (FSEditLog.java:logSync(1207)) - Unable to sync edit log.
> org.apache.hadoop.ipc.RemoteException: java.io.FileNotFoundException: 
> /hdfsdata/7/patch/name/data/current/edits (No such file or directory)
> at java.io.RandomAccessFile.open(Native Method)
> at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
> at 
> org.apache.hadoop.hdfs.server.namenode.FSEditLog$EditLogFileOutputStream.<init>(FSEditLog.java:150)
> at 
> org.apache.hadoop.hdfs.server.namenode.FSEditLog.createEditLogFile(FSEditLog.java:427)
> at 
> org.apache.hadoop.hdfs.server.namenode.BackupStorage.startJournalSpool(BackupStorage.java:275)
> at 
> org.apache.hadoop.hdfs.server.namenode.BackupNode.journal(BackupNode.java:327)
> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:541)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1105)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1101)
> at java.security.AccessController.doPrivileged(Native Method)
> at javax.security.auth.Subject.doAs(Subject.java:396)
> at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1099)
> at org.apache.hadoop.ipc.Client.call(Client.java:953)
> at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:239)
> at $Proxy4.journal(Unknown Source)
> at 
> org.apache.hadoop.hdfs.server.namenode.EditLogBackupOutputStream.send(EditLogBackupOutputStream.java:165)
> at 
> org.apache.hadoop.hdfs.server.namenode.EditLogBackupOutputStream.flushAndSync(EditLogBackupOutputStream.java:145)
> at 
> org.apache.hadoop.hdfs.server.namenode.EditLogOutputStream.flush(EditLogOutputStream.java:83)
> at 
> org.apache.hadoop.hdfs.server.namenode.FSEditLog.logSync(FSEditLog.java:1204)
> at 
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startCheckpoint(FSNamesystem.java:5164)
> at 
> org.apache.hadoop.hdfs.server.namenode.NameNode.startCheckpoint(NameNode.java:547)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:541)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1105)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1101)
> at java.security.AccessController.doPrivileged(Native Method)
> at javax.security.auth.Subject.doAs(Subject.java:396)
> at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1099)
> 2011-04-09 21:24:43,893 ERROR namenode.FSNamesystem 
> (FSEditLog.java:processIOError(557)) - Unable to log edits to 
> 10.18.53.203:50100
> 2011-04-09 21:24:44,353 WARN mortbay.log (Slf4jLog.java:warn(76)) - 
> /getimage: java.io.IOException: GetImage failed. java.io.IOException: 
> Inconsistent checkpoint fields.
> LV = -18 namespaceID = 2007855034 cTime = 0; checkpointTime = 1302380284708.
> Expecting respectively: -18; 2007855034; 0; 1302380284709
> at 
> org.apache.hadoop.hdfs.server.namenode.CheckpointSignature.validateStorageInfo(CheckpointSignature.java:70)
> at 
> org.apache.hadoop.hdfs.server.namenode.FSImage.validateCheckpointUpload(FSImage.java:1732)
> at 
> org.apache.hadoop.hdfs.server.namenode.GetImageServlet.doGet(GetImageServlet.java:62)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> Solution:
> When it failes to createEditLogFile, we can collect all the failed 
> directories and can call processIOError with that storageDirectories list
> {code}
> synchronized void startJournalSpool(NamenodeRegistration nnReg)
>  throws IOException {
> ..................
> ...................
>  ArrayList<StorageDirectory> errorSDs = new ArrayList<StorageDirectory>();
>     // create journal spool directories
>     for(Iterator<StorageDirectory> it =
>                           dirIterator(NameNodeDirType.EDITS); it.hasNext();) {
>       ...................
>      ...................     
>       // create edit file if missing
>       File eFile = getEditFile(sd);
>       if(!eFile.exists())
>       {
>         try
>         {
>                 editLog.createEditLogFile(eFile);
>         }
>         catch(IOException ie)
>         {
>             LOG.error("Unable to save edits for " + sd.getRoot(), ie);
>             errorSDs.add(sd);
>           }
>       }
>     }
>     processIOError(errorSDs, true);
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to