BUG 4213 : Candidate should switch to Follower when it receives AppendEntries from... 07/26107/1
authorMoiz Raja <moraja@cisco.com>
Thu, 27 Aug 2015 18:07:08 +0000 (11:07 -0700)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 27 Aug 2015 19:08:38 +0000 (19:08 +0000)
commit27966a20f38fa6771b56936137a3a857474a91ef
tree411ef2f3ccfbd0eaecc6724028ca0ac9ea1a9100
parentddd159be8011711adae09d964fcfbec60ea93fd9
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>
(cherry picked from commit 6b66fc7266ea909427b612da16a587936890b77b)
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