[ https://issues.apache.org/jira/browse/HDFS-4300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13641986#comment-13641986 ]
Colin Patrick McCabe commented on HDFS-4300: -------------------------------------------- I could be off base here, but I think there is some value in giving the temporary files unique names. Failed storage directories can come back (at least on the primary NN; haven't checked if this applies to the 2NN) if the correct configuration is set. Sure, everything "should" work correctly, but why take that chance when you can just use a unique file name? > TransferFsImage.downloadEditsToStorage should use a tmp file for destination > ---------------------------------------------------------------------------- > > Key: HDFS-4300 > URL: https://issues.apache.org/jira/browse/HDFS-4300 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.0.2-alpha > Reporter: Todd Lipcon > Assignee: Andrew Wang > Priority: Critical > Attachments: hdfs-4300-1.patch > > > Currently, in TransferFsImage.downloadEditsToStorage, we download the edits > file directly to its finalized path. So, if the transfer fails in the middle, > a half-written file is left and cannot be distinguished from a correct file. > So, future checkpoints by the 2NN will fail, since the file is truncated in > the middle -- but it won't ever download a good copy because it thinks it > already has the proper file. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira