diff options
| author | Alan Conway <aconway@apache.org> | 2009-02-04 17:04:45 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2009-02-04 17:04:45 +0000 |
| commit | 314eb1b65a752daaa80a2cb5174bac78c4643bcb (patch) | |
| tree | a8fcbb5f9cc7d5af1cd5016f253c98296fa9f3bb /cpp/src/qpid/broker | |
| parent | 80c1c1da2855cc0c03d08a0fcb425c38b3344333 (diff) | |
| download | qpid-python-314eb1b65a752daaa80a2cb5174bac78c4643bcb.tar.gz | |
Cluster sets recovery flag on Broker for first member in cluster.
Disable recovery from local store if the recovery flag is not set.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@740793 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/Broker.cpp | 15 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Broker.h | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp index f692ff72f3..091f67ec58 100644 --- a/cpp/src/qpid/broker/Broker.cpp +++ b/cpp/src/qpid/broker/Broker.cpp @@ -149,6 +149,7 @@ Broker::Broker(const Broker::Options& conf) : *this), queueCleaner(queues, timer), queueEvents(poller), + recovery(true), getKnownBrokers(boost::bind(&Broker::getKnownBrokersImpl, this)) { if (conf.enableMgmt) { @@ -209,11 +210,17 @@ Broker::Broker(const Broker::Options& conf) : setStore (new NullMessageStore()); exchanges.declare(empty, DirectExchange::typeName); // Default exchange. - + if (store.get() != 0) { - RecoveryManagerImpl recoverer(queues, exchanges, links, dtxManager, - conf.stagingThreshold); - store->recover(recoverer); + // The cluster plug-in will setRecovery(false) on all but the first + // broker to join a cluster. + if (getRecovery()) { + RecoveryManagerImpl recoverer(queues, exchanges, links, dtxManager, + conf.stagingThreshold); + store->recover(recoverer); + } + else + QPID_LOG(notice, "Recovering from cluster, no recovery from local journal"); } //ensure standard exchanges exist (done after recovery from store) diff --git a/cpp/src/qpid/broker/Broker.h b/cpp/src/qpid/broker/Broker.h index c50ef46baa..71b69b51aa 100644 --- a/cpp/src/qpid/broker/Broker.h +++ b/cpp/src/qpid/broker/Broker.h @@ -139,6 +139,8 @@ class Broker : public sys::Runnable, public Plugin::Target, std::vector<Url> getKnownBrokersImpl(); std::string federationTag; + bool recovery; + public: @@ -223,6 +225,9 @@ class Broker : public sys::Runnable, public Plugin::Target, boost::function<std::vector<Url> ()> getKnownBrokers; static const std::string TCP_TRANSPORT; + + void setRecovery(bool set) { recovery = set; } + bool getRecovery() const { return recovery; } }; }} |
