Save the contents of the FS image and create empty edits. In order to minimize the recovery effort in case of failure during saveNamespace the algorithm reduces discrepancy between directory states by performing updates in the following order:
- rename current to lastcheckpoint.tmp for all of them,
- save image and recreate edits for all of them,
- rename lastcheckpoint.tmp to previous.checkpoint.
On stage (2) we first save all images, then recreate edits. Otherwise the name-node may purge all edits and fail, in which case the journal will be lost.