From 5a3a52607edfcb6854d2537302b4dda68a36f1b2 Mon Sep 17 00:00:00 2001 From: Moiz Raja Date: Fri, 20 Feb 2015 03:38:18 -0800 Subject: [PATCH] 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 --- .../controller/cluster/raft/behaviors/AbstractLeader.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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()) { -- 2.36.6