Bug 6540: EOS - Rework behavior of onPeerDown
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / behaviors / Candidate.java
index 52ed26758ee26b6f9949fa1202f1a44628b82364..176704f3d377323a962d5a171cfe53c84beb494e 100644 (file)
@@ -115,8 +115,8 @@ public class Candidate extends AbstractRaftActorBehavior {
         }
 
         if (voteCount >= votesRequired) {
-            if(context.getCommitIndex() < context.getReplicatedLog().lastIndex()) {
-                LOG.debug("{}: Connmit index {} is behind last index {}", logName(), context.getCommitIndex(),
+            if(context.getLastApplied() < context.getReplicatedLog().lastIndex()) {
+                LOG.debug("{}: LastApplied index {} is behind last index {}", logName(), context.getLastApplied(),
                         context.getReplicatedLog().lastIndex());
                 return internalSwitchBehavior(RaftState.PreLeader);
             } else {