Bug-2692:Real snapshots should use the replicatedToAllIndex for clearing in-mem log 31/15131/12
authorKamal Rameshan <kramesha@cisco.com>
Wed, 11 Feb 2015 07:24:55 +0000 (23:24 -0800)
committerKamal Rameshan <kramesha@cisco.com>
Tue, 17 Feb 2015 20:17:01 +0000 (12:17 -0800)
commit6bfcbfc5158130c4255b861cb02dfaa68c52aa63
treeff200ffa668b04cee186fed1bf18062b5ece6f9f
parent766613c8c5cbfe2e790e6d7b4531227899e84f2c
Bug-2692:Real snapshots should use the replicatedToAllIndex for clearing in-mem log

Similar to fake snapshots, real snapshots should also be using the replicatedToAllIndex.

replicatedToAllIndex is part of the RaftActorBehavior.

A performSnapshotWithoutCapture helper method is part of the AbstractRaftActorBehavior.

On CaptureSnapshotReply, we clear the log based on replicatedToAllIndex and the corresponding term.

Many of the existing tests seem to test out this changes and some were added and enhanced.

Bug-2715: Fix in-mem log cleanup for an Inactive follower

In case if one of the follower is down, rely on the memory usage to clear the log.

This is done in CaptureSnapshotReply

Change-Id: Ifb3ca19691f20735e3f84b968a7adf01398c20e0
Signed-off-by: Kamal Rameshan <kramesha@cisco.com>
12 files changed:
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImpl.java
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/base/messages/CaptureSnapshot.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/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/Follower.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/AbstractReplicatedLogImplTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehaviorTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.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.