qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cctriel...@apache.org
Subject svn commit: r792285 - in /qpid/trunk/qpid/cpp/src/qpid/broker: PersistableMessage.cpp PersistableMessage.h Queue.cpp
Date Wed, 08 Jul 2009 20:01:34 GMT
Author: cctrieloff
Date: Wed Jul  8 20:01:34 2009
New Revision: 792285

URL: http://svn.apache.org/viewvc?rev=792285&view=rev
Log:
Fix to cover this case:
  1. start two nodes
  2. create cluster durable queue and add some messages
  3. kill one node (trigger force-persistent behaviour)
  4. stop and recover remaining node
  5. add another node
  6. kill that new node again


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

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp?rev=792285&r1=792284&r2=792285&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp Wed Jul  8 20:01:34 2009
@@ -100,13 +100,18 @@
     return false;
 }
 
-void PersistableMessage::enqueueAsync(PersistableQueue::shared_ptr queue, MessageStore* _store)
{ 
+
+void PersistableMessage::addToSyncList(PersistableQueue::shared_ptr queue, MessageStore*
_store) { 
     if (_store){
         sys::ScopedLock<sys::Mutex> l(storeLock);
         store = _store;
         boost::weak_ptr<PersistableQueue> q(queue);
         synclist.push_back(q);
     }
+}
+
+void PersistableMessage::enqueueAsync(PersistableQueue::shared_ptr queue, MessageStore* _store)
{ 
+    addToSyncList(queue, _store);
     enqueueAsync();
 }
 

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h?rev=792285&r1=792284&r2=792285&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h Wed Jul  8 20:01:34 2009
@@ -113,6 +113,9 @@
     QPID_BROKER_EXTERN void dequeueAsync();
     
     bool isStoredOnQueue(PersistableQueue::shared_ptr queue);
+    
+    void addToSyncList(PersistableQueue::shared_ptr queue, MessageStore* _store);
+    
 };
 
 }}

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=792285&r1=792284&r2=792285&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Jul  8 20:01:34 2009
@@ -182,6 +182,10 @@
 
 void Queue::recover(boost::intrusive_ptr<Message>& msg){
     push(msg, true);
+    if (store){ 
+        // setup synclist for recovered messages, so they don't get re-stored on lastNodeFailure
+        msg->addToSyncList(shared_from_this(), store); 
+    }
     msg->enqueueComplete(); // mark the message as enqueued
     mgntEnqStats(msg);
 



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


Mime
View raw message