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

Lokesh Jain commented on RATIS-201:
-----------------------------------

I saw the IllegalStateException when I was working on TestRaftAsyncWithGrpc. 
The error was thrown by RaftBasicTests#testWithLoad:349. The possible reason is 
that there is a background task running which restarted the leader and 
meanwhile getLeader could be called by testWithLoad which could lead to the 
error. I haven't seen the error now though.
I have added a patch with the corresponding change.

> MiniRaftCluster#getLeader may incorrectly throw IllegalStateException
> ---------------------------------------------------------------------
>
>                 Key: RATIS-201
>                 URL: https://issues.apache.org/jira/browse/RATIS-201
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: Lokesh Jain
>            Assignee: Lokesh Jain
>            Priority: Major
>         Attachments: RATIS-201.001.patch, RATIS-201.002.patch
>
>
> It can be possible for more than one server to have their role set as LEADER 
> in a ratis ring. There can be a race condition where term of a follower is 
> updated but its role is not yet updated to FOLLOWER. In such a scenario 
> MiniRaftCluster#getLeader would throw IllegalStateException.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to