summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-09-18 21:13:27 +0000
committerAlan Conway <aconway@apache.org>2013-09-18 21:13:27 +0000
commit012aba39d0204e3cd57dcf83e99d6d5bf9a0e74f (patch)
tree0584e6f8c0b679b7a08a17847b9d38bfc7fe54ea /qpid/cpp
parent064d92ad6372d5237edc06e8f6fb2345d6626746 (diff)
downloadqpid-python-012aba39d0204e3cd57dcf83e99d6d5bf9a0e74f.tar.gz
NO-JIRA: HA Primary should not log messages for unreplicated queues and exchanges.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1524570 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/ha/Primary.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/qpid/cpp/src/qpid/ha/Primary.cpp b/qpid/cpp/src/qpid/ha/Primary.cpp
index 606e6452d3..e7fdc5035f 100644
--- a/qpid/cpp/src/qpid/ha/Primary.cpp
+++ b/qpid/cpp/src/qpid/ha/Primary.cpp
@@ -245,10 +245,10 @@ void Primary::removeReplica(const ReplicatingSubscription& rs) {
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& q) {
// 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 ExchangePtr& ex) {
// 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