summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp6
-rw-r--r--cpp/src/qpid/cluster/FailoverExchange.cpp6
-rw-r--r--cpp/src/qpid/cluster/FailoverExchange.h5
3 files changed, 12 insertions, 5 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 3a6c902d29..8eda6c1949 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -826,7 +826,7 @@ void Cluster::checkUpdateIn(Lock& l) {
if (state != UPDATEE) return; // Wait till we reach the stall point.
if (updatedMap) { // We're up to date
map = *updatedMap;
- memberUpdate(l);
+ failoverExchange->setUrls(getUrls(l));
mcast.mcastControl(ClusterReadyBody(ProtocolVersion(), myUrl.str()), self);
state = CATCHUP;
broker.setClusterUpdatee(false);
@@ -908,9 +908,9 @@ void Cluster::memberUpdate(Lock& l) {
std::vector<Url> urls = getUrls(l);
std::vector<string> ids = getIds(l);
size_t size = urls.size();
- failoverExchange->setUrls(urls);
+ failoverExchange->updateUrls(urls);
- if (size == 1 && lastSize > 1 && state >= CATCHUP) {
+ if (size == 1 && lastSize > 1 && state >= CATCHUP) {
QPID_LOG(notice, *this << " last broker standing, update queue policies");
lastBroker = true;
broker.getQueues().updateQueueClusterState(true);
diff --git a/cpp/src/qpid/cluster/FailoverExchange.cpp b/cpp/src/qpid/cluster/FailoverExchange.cpp
index e01c41494b..24518dbe9f 100644
--- a/cpp/src/qpid/cluster/FailoverExchange.cpp
+++ b/cpp/src/qpid/cluster/FailoverExchange.cpp
@@ -45,9 +45,13 @@ FailoverExchange::FailoverExchange(management::Manageable* parent) : Exchange(TY
mgmtExchange->set_type(TYPE_NAME);
}
-
void FailoverExchange::setUrls(const vector<Url>& u) {
Lock l(lock);
+ urls = u;
+}
+
+void FailoverExchange::updateUrls(const vector<Url>& u) {
+ Lock l(lock);
urls=u;
if (urls.empty()) return;
std::for_each(queues.begin(), queues.end(),
diff --git a/cpp/src/qpid/cluster/FailoverExchange.h b/cpp/src/qpid/cluster/FailoverExchange.h
index 738cd2a602..7eb9ea8c3a 100644
--- a/cpp/src/qpid/cluster/FailoverExchange.h
+++ b/cpp/src/qpid/cluster/FailoverExchange.h
@@ -41,8 +41,11 @@ class FailoverExchange : public broker::Exchange
static const std::string TYPE_NAME;
FailoverExchange(management::Manageable* parent);
-
+
+ /** Set the URLs but don't send an update.*/
void setUrls(const std::vector<Url>&);
+ /** Set the URLs and send an update.*/
+ void updateUrls(const std::vector<Url>&);
// Exchange overrides
std::string getType() const;