BUG 4213 : Candidate should switch to Follower when it receives AppendEntries from... 02/26102/2
authorMoiz Raja <moraja@cisco.com>
Thu, 27 Aug 2015 18:07:08 +0000 (11:07 -0700)
committerMoiz Raja <moraja@cisco.com>
Thu, 27 Aug 2015 18:13:50 +0000 (11:13 -0700)
commit6b66fc7266ea909427b612da16a587936890b77b
tree5ac67bcf4207087743556e41eb59a1accdeba048
parent69637da304599c6699e26d4b6cacff9c5925f9d5
BUG 4213 : Candidate should switch to Follower when it receives AppendEntries from new Leader

Multiple peers might become candidates in a single election term. If one peer happened
to become a Leader it will send AppendEntries to all it's peers. When a Candidate receives
an AppendEntries and finds its term to be the same as the AppendEntries term then it should
switch to Follower.

Change-Id: Ia4ce41d4f3eefed50297b90107ad7429bb950ad8
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehaviorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/CandidateTest.java