Lost commit index when a snapshot is captured 21/83421/5
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:33 +0000 (00:10 +0000)
commitaad11d48fcace37e3365388f387e16fa67257a25
tree75e8a370e74042e3f7f9c0490bcb056ecb92bae5
parentc4b4b98f56ab1d9821edb737912632c2867ae783
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>
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