summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-08-01 20:56:29 +0000
committerAlan Conway <aconway@apache.org>2013-08-01 20:56:29 +0000
commit9963e6fed203515ab3be76fa0e7eebeb63f78583 (patch)
tree5f76adbe5bbcecbf3002f519d9e400aa16f843a4
parent882f6f224ccca9b674de2fb2dae26d439a713b2b (diff)
downloadqpid-python-9963e6fed203515ab3be76fa0e7eebeb63f78583.tar.gz
QPID-4327: HA logging fixes.
- Removed "FIXME" log statements inadvertently left in code. - Changed some trace statements to debug to faclilitate debugging. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1509428 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/ha/Primary.cpp4
-rw-r--r--cpp/src/qpid/ha/PrimaryTxObserver.cpp16
-rw-r--r--cpp/src/qpid/ha/TxReplicator.cpp12
3 files changed, 13 insertions, 19 deletions
diff --git a/cpp/src/qpid/ha/Primary.cpp b/cpp/src/qpid/ha/Primary.cpp
index 4208147ff4..d67761a625 100644
--- a/cpp/src/qpid/ha/Primary.cpp
+++ b/cpp/src/qpid/ha/Primary.cpp
@@ -389,14 +389,14 @@ 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");
+ QPID_LOG(debug, logPrefix << "Started TX transaction");
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");
+ QPID_LOG(debug, logPrefix << "Started DTX transaction");
shared_ptr<PrimaryTxObserver> observer(new PrimaryTxObserver(haBroker));
observer->initialize();
dtx->setObserver(observer);
diff --git a/cpp/src/qpid/ha/PrimaryTxObserver.cpp b/cpp/src/qpid/ha/PrimaryTxObserver.cpp
index f400dbf99d..b63a40234e 100644
--- a/cpp/src/qpid/ha/PrimaryTxObserver.cpp
+++ b/cpp/src/qpid/ha/PrimaryTxObserver.cpp
@@ -91,7 +91,7 @@ PrimaryTxObserver::PrimaryTxObserver(HaBroker& hb) :
BrokerInfo::Set infoSet(haBroker.getMembership().otherBackups());
transform(infoSet.begin(), infoSet.end(), inserter(backups, backups.begin()),
bind(&BrokerInfo::getSystemId, _1));
- QPID_LOG(trace, logPrefix << "Started on " << backups);
+ QPID_LOG(debug, logPrefix << "Started on " << backups);
pair<shared_ptr<Queue>, bool> result =
broker.getQueues().declare(
@@ -108,7 +108,7 @@ void PrimaryTxObserver::initialize() {
void PrimaryTxObserver::enqueue(const QueuePtr& q, const broker::Message& m)
{
sys::Mutex::ScopedLock l(lock);
- QPID_LOG(trace, logPrefix << "enqueue: " << LogMessageId(*q, m));
+ QPID_LOG(trace, logPrefix << "Enqueue: " << LogMessageId(*q, m));
enqueues[q] += m.getReplicationId();
txQueue->deliver(TxEnqueueEvent(q->getName(), m.getReplicationId()).message());
txQueue->deliver(m);
@@ -118,7 +118,7 @@ void PrimaryTxObserver::dequeue(
const QueuePtr& q, QueuePosition pos, ReplicationId id)
{
sys::Mutex::ScopedLock l(lock);
- QPID_LOG(trace, logPrefix << "dequeue: " << LogMessageId(*q, pos, id));
+ QPID_LOG(trace, logPrefix << "Dequeue: " << LogMessageId(*q, pos, id));
txQueue->deliver(TxDequeueEvent(q->getName(), id).message());
}
@@ -134,7 +134,7 @@ void PrimaryTxObserver::deduplicate(sys::Mutex::ScopedLock&) {
bool PrimaryTxObserver::prepare() {
sys::Mutex::ScopedLock l(lock);
// FIXME aconway 2013-07-23: WRONG blocking. Need async completion.
- QPID_LOG(trace, logPrefix << "Prepare");
+ QPID_LOG(debug, logPrefix << "Prepare");
deduplicate(l);
txQueue->deliver(TxPrepareEvent().message());
while (!isPrepared(l)) lock.wait();
@@ -143,22 +143,20 @@ bool PrimaryTxObserver::prepare() {
void PrimaryTxObserver::commit() {
sys::Mutex::ScopedLock l(lock);
- QPID_LOG(trace, logPrefix << "Commit");
+ QPID_LOG(debug, logPrefix << "Commit");
txQueue->deliver(TxCommitEvent().message());
}
void PrimaryTxObserver::rollback() {
sys::Mutex::ScopedLock l(lock);
- QPID_LOG(trace, logPrefix << "Rollback");
+ QPID_LOG(debug, logPrefix << "Rollback");
txQueue->deliver(TxRollbackEvent().message());
}
void PrimaryTxObserver::txPrepareOkEvent(const string& data) {
- QPID_LOG(critical, logPrefix << "FIXME data: " << data);
sys::Mutex::ScopedLock l(lock);
types::Uuid backup = decodeStr<TxPrepareOkEvent>(data).broker;
- QPID_LOG(critical, logPrefix << "FIXME backup: " << backup);
- QPID_LOG(trace, logPrefix << "Backup prepared ok: " << backup);
+ QPID_LOG(debug, logPrefix << "Backup prepared ok: " << backup);
prepared.insert(backup);
lock.notify();
}
diff --git a/cpp/src/qpid/ha/TxReplicator.cpp b/cpp/src/qpid/ha/TxReplicator.cpp
index 58963149fc..0a524c8ced 100644
--- a/cpp/src/qpid/ha/TxReplicator.cpp
+++ b/cpp/src/qpid/ha/TxReplicator.cpp
@@ -199,30 +199,26 @@ boost::shared_ptr<TxAccept> TxReplicator::DequeueState::makeAccept() {
}
void TxReplicator::prepare(const string&, sys::Mutex::ScopedLock& l) {
- QPID_LOG(trace, logPrefix << "Prepare");
txBuffer->enlist(dequeueState.makeAccept());
context = store->begin();
if (txBuffer->prepare(context.get())) {
- QPID_LOG(trace, logPrefix << "Prepared OK");
- QPID_LOG(critical, logPrefix << "FIXME Prepared OK " << haBroker.getSystemId());
- QPID_LOG(critical, logPrefix << "FIXME Prepared ok "<<
- encodeStr(TxPrepareOkEvent(haBroker.getSystemId())));
+ QPID_LOG(debug, logPrefix << "Prepared OK");
sendMessage(TxPrepareOkEvent(haBroker.getSystemId()).message(queue->getName()), l);
} else {
- QPID_LOG(trace, logPrefix << "Prepare failed");
+ QPID_LOG(debug, logPrefix << "Prepare failed");
sendMessage(TxPrepareFailEvent(haBroker.getSystemId()).message(queue->getName()), l);
}
}
void TxReplicator::commit(const string&, sys::Mutex::ScopedLock& l) {
- QPID_LOG(trace, logPrefix << "Commit");
+ QPID_LOG(debug, logPrefix << "Commit");
if (context.get()) store->commit(*context);
txBuffer->commit();
end(l);
}
void TxReplicator::rollback(const string&, sys::Mutex::ScopedLock& l) {
- QPID_LOG(trace, logPrefix << "Rollback");
+ QPID_LOG(debug, logPrefix << "Rollback");
if (context.get()) store->abort(*context);
txBuffer->rollback();
end(l);