Bug 8206: Prevent decr follower next index beyong -1 80/54780/6
authorTom Pantelis <tompantelis@gmail.com>
Tue, 11 Apr 2017 13:39:49 +0000 (09:39 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 14 Apr 2017 17:12:48 +0000 (17:12 +0000)
commit29bebec0bb224893a163cb5df9336c37d41c350f
tree52796bf26f704e5f211527b9e64b1c82c012a258
parentc37f0338f7050ddd94cba369e38a59fa2b457cb3
Bug 8206: Prevent decr follower next index beyong -1

If a follower's next index is already -1, we shouldn't decrement it
further, ie -1 is the lowest allowed value. This can result in AbstractLeader
continuously decrementing and logging an info message while in the
process of sending an install snapshot.

member-3-shard-default-config (Leader): follower member-1-shard-default-config last log term 2 conflicts with the leader's 3 - dec next index to -2

Modified decrNextIndex to return a boolean if next index was decremented
which is checked  by AbstractLeader.

Change-Id: I29454d4e71a7f9128b3b47f6a4e3403615c2c8d2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImpl.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java