This is a continuation of a discussion from HDFS-909. The FSImage.saveFSImage function (implementing dfsadmin -saveNamespace) can corrupt the NN storage such that all current edits are lost.
Race condition between rollEditLog or rollFSImage ant FSEditsLog.write operations corrupts edits log
NameNode startup fails if edit log terminates prematurely
saveNamespace race can corrupt the edits log
FSImage writing should always fsync before close
FSImage layout version should be only once file is complete
Simpler model for Namenode's fs Image and edit Logs