Fix sporadic failures in ClusterAdminRpcServiceTest
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActor.java
index 2bd75923d9a06c24a34f506ab2b4574263ab6f0a..aea1e9fad427a114ec99cd884de7c3c8c80dd7e0 100644 (file)
@@ -612,10 +612,11 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
             RaftActorBehavior behavior = currentBehavior.getDelegate();
             if(behavior instanceof Follower) {
                 String previousLeaderId = ((Follower)behavior).getLeaderId();
+                short previousLeaderPayloadVersion = behavior.getLeaderPayloadVersion();
 
                 LOG.debug("{}: Re-initializing to Follower with previous leaderId {}", persistenceId(), previousLeaderId);
 
-                changeCurrentBehavior(new Follower(context, previousLeaderId));
+                changeCurrentBehavior(new Follower(context, previousLeaderId, previousLeaderPayloadVersion));
             } else {
                 initializeBehavior();
             }