diff options
Diffstat (limited to 'cpp/src/qpid/ha/Primary.cpp')
-rw-r--r-- | cpp/src/qpid/ha/Primary.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cpp/src/qpid/ha/Primary.cpp b/cpp/src/qpid/ha/Primary.cpp index 69c94bfc7d..e4bf9671b8 100644 --- a/cpp/src/qpid/ha/Primary.cpp +++ b/cpp/src/qpid/ha/Primary.cpp @@ -180,7 +180,7 @@ void Primary::readyReplica(const ReplicatingSubscription& rs) { void Primary::queueCreate(const QueuePtr& q) { // Throw if there is an invalid replication level in the queue settings. - haBroker.getReplicationTest().replicateLevel(q->getSettings()); + haBroker.getReplicationTest().replicateLevel(q->getSettings().storeSettings); Mutex::ScopedLock l(lock); for (BackupMap::iterator i = backups.begin(); i != backups.end(); ++i) { i->second->queueCreate(q); @@ -201,6 +201,7 @@ void Primary::opened(broker::Connection& connection) { Mutex::ScopedLock l(lock); BackupMap::iterator i = backups.find(info.getSystemId()); if (i == backups.end()) { + QPID_LOG(debug, logPrefix << "New backup connected: " << info); boost::shared_ptr<RemoteBackup> backup( new RemoteBackup(info, haBroker.getReplicationTest(), true)); { @@ -209,7 +210,6 @@ void Primary::opened(broker::Connection& connection) { backup->setInitialQueues(haBroker.getBroker().getQueues(), false); } backups[info.getSystemId()] = backup; - QPID_LOG(debug, logPrefix << "New backup connected: " << info); } else { QPID_LOG(debug, logPrefix << "Known backup connected: " << info); @@ -225,6 +225,12 @@ void Primary::opened(broker::Connection& connection) { } void Primary::closed(broker::Connection& connection) { + // NOTE: It is possible for a backup connection to be rejected while we are + // a backup, but closed() is called after we have become primary. + // + // For this reason we do not remove from the backups map here, the backups + // map holds all the backups we know about whether connected or not. + // Mutex::ScopedLock l(lock); BrokerInfo info; if (ha::ConnectionObserver::getBrokerInfo(connection, info)) { @@ -233,12 +239,6 @@ void Primary::closed(broker::Connection& connection) { BackupMap::iterator i = backups.find(info.getSystemId()); if (i != backups.end()) i->second->setConnected(false); } - // NOTE: we do not remove from the backups map here, the backups map holds - // all the backups we know about whether connected or not. - // - // It is possible for a backup connection to be rejected while we are a backup, - // but the closed is seen after we have become primary. Removing the entry - // from backups in this case would be incorrect. } |