Source:
<code>public ClearDeadServersResponse clearDeadServers(RpcController controller, ClearDeadServersRequest request) throws ServiceException { LOG.debug(master.getClientIdAuditPrefix() + " clear dead region servers."); ClearDeadServersResponse.Builder response = ClearDeadServersResponse.newBuilder(); try { master.checkInitialized(); if (master.cpHost != null) { master.cpHost.preClearDeadServers(); } if (master.getServerManager().areDeadServersInProgress()) { LOG.debug("Some dead server is still under processing, won't clear the dead server list"); response.addAllServerName(request.getServerNameList()); } else { DeadServer deadServer = master.getServerManager().getDeadServers(); Set<Address> clearedServers = new HashSet<>(); for (HBaseProtos.ServerName pbServer : request.getServerNameList()) { ServerName server = ProtobufUtil.toServerName(pbServer); <START> final boolean deadInProcess = master.getServerManager().isDeadServersInProgress(server); <END> if (!deadInProcess) { throw new RuntimeException(String.format("Dead server '%s' is not 'dead' in fact...", server)); } if (!deadServer.removeDeadServer(server)) { response.addServerName(pbServer); } else { clearedServers.add(server.getAddress()); } } master.getRSGroupInfoManager().removeServers(clearedServers); LOG.info("Remove decommissioned servers from RSGroup done", clearedServers); } if (master.cpHost != null) { master.cpHost.postClearDeadServers( ProtobufUtil.toServerNameList(request.getServerNameList()), ProtobufUtil.toServerNameList(response.getServerNameList())); } } catch (IOException io) { throw new ServiceException(io); } return response.build(); }</code><technical_language>this change</technical_language>

Target:
public ClearDeadServersResponse clearDeadServers(RpcController controller, ClearDeadServersRequest request) throws ServiceException { LOG.debug(master.getClientIdAuditPrefix() + " clear dead region servers."); ClearDeadServersResponse.Builder response = ClearDeadServersResponse.newBuilder(); try { master.checkInitialized(); if (master.cpHost != null) { master.cpHost.preClearDeadServers(); } if (master.getServerManager().areDeadServersInProgress()) { LOG.debug("Some dead server is still under processing, won't clear the dead server list"); response.addAllServerName(request.getServerNameList()); } else { DeadServer deadServer = master.getServerManager().getDeadServers(); Set<Address> clearedServers = new HashSet<>(); for (HBaseProtos.ServerName pbServer : request.getServerNameList()) { ServerName server = ProtobufUtil.toServerName(pbServer); final boolean deadInProcess = master.getProcedures().stream().anyMatch( p -> (p instanceof ServerCrashProcedure) && ((ServerCrashProcedure) p).getServerName().equals(server)); if (deadInProcess) { throw new ServiceException( String.format("Dead server '%s' is not 'dead' in fact...", server)); } if (!deadServer.removeDeadServer(server)) { response.addServerName(pbServer); } else { clearedServers.add(server.getAddress()); } } master.getRSGroupInfoManager().removeServers(clearedServers); LOG.info("Remove decommissioned servers from RSGroup done", clearedServers); } if (master.cpHost != null) { master.cpHost.postClearDeadServers( ProtobufUtil.toServerNameList(request.getServerNameList()), ProtobufUtil.toServerNameList(response.getServerNameList())); } } catch (IOException io) { throw new ServiceException(io); } return response.build(); }