Affects Version/s: 0.90.6
Fix Version/s: None
The following NPE can occur during master failover:
This is caused by regionOnline() being passed a null serverInfo (its second parameter).
The AssignmentManager's processFailover() method is passing a null to regionOnline() because the value that regionOnline is passing, hsi, is set as:
getHServerInfo() is defined as:
This will return null if the onlineServers map does not yet have a value corresponding to the key supplied by the catalogTracker's getRootLocation() or getMetaLocation().
Since the catalogTracker uses zookeeper to establish the server locations of
ROOT and .META., while the onlineServers map is set according to the these servers' registering with the master, there can be an inconsistency between the catalogTracker and the onlineServers if either of these regionservers is online with respect to zookeeper, but haven't yet registered with the master (perhaps due to a high latency network between the master and the regionserver).
The attached testMasterFailoverWithSlowRS.txt patch can be used to modify TestMasterFailover to cause this NPE.
The proposed fix (provided along with the above test in a separate attachment) is for the master to use the new verifyMetaTablesAreUp() to wait for both of the servers named by the catalog tracker's getRootLocation() and getMetaLocation() to register with the master before the master can continue with failover.