qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1509428 - in /qpid/trunk/qpid/cpp/src/qpid/ha: Primary.cpp PrimaryTxObserver.cpp TxReplicator.cpp
Date Thu, 01 Aug 2013 20:56:30 GMT
Author: aconway
Date: Thu Aug  1 20:56:29 2013
New Revision: 1509428

URL: http://svn.apache.org/r1509428
Log:
QPID-4327: HA logging fixes.

- Removed "FIXME" log statements inadvertently left in code.
- Changed some trace statements to debug to faclilitate debugging.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp
    qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp
    qpid/trunk/qpid/cpp/src/qpid/ha/TxReplicator.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp?rev=1509428&r1=1509427&r2=1509428&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/Primary.cpp Thu Aug  1 20:56:29 2013
@@ -389,14 +389,14 @@ void Primary::setCatchupQueues(const Rem
 }
 
 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);

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp?rev=1509428&r1=1509427&r2=1509428&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp Thu Aug  1 20:56:29 2013
@@ -91,7 +91,7 @@ PrimaryTxObserver::PrimaryTxObserver(HaB
     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:
 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();
 }

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/TxReplicator.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/TxReplicator.cpp?rev=1509428&r1=1509427&r2=1509428&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/TxReplicator.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/TxReplicator.cpp Thu Aug  1 20:56:29 2013
@@ -199,30 +199,26 @@ boost::shared_ptr<TxAccept> TxReplicator
 }
 
 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);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message