private void checkRejectableDecommissionedStatus(ServerName sn)
    throws DecommissionedHostRejectedException {
    LOG.info("Checking decommissioned status of RegionServer {}", sn.getServerName());

    // If the Master is not configured to reject decommissioned hosts, return early.
    if (!rejectDecommissionedHostsConfig) {
      return;
    }

    // Look for a match for the hostname in the list of decommissioned servers
    for (ServerName server : getDrainingServersList()) {
      if (Objects.equals(server.getHostname(), sn.getHostname())) {
        // Found a match and master is configured to reject decommissioned hosts, throw exception!
        LOG.warn(
          "Rejecting RegionServer {} from reporting for duty because Master is configured "
            + "to reject decommissioned hosts and this host was marked as such in the past.",
          sn.getServerName());
        throw new DecommissionedHostRejectedException(String.format(
          "Host %s exists in the list of decommissioned servers and Master is configured to "
            + "reject decommissioned hosts",
          sn.getHostname()));
      }
    }
  }
Checks if the Master is configured to reject decommissioned hosts or not. When it's configured
to do so, any RegionServer trying to join the cluster will have it's host checked against the
list of hosts of currently decommissioned servers and potentially get prevented from reporting
for duty; otherwise, we do nothing and we let them pass to the next check. See HBASE-28342 for
details.
@param sn The ServerName to check for
@throws DecommissionedHostRejectedException if the Master is configured to reject
                                            decommissioned hosts and this host exists in the
                                            list of the decommissioned servers
hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java