Merge "BUG 2676 : Add diagnostic message when AppendEntriesReply comes in very late"
authorTom Pantelis <tpanteli@brocade.com>
Fri, 20 Feb 2015 19:16:09 +0000 (19:16 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 20 Feb 2015 19:16:11 +0000 (19:16 +0000)
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java

index b2bb127eab525e35b5f7db5995e9bd57fcbe0746..66b8fba674161ddbc8f9f2e5a64154b62226c683 100644 (file)
@@ -171,6 +171,14 @@ public abstract class AbstractLeader extends AbstractRaftActorBehavior {
             return this;
         }
 
+        if(followerLogInformation.timeSinceLastActivity() >
+                context.getConfigParams().getElectionTimeOutInterval().toMillis()) {
+            LOG.error("{} : handleAppendEntriesReply delayed beyond election timeout, " +
+                            "appendEntriesReply : {}, timeSinceLastActivity : {}, lastApplied : {}, commitIndex : {}",
+                    logName(), appendEntriesReply, followerLogInformation.timeSinceLastActivity(),
+                    context.getLastApplied(), context.getCommitIndex());
+        }
+
         followerLogInformation.markFollowerActive();
 
         if (appendEntriesReply.isSuccess()) {