In HDFS-1822 and HDFS-1842, the layout versions for 203, 204, 22 and trunk were changed. Some of the namenode logic that depends on layout version is broken because of this. Read the comment for more description.
Cannot upgrade 0.20.203 to 0.21 with an editslog present
Editlog opcodes overlap between 20 security and later releases