diff options
| -rw-r--r-- | cpp/src/qpid/ha/Backup.cpp | 1 | ||||
| -rw-r--r-- | cpp/src/qpid/ha/Primary.cpp | 9 | ||||
| -rwxr-xr-x | cpp/src/tests/ha_tests.py | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/qpid/ha/Backup.cpp b/cpp/src/qpid/ha/Backup.cpp index f133ecd5c6..2affc12bf6 100644 --- a/cpp/src/qpid/ha/Backup.cpp +++ b/cpp/src/qpid/ha/Backup.cpp @@ -89,6 +89,7 @@ void Backup::setBrokerUrl(const Url& brokers) { void Backup::stop(Mutex::ScopedLock&) { if (stopped) return; + stopped = true; QPID_LOG(debug, logPrefix << "Leaving backup role."); if (link) link->close(); if (replicator.get()) { diff --git a/cpp/src/qpid/ha/Primary.cpp b/cpp/src/qpid/ha/Primary.cpp index 12535399e3..67108fa5f9 100644 --- a/cpp/src/qpid/ha/Primary.cpp +++ b/cpp/src/qpid/ha/Primary.cpp @@ -245,14 +245,17 @@ void Primary::opened(broker::Connection& connection) { backup->setCatchupQueues(haBroker.getBroker().getQueues(), false); } backups[info.getSystemId()] = backup; + i = backups.find(info.getSystemId()); } else { QPID_LOG(info, logPrefix << "Known backup connected: " << info); i->second->setConnection(&connection); - checkReady(i, l); } - if (info.getStatus() == JOINING) info.setStatus(CATCHUP); - membership.add(info); + if (info.getStatus() == JOINING) { + info.setStatus(CATCHUP); + membership.add(info); + } + if (i != backups.end()) checkReady(i, l); } else QPID_LOG(debug, logPrefix << "Accepted client connection " diff --git a/cpp/src/tests/ha_tests.py b/cpp/src/tests/ha_tests.py index e517ce4527..3261e34085 100755 --- a/cpp/src/tests/ha_tests.py +++ b/cpp/src/tests/ha_tests.py @@ -464,8 +464,10 @@ class ReplicationTests(HaBrokerTest): def test_replicate_default(self): """Make sure we don't replicate if ha-replicate is unspecified or none""" cluster1 = HaCluster(self, 2, ha_replicate=None) + cluster1[1].wait_status("ready") c1 = cluster1[0].connect().session().sender("q;{create:always}") cluster2 = HaCluster(self, 2, ha_replicate="none") + cluster2[1].wait_status("ready") cluster2[0].connect().session().sender("q;{create:always}") time.sleep(.1) # Give replication a chance. try: |
