From f68bb96b236f92fb768438a2c9f315f89ce6a5db Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 30 Aug 2013 14:43:06 +0000 Subject: QPID-4327: HA clean up transaction artifacts at end of TX. - Backups delete transactions on failover. - TxReplicator cancel subscriptions when transaction is finished. - TxReplicator rollback if destroyed prematurely. - Handle special case of no backups for a tx. - ha_tests.py: new and modified tests to cover the new functionality. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1518982 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/ha/QueueReplicator.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cpp/src/qpid/ha/QueueReplicator.cpp') diff --git a/cpp/src/qpid/ha/QueueReplicator.cpp b/cpp/src/qpid/ha/QueueReplicator.cpp index ff32dfef16..b4bbb3a0c4 100644 --- a/cpp/src/qpid/ha/QueueReplicator.cpp +++ b/cpp/src/qpid/ha/QueueReplicator.cpp @@ -169,6 +169,11 @@ void QueueReplicator::activate() { boost::shared_ptr(new QueueObserver(shared_from_this()))); } +void QueueReplicator::disconnect() { + Mutex::ScopedLock l(lock); + sessionHandler = 0; +} + QueueReplicator::~QueueReplicator() {} // Called from Queue::destroyed() @@ -220,6 +225,14 @@ void QueueReplicator::initializeBridge(Bridge& bridge, SessionHandler& sessionHa QPID_LOG(trace, logPrefix << "Subscription arguments: " << arguments); } +void QueueReplicator::cancel(Mutex::ScopedLock&) { + if (sessionHandler) { + // Cancel the replicating subscription. + AMQP_ServerProxy peer(sessionHandler->out); + peer.getMessage().cancel(getName()); + } +} + namespace { template T decodeContent(Message& m) { std::string content = m.getContent(); -- cgit v1.2.1