In FSEditLogLoader#loadFSEdits, should we really be unconditionally calling FSNamesystem#notifyGenStampUpdate in the finally block? What if an error occurs and maxGenStamp is never updated in FSEditLogLoader#loadEditRecords
This should be OK – we'll just call it with the argument 0, which won't cause any problem (0 is lower than any possible queued gen stamp)
sp. "Initiatling" in TestHASafeMode#testComplexFailoverIntoSafemode
In FSNamesystem#notifyGenStampUpdate, could be a better log message, and the log level should probably not be info: LOG.info("=> notified of genstamp update for: " + gs);
Fixed and changed to DEBUG level
Why is SafeModeInfo#doConsistencyCheck costly? It doesn't seem like it should be. If it's not in fact expensive, we might as well make it run regardless of whether or not asserts are enabled
You're right that it's not super expensive, but this code gets called on every block being reported during startup, which is a fair amount.. so I chose to maintain the current behavior, of only running the checks when asserts are enabled.
Is there really no better way to check if assertions are enabled?
Not that I've ever found!
seems like they should all be made member methods and moved to MiniDFSCluster... Also seems like TestEditLogTailer#waitForStandbyToCatchUp should be moved to MiniDFSCluster.
I'd like to move a bunch of these methods into a new HATestUtil class... can I do that in a follow-up JIRA?
Nice change and tests. Nit, I'd add a comment in TestHASafeMode#restartStandby where the safemode extension is set indicating the rationale, it looked like the asserts at the end were racy because I missed this