I use OEV tool to convert editlog to xml file, then convert the xml file back to binary editslog file(so that low version NameNode can load edits that generated by higher version NameNode). But when OP_UPDATE_BLOCKS has no BLOCK tag, the OEV tool doesn't handle the case and exits with InvalidXmlException.
Here is the stack:
Here is part of the xml file:
I tracked the NN's log and found those operation:
0. The file /tmp/100M3/slive/data/subDir_13/subDir_7/subDir_15/subDir_11/subFile_5 is very small and contains only one block.
1. Client ask NN to add block to the file.
2. Client failed to write to DN and asked NameNode to abandon block.
3. NN remove the block and write an OP_UPDATE_BLOCKS to editlog
Finally NN generated a OP_UPDATE_BLOCKS with no BLOCK tags.
In FSEditLogOp$UpdateBlocksOp.fromXml, we need to handle the case above.