[ https://issues.apache.org/jira/browse/RATIS-698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16948904#comment-16948904 ]
Lokesh Jain edited comment on RATIS-698 at 10/10/19 7:54 PM: ------------------------------------------------------------- I think this is causing test failures in TestRaftAsyncWithGrpc#testBasicAppendEntriesAsync and other tests. If the initial minTimeout is 0 then the server can trigger a leader election much more frequently because the heartbeat interval is still at minTimeoutMs/2? {code:java} 2019-10-11 00:45:47,813 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:21ms, electionTimeout:17ms 2019-10-11 00:45:47,870 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:35ms, electionTimeout:31ms 2019-10-11 00:45:47,933 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:51ms, electionTimeout:51ms 2019-10-11 00:45:47,969 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:22ms, electionTimeout:21ms {code} was (Author: ljain): I think this is causing test failures in TestRaftAsyncWithGrpc#testBasicAppendEntriesAsync and other tests. If the initial minTimeout is 0 then the server can trigger a leader election much more frequently because the heartbeat interval is still at minTimeoutMs/2. {code:java} 2019-10-11 00:45:47,813 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:21ms, electionTimeout:17ms 2019-10-11 00:45:47,870 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:35ms, electionTimeout:31ms 2019-10-11 00:45:47,933 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:51ms, electionTimeout:51ms 2019-10-11 00:45:47,969 INFO impl.FollowerState (FollowerState.java:run(108)) - s0@group-C51B0F2AC202-FollowerState: change to CANDIDATE, lastRpcTime:22ms, electionTimeout:21ms {code} > RaftServerImpl should not enforce minTimeout before first leaderElection cycle > ------------------------------------------------------------------------------ > > Key: RATIS-698 > URL: https://issues.apache.org/jira/browse/RATIS-698 > Project: Ratis > Issue Type: Improvement > Components: server > Affects Versions: 0.4.0 > Reporter: Siddharth Wagle > Assignee: Siddharth Wagle > Priority: Major > Fix For: 0.5.0 > > Attachments: RATIS-698.01.patch, RATIS-698.02.patch, > RATIS-698.03.patch, RATIS-698.04.patch > > > Followers always wait for (minTimeoutMillis + randomWait), before initiating > leader election. This penalizes the first time the ratis ring is created or > when server restarts by enforcing a wait for leader election term. -- This message was sent by Atlassian Jira (v8.3.4#803005)