You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Attila Doroszlai (Jira)" <ji...@apache.org> on 2019/11/20 12:48:00 UTC

[jira] [Comment Edited] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

    [ https://issues.apache.org/jira/browse/RATIS-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16978232#comment-16978232 ] 

Attila Doroszlai edited comment on RATIS-758 at 11/20/19 12:47 PM:
-------------------------------------------------------------------

It seems this can happen if {{LeaderElection#askForVotes}} returns without executing any iterations due to immediately changing to follower.  This leaves {{LeaderElection}} in {{RUNNING}} state after {{askForVotes}}, and results in the illegal transition in {{finally}}.


was (Author: adoroszlai):
It seems this can happen if {{LeaderElection#askForVotes}} returns without executing any iterations due to immediately changing to follower.  This leaves {{LeaderElection}} in {{RUNNING}} state.

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -------------------------------------------------------------
>
>                 Key: RATIS-758
>                 URL: https://issues.apache.org/jira/browse/RATIS-758
>             Project: Ratis
>          Issue Type: Bug
>          Components: server
>            Reporter: Attila Doroszlai
>            Assignee: Attila Doroszlai
>            Priority: Critical
>              Labels: ozone
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Observed the following illegal state transition (using Ratis 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from CANDIDATE to FOLLOWER at term 3 for recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" java.lang.IllegalStateException: ILLEGAL TRANSITION: In 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, RUNNING -> CLOSED
> 	at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
> 	at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
> 	at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
> 	at org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)