Lost commit index when a snapshot is captured 92/84492/1
authorTomas Cere <tomas.cere@pantheon.tech>
Tue, 6 Aug 2019 11:46:32 +0000 (13:46 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 16 Sep 2019 00:10:59 +0000 (00:10 +0000)
commit37f3f49ce7976bed1b1a38a1c00f505e82f7c226
tree0f45c719ad5edb2ef4e56f9a4c3dbf68db194742
parentd8afef2ec2a5dc9d61747d04d200c015598165eb
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