summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/ha/Primary.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-12-19 22:19:52 +0000
committerAlan Conway <aconway@apache.org>2012-12-19 22:19:52 +0000
commitdad6d3eaac2ddb87ae0071b868e59112b2d5325b (patch)
tree13536510244ffc9914b2ff7618cf2a346580a051 /qpid/cpp/src/qpid/ha/Primary.cpp
parentf58ea784ad1930c6b8bbf1b9a9e32bf3575c4bed (diff)
downloadqpid-python-dad6d3eaac2ddb87ae0071b868e59112b2d5325b.tar.gz
QPID-4516: Sporadic failure in ha_tests test_failover_send_receive
Sporadic failures in ha_tests.py test_failover_send_receive. Two types of failure observed: - core dumps in a debug build at a C++ assertion - python test assertion like: AssertionError: Broker<137:cluster0-0.log qpidd-157 :35273> expected='ready', actual='catchup' The following fixes were made to correct the problem: - Missing break statement in switch. - Remove unused function HaBroker::resetMembership - Abort connection of timed-out backups so they can attempt to reconnect. - New primary resets membership before allowing backups to connect. - Remove incorrect demotion ready->catchup on timeout. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1424169 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/ha/Primary.cpp')
-rw-r--r--qpid/cpp/src/qpid/ha/Primary.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/qpid/cpp/src/qpid/ha/Primary.cpp b/qpid/cpp/src/qpid/ha/Primary.cpp
index 6d5d68191b..40ae9ff07b 100644
--- a/qpid/cpp/src/qpid/ha/Primary.cpp
+++ b/qpid/cpp/src/qpid/ha/Primary.cpp
@@ -96,7 +96,7 @@ Primary::Primary(HaBroker& hb, const BrokerInfo::Set& expect) :
QPID_LOG(notice, logPrefix << "Promoted to primary. Expected backups: " << expect);
for (BrokerInfo::Set::const_iterator i = expect.begin(); i != expect.end(); ++i) {
boost::shared_ptr<RemoteBackup> backup(
- new RemoteBackup(*i, haBroker.getReplicationTest(), false));
+ new RemoteBackup(*i, haBroker.getReplicationTest(), 0));
backups[i->getSystemId()] = backup;
if (!backup->isReady()) expectedBackups.insert(backup);
backup->setCatchupQueues(hb.getBroker().getQueues(), true); // Create guards
@@ -161,9 +161,6 @@ void Primary::timeoutExpectedBackups() {
expectedBackups.erase(i++);
backups.erase(info.getSystemId());
rb->cancel();
- // Downgrade the broker to CATCHUP
- info.setStatus(CATCHUP);
- haBroker.addBroker(info);
}
else ++i;
}
@@ -228,7 +225,7 @@ void Primary::opened(broker::Connection& connection) {
if (i == backups.end()) {
QPID_LOG(info, logPrefix << "New backup connected: " << info);
boost::shared_ptr<RemoteBackup> backup(
- new RemoteBackup(info, haBroker.getReplicationTest(), true));
+ new RemoteBackup(info, haBroker.getReplicationTest(), &connection));
{
// Avoid deadlock with queue registry lock.
Mutex::ScopedUnlock u(lock);
@@ -238,7 +235,7 @@ void Primary::opened(broker::Connection& connection) {
}
else {
QPID_LOG(info, logPrefix << "Known backup connected: " << info);
- i->second->setConnected(true);
+ i->second->setConnection(&connection);
checkReady(i, l);
}
if (info.getStatus() == JOINING) info.setStatus(CATCHUP);