You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2013/09/18 23:13:27 UTC

svn commit: r1524570 - /qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp

Author: aconway
Date: Wed Sep 18 21:13:27 2013
New Revision: 1524570

URL: http://svn.apache.org/r1524570
Log:
NO-JIRA: HA Primary should not log messages for unreplicated queues and exchanges.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp?rev=1524570&r1=1524569&r2=1524570&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp Wed Sep 18 21:13:27 2013
@@ -245,10 +245,10 @@ void Primary::removeReplica(const Replic
 void Primary::queueCreate(const QueuePtr& q) {
     // Set replication argument.
     ReplicateLevel level = replicationTest.useLevel(*q);
-    QPID_LOG(debug, logPrefix << "Created queue " << q->getName()
-             << " replication: " << printable(level));
     q->addArgument(QPID_REPLICATE, printable(level).str());
     if (level) {
+        QPID_LOG(debug, logPrefix << "Created queue " << q->getName()
+                 << " replication: " << printable(level));
         initializeQueue(q);
         // Give each queue a unique id. Used by backups to avoid confusion of
         // same-named queues.
@@ -264,24 +264,26 @@ void Primary::queueCreate(const QueuePtr
 
 // NOTE: Called with queue registry lock held.
 void Primary::queueDestroy(const QueuePtr& q) {
-    QPID_LOG(debug, logPrefix << "Destroyed queue " << q->getName());
-    {
-        Mutex::ScopedLock l(lock);
-        for (BackupMap::iterator i = backups.begin(); i != backups.end(); ++i)
-            i->second->queueDestroy(q);
+    if (replicationTest.useLevel(*q)) {
+        QPID_LOG(debug, logPrefix << "Destroyed queue " << q->getName());
+        {
+            Mutex::ScopedLock l(lock);
+            for (BackupMap::iterator i = backups.begin(); i != backups.end(); ++i)
+                i->second->queueDestroy(q);
+        }
+        checkReady();               // Outside lock
     }
-    checkReady();               // Outside lock
 }
 
 // NOTE: Called with exchange registry lock held.
 void Primary::exchangeCreate(const ExchangePtr& ex) {
     ReplicateLevel level = replicationTest.useLevel(*ex);
-    QPID_LOG(debug, logPrefix << "Created exchange " << ex->getName()
-             << " replication: " << printable(level));
     FieldTable args = ex->getArgs();
     args.setString(QPID_REPLICATE, printable(level).str()); // Set replication arg.
     if (level) {
-        // Give each exchange a unique id to avoid confusion of same-named exchanges.
+        QPID_LOG(debug, logPrefix << "Created exchange " << ex->getName()
+                 << " replication: " << printable(level));
+         // Give each exchange a unique id to avoid confusion of same-named exchanges.
         args.set(QPID_HA_UUID, FieldTable::ValuePtr(new UuidValue(&Uuid(true)[0])));
     }
     ex->setArgs(args);
@@ -289,8 +291,10 @@ void Primary::exchangeCreate(const Excha
 
 // NOTE: Called with exchange registry lock held.
 void Primary::exchangeDestroy(const ExchangePtr& ex) {
-    QPID_LOG(debug, logPrefix << "Destroyed exchange " << ex->getName());
-    // Do nothing
+    if (replicationTest.useLevel(*ex)) {
+        QPID_LOG(debug, logPrefix << "Destroyed exchange " << ex->getName());
+        // Do nothing
+    }
  }
 
 // New backup connected



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org