private static void searchProbableMaster ( AuroraListener listener , final GlobalStateInfo globalInfo , HostAddress probableMaster ) { AuroraProtocol protocol = getNewProtocol ( listener . getProxy ( ) , globalInfo , listener . getUrlParser ( ) ) ; try { protocol . setHostAddress ( probableMaster ) ; protocol . connect ( ) ; listener . removeFromBlacklist ( protocol . getHostAddress ( ) ) ; if ( listener . isMasterHostFailReconnect ( ) && protocol . isMasterConnection ( ) ) { protocol . setMustBeMasterConnection ( true ) ; listener . foundActiveMaster ( protocol ) ; } else if ( listener . isSecondaryHostFailReconnect ( ) && ! protocol . isMasterConnection ( ) ) { protocol . setMustBeMasterConnection ( false ) ; listener . foundActiveSecondary ( protocol ) ; } else { protocol . close ( ) ; protocol = getNewProtocol ( listener . getProxy ( ) , globalInfo , listener . getUrlParser ( ) ) ; } } catch ( SQLException e ) { listener . addToBlacklist ( protocol . getHostAddress ( ) ) ; } }
Connect aurora probable master . Aurora master change in time . The only way to check that a server is a master is to asked him .