Umeshkumar9414 commented on code in PR #5816:
URL: https://github.com/apache/hbase/pull/5816#discussion_r1618473493
##########
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 checked that it is only used in the `complete` method so we can make it as
a return from the `complete` method. (Thought of renaming the `complete` also
occurs but I don't have strong suggestions )
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]