You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2017/12/01 05:36:08 UTC

kudu git commit: consensus: Make queue more debuggable

Repository: kudu
Updated Branches:
  refs/heads/master 9e506fcaf -> ded4305f2


consensus: Make queue more debuggable

After the introduction of SafeToEvict() logic in the consensus queue,
the eviction criteria has become more subtle. It would be helpful to get
more information about the state of the leader queue from the web UI to
aid in troubleshooting. This patch dumps the queue information in the
web UI and also includes the time since last communication with each
peer in the per-peer Watermarks table.

Change-Id: I052285a6885c251adbbab62410530fef4769fe72
Reviewed-on: http://gerrit.cloudera.org:8080/8708
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/ded4305f
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/ded4305f
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/ded4305f

Branch: refs/heads/master
Commit: ded4305f202209128ffb1681bc3255eb3745f2cf
Parents: 9e506fc
Author: Mike Percy <mp...@apache.org>
Authored: Thu Nov 30 19:05:21 2017 -0800
Committer: Mike Percy <mp...@apache.org>
Committed: Fri Dec 1 05:35:58 2017 +0000

----------------------------------------------------------------------
 src/kudu/consensus/consensus_queue.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/ded4305f/src/kudu/consensus/consensus_queue.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_queue.cc b/src/kudu/consensus/consensus_queue.cc
index 5fc968d..008b488 100644
--- a/src/kudu/consensus/consensus_queue.cc
+++ b/src/kudu/consensus/consensus_queue.cc
@@ -122,11 +122,12 @@ const char* PeerStatusToString(PeerStatus p) {
 
 std::string PeerMessageQueue::TrackedPeer::ToString() const {
   return Substitute("Peer: $0, Status: $1, Last received: $2, Next index: $3, "
-                    "Last known committed idx: $4",
+                    "Last known committed idx: $4, Time since last communication: $5",
                     uuid,
                     PeerStatusToString(last_exchange_status),
                     OpIdToString(last_received), next_index,
-                    last_known_committed_index);
+                    last_known_committed_index,
+                    (MonoTime::Now() - last_communication_time).ToString());
 }
 
 #define INSTANTIATE_METRIC(x) \
@@ -1159,6 +1160,7 @@ void PeerMessageQueue::DumpToHtml(std::ostream& out) const {
                       EscapeForHtmlToString(entry.second->ToString())) << endl;
   }
   out << "</table>" << endl;
+  out << "<p>" << queue_state_.ToString() << "</p>" << endl;
 
   log_cache_.DumpToHtml(out);
 }