summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-03-05 18:02:32 +0000
committerAlan Conway <aconway@apache.org>2010-03-05 18:02:32 +0000
commit1ef55029f73ba1d45104d6ac56a63ed3ff8104f1 (patch)
treead5ea8ae851b52ade042ac627c7dce0a9bd85d53 /cpp/src/qpid/cluster/Cluster.cpp
parent405c72eb55f745c6763c0261a70c476d72495c9d (diff)
downloadqpid-python-1ef55029f73ba1d45104d6ac56a63ed3ff8104f1.tar.gz
Don't generate debug snapshot messages unless debug logging enabled.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@919523 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 9da183a14d..08819542c2 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -673,15 +673,13 @@ struct AppendQueue {
// Log a snapshot of broker state, used for debugging inconsistency problems.
// May only be called in deliver thread.
-void Cluster::debugSnapshot(const char* prefix, Connection* connection) {
+std::string Cluster::debugSnapshot() {
assertClusterSafe();
std::ostringstream msg;
- msg << prefix;
- if (connection) msg << " " << connection->getId();
- msg << " snapshot " << map.getFrameSeq() << ":";
+ msg << "queue snapshot at " << map.getFrameSeq() << ":";
AppendQueue append(msg);
broker.getQueues().eachQueue(append);
- QPID_LOG(trace, msg.str());
+ return msg.str();
}
// Called from Broker::~Broker when broker is shut down. At this
@@ -767,8 +765,9 @@ void Cluster::updateOffer(const MemberId& updater, uint64_t updateeInt, Lock& l)
deliverEventQueue.start(); // Not involved in update.
}
if (updatee != self && url) {
- debugSnapshot("join");
+ QPID_LOG(debug, debugSnapshot());
if (mAgent) mAgent->clusterUpdate();
+ // Updatee will call clusterUpdate when update completes
}
}
@@ -841,7 +840,7 @@ void Cluster::checkUpdateIn(Lock& l) {
if (mAgent) mAgent->suppress(false); // Enable management output.
discarding = false; // ok to set, we're stalled for update.
QPID_LOG(notice, *this << " update complete, starting catch-up.");
- debugSnapshot("initial");
+ QPID_LOG(debug, debugSnapshot());
if (mAgent) mAgent->clusterUpdate();
deliverEventQueue.start();
}