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

Todd Lipcon commented on HDFS-3259:
-----------------------------------

A few issues:
- The file copy you're doing could fail with a half-written file in the middle. 
I think you need to copy to a tmp filename and then rename once the copy is 
done. You could use AtomicFileOutputStream here, actually, since fsyncing it 
seems reasonable.
- Rather than blindly casting, I think it's worth checking instanceof, and 
bailing out with an error if one of the journals isn't a FileJournalManager. 
The error can say that this initialization feature currently only works with 
file-based streams. That's better than an ugly ClassCastException stack trace

                
> NameNode#initializeSharedEdits should populate shared edits dir with edit log 
> segments
> --------------------------------------------------------------------------------------
>
>                 Key: HDFS-3259
>                 URL: https://issues.apache.org/jira/browse/HDFS-3259
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: ha, name-node
>    Affects Versions: 2.0.0
>            Reporter: Aaron T. Myers
>            Assignee: Aaron T. Myers
>         Attachments: HDFS-3259.patch, HDFS-3259.patch
>
>
> Currently initializeSharedEdits formats the shared dir so that subsequent 
> edit log segments will be written there. However, it would be nice to 
> automatically populate this dir with edit log segments with transactions 
> going back to the last fsimage.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to