You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2010/04/28 19:26:16 UTC

svn commit: r939014 - /qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp

Author: kpvdr
Date: Wed Apr 28 17:26:16 2010
New Revision: 939014

URL: http://svn.apache.org/viewvc?rev=939014&view=rev
Log:
BZ572245: Clustering can force message persistence when one node remains. Fix for problem in which forcing persistence on one queue but not another results in an error if a message is sent to both and the message is consumed from the non-forced queue.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=939014&r1=939013&r2=939014&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Apr 28 17:26:16 2010
@@ -771,11 +771,16 @@ bool Queue::dequeue(TransactionContext* 
             dequeued(msg);
         }
     }
-    if ((msg.payload->isPersistent() || msg.payload->checkContentReleasable()) && store) {
-        msg.payload->dequeueAsync(shared_from_this(), store); //increment to async counter -- for message sent to more than one queue
-        boost::intrusive_ptr<PersistableMessage> pmsg = boost::static_pointer_cast<PersistableMessage>(msg.payload);
-        store->dequeue(ctxt, pmsg, *this);
-        return true;
+    // This check prevents messages which have been forced persistent on one queue from dequeuing
+    // from another on which no forcing has taken place and thus causing a store error.
+    bool fp = msg.payload->isForcedPersistent();
+    if (!fp || (fp && msg.payload->isStoredOnQueue(shared_from_this()))) {
+        if ((msg.payload->isPersistent() || msg.payload->checkContentReleasable()) && store) {
+            msg.payload->dequeueAsync(shared_from_this(), store); //increment to async counter -- for message sent to more than one queue
+            boost::intrusive_ptr<PersistableMessage> pmsg = boost::static_pointer_cast<PersistableMessage>(msg.payload);
+            store->dequeue(ctxt, pmsg, *this);
+            return true;
+        }
     }
     return false;
 }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org