Apache9 commented on code in PR #5816:
URL: https://github.com/apache/hbase/pull/5816#discussion_r1619031611


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerRemoteProcedure.java:
##########
@@ -80,17 +82,25 @@ public abstract class ServerRemoteProcedure extends 
Procedure<MasterProcedureEnv
   protected ServerName targetServer;
   protected boolean dispatched;
   protected boolean succ;
+  // after remoteProcedureDone we require error field to decide the next state
+  protected Throwable remoteError;
+  protected MasterProcedureProtos.ServerRemoteProcedureState state =
+    
MasterProcedureProtos.ServerRemoteProcedureState.SERVER_REMOTE_PROCEDURE_DISPATCH;
 
   protected abstract void complete(MasterProcedureEnv env, Throwable error);
 
   @Override
   protected synchronized Procedure<MasterProcedureEnv>[] 
execute(MasterProcedureEnv env)
     throws ProcedureYieldException, ProcedureSuspendedException, 
InterruptedException {
-    if (dispatched) {
+    if (
+      state != 
MasterProcedureProtos.ServerRemoteProcedureState.SERVER_REMOTE_PROCEDURE_DISPATCH
+    ) {
+      complete(env, this.remoteError);
       if (succ) {

Review Comment:
   I think making complete method return a boolean is a possible solution. 
Let's give it a try.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

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

Reply via email to