private synchronized void refresh() {
    List<String> names;
    final Span span = TraceUtil.createSpan("RegionServerTracker.refresh");
    try (final Scope ignored = span.makeCurrent()) {
      try {
        names = ZKUtil.listChildrenAndWatchForNewChildren(watcher, watcher.getZNodePaths().rsZNode);
      } catch (KeeperException e) {
        // here we need to abort as we failed to set watcher on the rs node which means that we can
        // not track the node deleted event any more.
        server.abort("Unexpected zk exception getting RS nodes", e);
        return;
      }
      Set<ServerName> newServers = CollectionUtils.isEmpty(names)
        ? Collections.emptySet()
        : names.stream().map(ServerName::parseServerName)
          .collect(Collectors.collectingAndThen(Collectors.toSet(), Collections::unmodifiableSet));
      if (active) {
        processAsActiveMaster(newServers);
      }
      this.regionServers = newServers;
      span.setStatus(StatusCode.OK);
    } finally {
      span.end();
    }
  }
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