Bug 3570: Persist snapshot on follower ApplySnapshot
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / test / java / org / opendaylight / controller / cluster / raft / MockRaftActor.java
index d72d40416f3b3288a1b3f2b1aaa97f48c473af82..c1aa75a12de5028331a818b7c4fb6a9c5a426b38 100644 (file)
@@ -202,6 +202,10 @@ public class MockRaftActor extends RaftActor implements RaftActorRecoveryCohort,
     @Override
     public void applyRecoverySnapshot(byte[] bytes) {
         recoveryCohortDelegate.applyRecoverySnapshot(bytes);
+        applySnapshotBytes(bytes);
+    }
+
+    private void applySnapshotBytes(byte[] bytes) {
         try {
             Object data = toObject(bytes);
             if (data instanceof List) {
@@ -222,6 +226,7 @@ public class MockRaftActor extends RaftActor implements RaftActorRecoveryCohort,
     public void applySnapshot(byte [] snapshot) {
         LOG.info("{}: applySnapshot called", persistenceId());
         snapshotCohortDelegate.applySnapshot(snapshot);
+        applySnapshotBytes(snapshot);
     }
 
     @Override