BUG 2185 : Follower should request forceInstallSnapshot in out-of-sync scenario 42/24742/7
authorMoiz Raja <moraja@cisco.com>
Tue, 4 Aug 2015 00:05:14 +0000 (17:05 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 2 Sep 2015 16:05:30 +0000 (16:05 +0000)
commit8c3896a99a221d3411f88f3a53c7d9fe6b89734e
tree861e9a75ef14c6163e024d7ea52c13c97d9b4c82
parent9baf6a2a5e494f70af407f04631980857a26daf9
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>
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