+1, the patch looks good to me.
Note that it's pretty easy to test this manually, if you wanted to, using a secure pseudo-cluster:
- Start up the NN and 2NN, with the checkpoint period set low.
- Get a DT using `hdfs fetchdt'
- Make sure the 2NN performs a checkpoint.
- Restart the NN, which on startup will merge the edits and fsimage.
- Without restarting the 2NN, make sure it successfully performs another checkpoint.