summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 0a40493350..7b40328f1c 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -323,10 +323,20 @@ void Cluster::configChange(const MemberId&, const std::string& addresses, Lock&
state = NEWBIE;
QPID_LOG(info, *this << " joining cluster: " << map);
mcast.mcastControl(ClusterDumpRequestBody(ProtocolVersion(), myUrl.str()), myId);
+ ClusterMap::Set members = map.getAlive();
+ members.erase(myId);
+ myElders = members;
+ broker.getLinks().setPassive(true);
}
}
- else if (state >= READY && memberChange)
+ else if (state >= READY && memberChange) {
memberUpdate(l);
+ myElders = ClusterMap::intersection(myElders, map.getAlive());
+ if (myElders.empty()) {
+ //assume we are oldest, reactive links if necessary
+ broker.getLinks().setPassive(false);
+ }
+ }
}
@@ -496,6 +506,8 @@ void Cluster::memberUpdate(Lock& l) {
}
lastSize = size;
+ //
+
if (mgmtObject) {
mgmtObject->set_clusterSize(size);
string urlstr;