summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/ha/Primary.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-08-01 20:27:39 +0000
committerAlan Conway <aconway@apache.org>2013-08-01 20:27:39 +0000
commit112503593af21b7b06522195404c68fd4e5d4861 (patch)
treed5bcef3dc971792fd675b447d20eb0ae123dadfc /cpp/src/qpid/ha/Primary.cpp
parente6598e9f95d55b80f96dbcb1e12bc1fc38c66af1 (diff)
downloadqpid-python-112503593af21b7b06522195404c68fd4e5d4861.tar.gz
QPID-4327: HA TX transactions, blocking wait for prepare
Backups send prepare messages to primary, primary delays completion of prepare till all are prepared (or there is a failure). This is NOT the production solution - blocking could cause a deadlock. We need to introduce asynchronous completion of prepare without blocking. This interim solution allows testing on other aspects of TX support. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1509424 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/ha/Primary.cpp')
-rw-r--r--cpp/src/qpid/ha/Primary.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/qpid/ha/Primary.cpp b/cpp/src/qpid/ha/Primary.cpp
index 5fd7814d62..4208147ff4 100644
--- a/cpp/src/qpid/ha/Primary.cpp
+++ b/cpp/src/qpid/ha/Primary.cpp
@@ -390,12 +390,16 @@ void Primary::setCatchupQueues(const RemoteBackupPtr& backup, bool createGuards)
void Primary::startTx(const boost::shared_ptr<broker::TxBuffer>& tx) {
QPID_LOG(trace, logPrefix << "Started TX transaction");
- tx->setObserver(make_shared<PrimaryTxObserver>(boost::ref(haBroker)));
+ shared_ptr<PrimaryTxObserver> observer(new PrimaryTxObserver(haBroker));
+ observer->initialize();
+ tx->setObserver(observer);
}
void Primary::startDtx(const boost::shared_ptr<broker::DtxBuffer>& dtx) {
QPID_LOG(trace, logPrefix << "Started DTX transaction");
- dtx->setObserver(make_shared<PrimaryTxObserver>(boost::ref(haBroker)));
+ shared_ptr<PrimaryTxObserver> observer(new PrimaryTxObserver(haBroker));
+ observer->initialize();
+ dtx->setObserver(observer);
}
}} // namespace qpid::ha