In addition, should we remove the tracking of FSNamesystem#imageLoaded altogether?
I think tracking is used to decide to whether quota check is required or not. Quota check not required during editlog processing, during which FSNamesystem#imageLoaded will be false.
So, IMO, removing of this tracker not required.
Haohui Mai could clarify the intention of checking imageLoaded during RPC processing
IMO, waitForLoadingFsImage() was trying to ensure full loading of image before serving RPC requests. This was a movement one level higher from FSDirectory to FSNameSystem in
HDFS-6480 and included RPC requests as well. At the time this check was added, checkNNStartup() was not present. checkNNStartup() was added to ensure full services startup,(mainly transition RPCs which doesnt come under waitForLoadingFsImage() check), along with fsImage load in HDFS-3443 which committed in Jan-2015.
I think its fair to remove waitForLoadingFsImage() but leave the tracker FSNamesystem#imageLoaded and get/setter for it as is.