You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/11/17 09:12:00 UTC

[GitHub] [hbase] yuqi1129 commented on a change in pull request #2657: HBASE-25282 Remove processingServers in DeadServer as we can get this…

yuqi1129 commented on a change in pull request #2657:
URL: https://github.com/apache/hbase/pull/2657#discussion_r524994348



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
##########
@@ -2440,6 +2440,12 @@ public ClearDeadServersResponse clearDeadServers(RpcController controller,
         Set<Address> clearedServers = new HashSet<>();
         for (HBaseProtos.ServerName pbServer : request.getServerNameList()) {
           ServerName server = ProtobufUtil.toServerName(pbServer);
+          final boolean deadInProcess = master.getServerManager().isDeadServersInProgress(server);

Review comment:
       see 
   
   `  public synchronized boolean removeDeadServer(final ServerName deadServerName) {	  public synchronized boolean removeDeadServer(final ServerName deadServerName) {
       Preconditions.checkState(!processingServers.contains(deadServerName),	
         "Asked to remove server still in processingServers set " + deadServerName +	
             " (numProcessing=" + processingServers.size() + ")");	
       return this.deadServers.remove(deadServerName) != null;	    return this.deadServers.remove(deadServerName) != null;
     }`
    We need to check where region server with special server name is in processing, so i add such a method

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
##########
@@ -504,7 +506,21 @@ public DeadServer getDeadServers() {
    * @return true if any RS are being processed as dead, false if not
    */
   public boolean areDeadServersInProgress() {
-    return this.deadservers.areDeadServersInProgress();
+    try {
+      return master.getProcedures().stream().anyMatch(p -> p instanceof ServerCrashProcedure);
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  public boolean isDeadServersInProgress(ServerName serverName) {

Review comment:
       see above




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org