Lost commit index when a snapshot is captured 91/84491/2
authorTomas Cere <tomas.cere@pantheon.tech>
Tue, 6 Aug 2019 11:46:32 +0000 (13:46 +0200)
committerRobert Varga <nite@hq.sk>
Sun, 22 Sep 2019 03:12:01 +0000 (03:12 +0000)
commit887d45367bdb53b3e817bcecd9a13333b8bb777d
tree4b588c3f40275a69aabb8011c7779acd8fee08ae
parent1032f539c0d097facb01ed12f2d6716079d5d476
Lost commit index when a snapshot is captured

When we have no journals and a snapshot is recovered and
immediately captured again, if there was no movement in the
datastore we loose the lastIndex and term from the previous snapshot.
We can safely reuse these from the previous snapshot when no
entry is present in the ReplicatedLog.

Change-Id: Iaeb71edc7ec865bec18dbcb436af76e592eea69d
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit aad11d48fcace37e3365388f387e16fa67257a25)
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java