From ba29e21a0cd2a14a9efb1cff226e50d0e6fdf618 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Fri, 23 Dec 2016 14:09:01 +0100 Subject: [PATCH 1/3] Improve a debug message. --- arangod/Agency/AgentCallback.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/arangod/Agency/AgentCallback.cpp b/arangod/Agency/AgentCallback.cpp index b98a8f0f14..eb09cad9cb 100644 --- a/arangod/Agency/AgentCallback.cpp +++ b/arangod/Agency/AgentCallback.cpp @@ -42,15 +42,19 @@ bool AgentCallback::operator()(arangodb::ClusterCommResult* res) { if (_agent) { _agent->reportIn(_slaveID, _last); } - LOG_TOPIC(DEBUG, Logger::AGENCY) << "comm_status(" << res->status - << "), last(" << _last << "), follower(" - << _slaveID << "), time(" - << TRI_microtime() - _startTime << ")"; + LOG_TOPIC(DEBUG, Logger::AGENCY) + << "Got good callback from AppendEntriesRPC: " + << "comm_status(" << res->status + << "), last(" << _last << "), follower(" + << _slaveID << "), time(" + << TRI_microtime() - _startTime << ")"; } else { - LOG_TOPIC(DEBUG, Logger::AGENCY) << "comm_status(" << res->status - << "), last(" << _last << "), follower(" - << _slaveID << "), time(" - << TRI_microtime() - _startTime << ")"; + LOG_TOPIC(DEBUG, Logger::AGENCY) + << "Got callback from AppendEntriesRPC: " + << "comm_status(" << res->status + << "), last(" << _last << "), follower(" + << _slaveID << "), time(" + << TRI_microtime() - _startTime << ")"; } return true; } From 2b26224c95165c325c002a8eafe736c3f3197163 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Fri, 23 Dec 2016 14:15:48 +0100 Subject: [PATCH 2/3] Adding _term to log message. --- arangod/Agency/Constituent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arangod/Agency/Constituent.cpp b/arangod/Agency/Constituent.cpp index cb2ef5877c..e32a56b696 100644 --- a/arangod/Agency/Constituent.cpp +++ b/arangod/Agency/Constituent.cpp @@ -345,7 +345,8 @@ bool Constituent::vote(term_t termOfPeer, std::string id, index_t prevLogIndex, if (prevLogTerm > myLastLogEntry.term || (prevLogTerm == myLastLogEntry.term && prevLogIndex >= myLastLogEntry.index)) { - LOG_TOPIC(DEBUG, Logger::AGENCY) << "voting for " << id; + LOG_TOPIC(DEBUG, Logger::AGENCY) << "voting for " << id << " in term " + << _term; _cast = true; _votedFor = id; return true; From fc52c04bf49c1dda4dbe55af27053c85ddfefb04 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Fri, 23 Dec 2016 14:25:03 +0100 Subject: [PATCH 3/3] Improve debug messages in Agency. --- arangod/Agency/AgentCallback.cpp | 2 +- arangod/Agency/Constituent.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arangod/Agency/AgentCallback.cpp b/arangod/Agency/AgentCallback.cpp index eb09cad9cb..1216656577 100644 --- a/arangod/Agency/AgentCallback.cpp +++ b/arangod/Agency/AgentCallback.cpp @@ -50,7 +50,7 @@ bool AgentCallback::operator()(arangodb::ClusterCommResult* res) { << TRI_microtime() - _startTime << ")"; } else { LOG_TOPIC(DEBUG, Logger::AGENCY) - << "Got callback from AppendEntriesRPC: " + << "Got bad callback from AppendEntriesRPC: " << "comm_status(" << res->status << "), last(" << _last << "), follower(" << _slaveID << "), time(" diff --git a/arangod/Agency/Constituent.cpp b/arangod/Agency/Constituent.cpp index e32a56b696..e1d2c2ac36 100644 --- a/arangod/Agency/Constituent.cpp +++ b/arangod/Agency/Constituent.cpp @@ -112,8 +112,8 @@ void Constituent::termNoLock(term_t t) { _term = t; if (tmp != t) { - LOG_TOPIC(DEBUG, Logger::AGENCY) << _id << ": " << roleStr[_role] - << " term " << t; + LOG_TOPIC(DEBUG, Logger::AGENCY) << _id << ": changing term, current role:" + << roleStr[_role] << " new term " << t; _cast = false; Builder body;