X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fbehaviors%2FPreLeader.java;h=6d2f429de278d2f3ad47d671c582847fc81e8320;hb=86e8e4a06b682aa772c834a2cef56d0596540e1b;hp=eab3f7d7da1d49feb57f71b801b4cbe6b4362d2a;hpb=8119659681a6814d257314178e759a6ef1b49766;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/PreLeader.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/PreLeader.java index eab3f7d7da..6d2f429de2 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/PreLeader.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/PreLeader.java @@ -22,6 +22,7 @@ import org.opendaylight.controller.cluster.raft.persisted.NoopPayload; * the log with the leader's current term. Once the no-op entry is committed, all prior entries are committed * indirectly. Once all entries are committed, ie commitIndex matches the last log index, it switches to the * normal Leader state. + * *

* The use of a no-op entry in this manner is outlined in the last paragraph in §8 of the * extended raft version. @@ -39,7 +40,9 @@ public class PreLeader extends AbstractLeader { @Override public RaftActorBehavior handleMessage(ActorRef sender, Object message) { if (message instanceof ApplyState) { - if(context.getLastApplied() >= context.getReplicatedLog().lastIndex()) { + log.debug("{}: Received {} - lastApplied: {}, lastIndex: {}", logName(), message, context.getLastApplied(), + context.getReplicatedLog().lastIndex()); + if (context.getLastApplied() >= context.getReplicatedLog().lastIndex()) { // We've applied all entries - we can switch to Leader. return internalSwitchBehavior(new Leader(context, this)); } else {