Skip to content
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

RATIS-2060 Avoid unexpected shutdown of RaftServerProxy during membership change #1069

Merged
merged 2 commits into from Apr 25, 2024

Conversation

OneSizeFitsQuorum
Copy link
Contributor

see jira

Signed-off-by: OneSizeFitQuorum <tanxinyu@apache.org>
@OneSizeFitsQuorum
Copy link
Contributor Author

@szetszwo PTAL

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OneSizeFitsQuorum , thanks for working on this! You are right that it should shutdown the division instead of the proxy.

Comment on lines 335 to 338
server.close();
return false;
case SHUTDOWN:
server.getRaftServer().close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let change it for both case.

+++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderElection.java
@@ -333,7 +333,7 @@ class LeaderElection implements Runnable {
           return true;
         case NOT_IN_CONF:
         case SHUTDOWN:
-          server.getRaftServer().close();
+          server.close();
           server.getStateMachine().event().notifyServerShutdown(server.getRoleInfoProto());
           return false;
         case TIMEOUT:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed~

Signed-off-by: OneSizeFitQuorum <tanxinyu@apache.org>
Copy link
Member

@SzyWilliam SzyWilliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the changes look good to me.
Thanks @OneSizeFitsQuorum for the patch!
Thanks @szetszwo for reviewing the patch!

@SzyWilliam SzyWilliam merged commit 7f1b1b6 into apache:master Apr 25, 2024
10 checks passed
@OneSizeFitsQuorum OneSizeFitsQuorum deleted the jira2060 branch April 25, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants