BUG 2185 : Follower should request forceInstallSnapshot in out-of-sync scenario 11/26411/2
authorMoiz Raja <moraja@cisco.com>
Tue, 4 Aug 2015 00:05:14 +0000 (17:05 -0700)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 10 Sep 2015 14:40:23 +0000 (10:40 -0400)
commita93bcbe711f66ef6ec7bc97972f108859c87a11e
treee794b7dd3361da03430e284616df75600438852b
parent4bdeed4c20fbfc19486fe980caa80b510895b9db
BUG 2185 : Follower should request forceInstallSnapshot in out-of-sync scenario

When the Follower detects that it has more entries in it's log than the Leader
it might be an indication that the Follower was previously a Leader and therefore
it has additional entries in it's log which are missing in the Leader. When the
RaftPolicy is set to allow commits before consensus this could also mean that the
state now has more data than should be present in there. In this scenario Follower
requests the Leader to InstallSnapshot.

Change-Id: I517af148c3933f798ceb87ff88c77c396590881f
Signed-off-by: Moiz Raja <moraja@cisco.com>
(cherry picked from commit 8c3896a99a221d3411f88f3a53c7d9fe6b89734e)
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntriesReply.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java