public void upgrade(Set<ServerName> deadServersFromPE, Set<ServerName> liveServersBeforeRestart,
    Set<ServerName> splittingServersFromWALDir) throws KeeperException, IOException {
    LOG.info(
      "Upgrading RegionServerTracker to active master mode; {} have existing"
        + "ServerCrashProcedures, {} possibly 'live' servers, and {} 'splitting'.",
      deadServersFromPE.size(), liveServersBeforeRestart.size(), splittingServersFromWALDir.size());
    // deadServersFromPE is made from a list of outstanding ServerCrashProcedures.
    // splittingServersFromWALDir are being actively split -- the directory in the FS ends in
    // '-SPLITTING'. Each splitting server should have a corresponding SCP. Log if not.
    splittingServersFromWALDir.stream().filter(s -> !deadServersFromPE.contains(s))
      .forEach(s -> LOG.error("{} has no matching ServerCrashProcedure", s));
    // create ServerNode for all possible live servers from wal directory and master local region
    liveServersBeforeRestart
      .forEach(sn -> server.getAssignmentManager().getRegionStates().createServer(sn));
    ServerManager serverManager = server.getServerManager();
    synchronized (this) {
      Set<ServerName> liveServers = regionServers;
      for (ServerName serverName : liveServers) {
        RegionServerInfo info = getServerInfo(serverName);
        ServerMetrics serverMetrics = info != null
          ? ServerMetricsBuilder.of(serverName,
            VersionInfoUtil.getVersionNumber(info.getVersionInfo()),
            info.getVersionInfo().getVersion())
          : ServerMetricsBuilder.of(serverName);
        serverManager.checkAndRecordNewServer(serverName, serverMetrics);
      }
      serverManager.findDeadServersAndProcess(deadServersFromPE, liveServersBeforeRestart);
      active = true;
    }
  }
Upgrade to active master mode, where besides tracking the changes of region server set, we will
also started to add new region servers to ServerManager and also schedule SCP if a region
server dies. Starts the tracking of online RegionServers. All RSes will be tracked after this
method is called.
<p/>
In this method, we will also construct the region server sets in {@link ServerManager}. If a
region server is dead between the crash of the previous master instance and the start of the
current master instance, we will schedule a SCP for it. This is done in
{@link ServerManager#findDeadServersAndProcess(Set, Set)}, we call it here under the lock
protection to prevent concurrency issues with server expiration operation.
@param deadServersFromPE          the region servers which already have SCP associated.
@param liveServersBeforeRestart   the live region servers we recorded before master restarts.
@param splittingServersFromWALDir Servers whose WALs are being actively 'split'.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionServerTracker.java