You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2023/01/12 13:05:10 UTC

[GitHub] [ratis] codings-dan opened a new pull request, #806: RATIS-1768. Fix stepDown command don't work issue

codings-dan opened a new pull request, #806:
URL: https://github.com/apache/ratis/pull/806

   see https://issues.apache.org/jira/browse/RATIS-1768
   


-- 
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-unsubscribe@ratis.apache.org

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


[GitHub] [ratis] codings-dan commented on pull request #806: RATIS-1768. Fix stepDown command don't work issue

Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #806:
URL: https://github.com/apache/ratis/pull/806#issuecomment-1381424964

   @szetszwo Thanks for reviewing the pull request, PTAL


-- 
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-unsubscribe@ratis.apache.org

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


[GitHub] [ratis] codings-dan commented on a diff in pull request #806: RATIS-1768. Fix stepDown command don't work issue

Posted by GitBox <gi...@apache.org>.
codings-dan commented on code in PR #806:
URL: https://github.com/apache/ratis/pull/806#discussion_r1069034153


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1177,7 +1177,8 @@ CompletableFuture<RaftClientReply> stepDownLeaderAsync(TransferLeadershipRequest
     assertGroup(request.getRequestorId(), request.getRaftGroupId());
 
     return role.getLeaderState().map(leader -> leader.submitStepDownRequestAsync(request))
-        .orElseGet(() -> CompletableFuture.completedFuture(newSuccessReply(request)));
+        .orElseGet(() -> CompletableFuture.completedFuture(newExceptionReply(
+            request, new NotLeaderException(getMemberId(), getRaftConf().getPeer(info.getLeaderId()), null))));

Review Comment:
   done



-- 
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-unsubscribe@ratis.apache.org

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


[GitHub] [ratis] szetszwo commented on a diff in pull request #806: RATIS-1768. Fix stepDown command don't work issue

Posted by GitBox <gi...@apache.org>.
szetszwo commented on code in PR #806:
URL: https://github.com/apache/ratis/pull/806#discussion_r1069003779


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1177,7 +1177,8 @@ CompletableFuture<RaftClientReply> stepDownLeaderAsync(TransferLeadershipRequest
     assertGroup(request.getRequestorId(), request.getRaftGroupId());
 
     return role.getLeaderState().map(leader -> leader.submitStepDownRequestAsync(request))
-        .orElseGet(() -> CompletableFuture.completedFuture(newSuccessReply(request)));
+        .orElseGet(() -> CompletableFuture.completedFuture(newExceptionReply(
+            request, new NotLeaderException(getMemberId(), getRaftConf().getPeer(info.getLeaderId()), null))));

Review Comment:
   Use `generateNotLeaderException()`, i.e.
   ```java
           .orElseGet(() -> CompletableFuture.completedFuture(newExceptionReply(request, generateNotLeaderException());
   ```
   



-- 
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-unsubscribe@ratis.apache.org

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


[GitHub] [ratis] szetszwo commented on a diff in pull request #806: RATIS-1768. Fix stepDown command don't work issue

Posted by GitBox <gi...@apache.org>.
szetszwo commented on code in PR #806:
URL: https://github.com/apache/ratis/pull/806#discussion_r1069003779


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1177,7 +1177,8 @@ CompletableFuture<RaftClientReply> stepDownLeaderAsync(TransferLeadershipRequest
     assertGroup(request.getRequestorId(), request.getRaftGroupId());
 
     return role.getLeaderState().map(leader -> leader.submitStepDownRequestAsync(request))
-        .orElseGet(() -> CompletableFuture.completedFuture(newSuccessReply(request)));
+        .orElseGet(() -> CompletableFuture.completedFuture(newExceptionReply(
+            request, new NotLeaderException(getMemberId(), getRaftConf().getPeer(info.getLeaderId()), null))));

Review Comment:
   Use `generateNotLeaderException()`, i.e.
   ```java
           .orElseGet(() -> CompletableFuture.completedFuture(newExceptionReply(request, generateNotLeaderException())));
   ```
   



-- 
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-unsubscribe@ratis.apache.org

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


[GitHub] [ratis] codings-dan merged pull request #806: RATIS-1768. Fix stepDown command don't work issue

Posted by GitBox <gi...@apache.org>.
codings-dan merged PR #806:
URL: https://github.com/apache/ratis/pull/806


-- 
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-unsubscribe@ratis.apache.org

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