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


##########
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:
   > Can we just determine this by ourselves? If remoteError is null, then we 
are succeeded
   
   For the majority, this is the case but for some procedures like 
SnapshotVerifyProcedure (It also sets succ true in case of 
CorruptedSnapshotException {a DoNotRetryIOException}) and 
SplitWALRemoteProcedure (it also sets succ true in case of 
DoNotRetryIOException) have their logic to decide the succ flag. We can try to 
generalize these cases, but we need to think about other DoNotRetryIOException 
cases as well. 



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