Fix bug in ReplicatedLogImpl#removeFrom and use akka-persistence for removing entries 82/9182/4
authorMoiz Raja <moraja@cisco.com>
Sun, 20 Jul 2014 07:59:05 +0000 (00:59 -0700)
committerMoiz Raja <moraja@cisco.com>
Sat, 26 Jul 2014 22:47:28 +0000 (15:47 -0700)
commit3019650e87a3fc05f80e8f6359e01ca5f1c5f197
treefad9a97ad72a252c2b564275863b04bba7d35207
parent00570ac6512cdeea8d3c1da85e4a2e118a6f925c
Fix bug in ReplicatedLogImpl#removeFrom and use akka-persistence for removing entries

The way things were coded in removeFrom assumed that when a set of entries was deleted
from the persistent log the sequence number would be reset. This is most likely to not be
the case.

Switched to usage which is more appropriate for akka-persistence namely to persist
the operation to delete entries in the akka-persistence journal and on recovery take the
appropriate action.

Also since now we are using the akka-persistence journal purely for persistence we can safely
add other stuff to the journal and so I added UpdateElectionTerm also to the journal. This
takes care of persisting the election information in the same journal.

Change-Id: I34202535711660f19b4cdd9e71a7b55fde7433ce
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ElectionTerm.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ElectionTermImpl.java [deleted file]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLog.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.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/behaviors/Leader.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.