diff options
author | Gordon Sim <gsim@apache.org> | 2009-01-22 22:53:50 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-01-22 22:53:50 +0000 |
commit | d7ce27f7cc96894f149e5c20c03b306b80636727 (patch) | |
tree | 22caa566993da19f9e211f69fdca64c13f1f04e6 /cpp/src/qpid/cluster/Cluster.cpp | |
parent | 74481dd2b6b97374bd4f260ca89d9103ce6383ed (diff) | |
download | qpid-python-d7ce27f7cc96894f149e5c20c03b306b80636727.tar.gz |
QPID-1567: More changes to make clustering and federation work together
* replicate outgoing link traffic to all nodes
* coordinate amongst nodes so that only one node actually maintains active links
with the others able to take over if that node fails
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@736841 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 14 |
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; |