From: Moiz Raja Date: Fri, 20 Feb 2015 11:38:18 +0000 (-0800) Subject: BUG 2676 : Add diagnostic message when AppendEntriesReply comes in very late X-Git-Tag: release/lithium~529^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=5a3a52607edfcb6854d2537302b4dda68a36f1b2 BUG 2676 : Add diagnostic message when AppendEntriesReply comes in very late Log an error message when an AppendEntriesReply arrives beyond the ElectionTimeout period. This may help detect cases where messages are not being processed fast enough by the actor system. This particular condition can cause a Leader to become an IsolatedLeader even if the remote Follower is receiving heartbeats. Change-Id: Id6a797820b63cb4f18c3d1bbd2781e72674aa9d8 Signed-off-by: Moiz Raja --- diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java index b2bb127eab..66b8fba674 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java @@ -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()) {