-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-1441. Remove usage of getRetryFailureException. (swagle) #745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the patch Siddharth. RaftClientReply sends a status "isSuccess" and correspondingly have StateMachineException, NotReplicatedException and StateMachineException embedded. We can add some handling like this :
@@ -303,22 +311,18 @@ public XceiverClientReply sendCommandAsync(
Time.monotonicNowNanos() - requestTime);
}).thenApply(reply -> {
try {
- // we need to handle RaftRetryFailure Exception
- RaftRetryFailureException raftRetryFailureException =
- reply.getRetryFailureException();
- if (raftRetryFailureException != null) {
- // in case of raft retry failure, the raft client is
- // not able to connect to the leader hence the pipeline
- // can not be used but this instance of RaftClient will close
- // and refreshed again. In case the client cannot connect to
- // leader, getClient call will fail.
-
- // No need to set the failed Server ID here. Ozone client
- // will directly exclude this pipeline in next allocate block
- // to SCM as in this case, it is the raft client which is not
- // able to connect to leader in the pipeline, though the
- // pipeline can still be functional.
- throw new CompletionException(raftRetryFailureException);
+ Preconditions.checkNotNull(reply);
+ if (!reply.isSuccess()) {
+ IOException exception = null;
+ if (reply.getNotLeaderException() != null) {
+ exception = reply.getNotLeaderException();
+ } else if (reply.getNotReplicatedException() != null) {
+ exception = reply.getNotReplicatedException();
+ } else if (reply.getStateMachineException() != null) {
+ exception = reply.getStateMachineException();
+ }
+ Preconditions.checkNotNull(exception);
+ throw new CompletionException(exception);
}
ContainerCommandResponseProto response =
ContainerCommandResponseProto
💔 -1 overall
This message was automatically generated. |
Thanks, @bshashikant for your review comments. Updated the patch with suggested changes. Although, wouldn't it be better to have a generic exception class in Ratis that can have derived classes on the server side? It would allow separation of concerns for server and client vs now any new type exception will break the client side code in at runtime. Its not like we are doing anything with the exception, only wrapping it up. |
I just verified that with Ratis-518, the exception field in RaftClientReply is already exposed. We can just wrap the exception inside RaftClientReply to completionException instead of checking for any specific exceptions. To acheive this, Ratis version needs to be updated inside Ozone. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
/retest |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
/retest |
💔 -1 overall
This message was automatically generated. |
Thanks @swagle for working on this. Patch looks good to me. I will e rep-triggering the tests to see it comes clean. |
/retest |
💔 -1 overall
This message was automatically generated. |
/retest |
💔 -1 overall
This message was automatically generated. |
@swagle , i think the ratis snapshot version is incorrect as it leads to compilation failure. There are some more critical issues in Ratis which need to e addressed before we create a new snapshot and update the same in Ozone. Let's wait for the required fixes to go in Ratis and then update here. |
Changes included in HDDS-1555: #846 |
Author: Jagadish <[email protected]> Reviewers: Jagadish<[email protected]> Closes apache#745 from vjagadish1989/website-reorg20
No description provided.