Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public OMNotLeaderException(RaftPeerId currentPeerId,
this.leaderAddress = suggestedLeaderAddress;
}

public OMNotLeaderException(String msg) {
super(msg);
this.currentPeerId = null;
this.leaderPeerId = null;
this.leaderAddress = null;
}

public String getSuggestedLeaderNodeId() {
return leaderPeerId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import org.apache.ratis.protocol.ClientId;
import org.apache.ratis.protocol.SetConfigurationRequest;
import org.apache.ratis.protocol.exceptions.LeaderNotReadyException;
import org.apache.ratis.protocol.exceptions.LeaderSteppingDownException;
import org.apache.ratis.protocol.exceptions.NotLeaderException;
import org.apache.ratis.protocol.exceptions.StateMachineException;
import org.apache.ratis.protocol.Message;
Expand Down Expand Up @@ -495,6 +496,11 @@ private OMResponse createOmResponseImpl(OMRequest omRequest,
leaderNotReadyException.getMessage()));
}

LeaderSteppingDownException leaderSteppingDownException = reply.getLeaderSteppingDownException();
if (leaderSteppingDownException != null) {
throw new ServiceException(new OMNotLeaderException(leaderSteppingDownException.getMessage()));
}

StateMachineException stateMachineException =
reply.getStateMachineException();
if (stateMachineException != null) {
Expand Down