code: 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());
      }
    }
docs: Connect aurora probable master. Aurora master change in time. The only way to check that a
  server is a master is to asked him.
  
  @param listener       aurora failover to call back if master is found
  @param globalInfo     server global variables information
  @param probableMaster probable master host