HDFS-5698 is already merged to trunk, why not merge those changes first and then make changes related to this jira using protobuf itself?
There are some conflicts with the branch. I plan to resolve them later on since I have started to work on this.
> Instead of extracting checking part to checkUpgrade() can't we use nn.getFSImage().isUpgradeFinalized() directly? This will avoid checking disks on RPC calls holding writeLock.
You brought up a good point about the write lock. However, isUpgradeFinalized() is different from checkUpgrade(), which is to check if upgrade is started. Since starting rolling upgrade is an admin command, we can safely assume that it won't be abused.