Author: kgiusti
Date: Wed Oct 3 13:36:37 2012
New Revision: 1393479
URL: http://svn.apache.org/viewvc?rev=1393479&view=rev
Log:
QPID-4347: do not store Links/Bridges if they are created via recovery.
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h
qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp?rev=1393479&r1=1393478&r2=1393479&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp Wed Oct 3 13:36:37 2012
@@ -214,6 +214,7 @@ Broker::Broker(const Broker::Options& co
*this),
mgmtObject(0),
queueCleaner(queues, &timer),
+ recoveryInProgress(false),
recovery(true),
inCluster(false),
clusterUpdatee(false),
@@ -292,7 +293,9 @@ Broker::Broker(const Broker::Options& co
// broker to join a cluster.
if (getRecovery()) {
RecoveryManagerImpl recoverer(queues, exchanges, links,
dtxManager);
+ recoveryInProgress = true;
store->recover(recoverer);
+ recoveryInProgress = false;
}
else {
QPID_LOG(notice, "Cluster recovery: recovered journal data
discarded and journal files pushed down");
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h?rev=1393479&r1=1393478&r2=1393479&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h Wed Oct 3 13:36:37 2012
@@ -180,6 +180,7 @@ class Broker : public sys::Runnable, pub
bool deferDeliveryImpl(const std::string& queue,
const Message& msg);
std::string federationTag;
+ bool recoveryInProgress;
bool recovery;
bool inCluster, clusterUpdatee;
boost::intrusive_ptr<ExpiryPolicy> expiryPolicy;
@@ -282,6 +283,7 @@ class Broker : public sys::Runnable, pub
void setRecovery(bool set) { recovery = set; }
bool getRecovery() const { return recovery; }
+ bool inRecovery() const { return recoveryInProgress; }
/** True of this broker is part of a cluster.
* Only valid after early initialization of plugins is complete.
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp?rev=1393479&r1=1393478&r2=1393479&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp Wed Oct 3 13:36:37
2012
@@ -117,7 +117,8 @@ pair<Link::shared_ptr, bool> LinkRegistr
boost::bind(&LinkRegistry::linkDestroyed, this, _1),
durable, authMechanism, username, password, broker,
parent, failover));
- if (durable && store) store->create(*link);
+ if (durable && store && !broker->inRecovery())
+ store->create(*link);
links[name] = link;
pendingLinks[name] = link;
QPID_LOG(debug, "Creating new link; name=" << name );
@@ -213,7 +214,7 @@ pair<Bridge::shared_ptr, bool> LinkRegis
args, init, queueName, altExchange));
bridges[name] = bridge;
link.add(bridge);
- if (durable && store)
+ if (durable && store && !broker->inRecovery())
store->create(*bridge);
QPID_LOG(debug, "Bridge '" << name <<"' declared on link '" <<
link.getName() <<
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]