summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/UpdateClient.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-01-28 21:38:19 +0000
committerAlan Conway <aconway@apache.org>2010-01-28 21:38:19 +0000
commit9ba42cc7b5b593a94d879894d0d13276d56490aa (patch)
tree9025ebbd90003cb434404ce1be7e47456651fb29 /cpp/src/qpid/cluster/UpdateClient.cpp
parentf1815fef1848e3fe006a9a4c944c6401ad7d6cc2 (diff)
downloadqpid-python-9ba42cc7b5b593a94d879894d0d13276d56490aa.tar.gz
QPID-2357 Broker boot sequence doesn't synchronize when clustered - patch from John Dunning
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@904270 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/UpdateClient.cpp')
-rw-r--r--cpp/src/qpid/cluster/UpdateClient.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/UpdateClient.cpp b/cpp/src/qpid/cluster/UpdateClient.cpp
index d4bd4da7f8..3fba194d44 100644
--- a/cpp/src/qpid/cluster/UpdateClient.cpp
+++ b/cpp/src/qpid/cluster/UpdateClient.cpp
@@ -127,6 +127,17 @@ void UpdateClient::update() {
QPID_LOG(debug, updaterId << " updating state to " << updateeId
<< " at " << updateeUrl);
Broker& b = updaterBroker;
+
+ //
+ // Bash the state of the slave into conformance with ours. The
+ // goal here is to get his state arranged so as to mimic our
+ // state, w/r/t object ID creation. Currently, that means that we
+ // propagate our boot seq and object UID counter to him so that
+ // subsequently created objects on his side will track what's on
+ // our side.
+ //
+ updateManagementSetupState(b);
+
b.getExchanges().eachExchange(boost::bind(&UpdateClient::updateExchange, this, _1));
b.getQueues().eachQueue(boost::bind(&UpdateClient::updateNonExclusiveQueue, this, _1));
@@ -173,6 +184,22 @@ template <class T> std::string encode(const T& t) {
}
} // namespace
+//
+// Propagate the management setup state block, currently consisting of
+// object number counter and boot sequence counter, to the slave.
+//
+void UpdateClient::updateManagementSetupState(Broker & b)
+{
+ qmf::org::apache::qpid::broker::ManagementSetupState mss(b.getManagementAgent(), 0);
+ mss.set_objectNum(b.getManagementAgent()->getNextObjectId());
+ mss.set_bootSequence(b.getManagementAgent()->getBootSequence());
+
+ QPID_LOG(debug, updaterId << " updating management-setup-state " << mss.get_objectNum()
+ << " " << mss.get_bootSequence() << "\n");
+
+ ClusterConnectionProxy(session).managementSetupState(mss.get_objectNum(), mss.get_bootSequence());
+}
+
void UpdateClient::updateExchange(const boost::shared_ptr<Exchange>& ex) {
QPID_LOG(debug, updaterId << " updating exchange " << ex->getName());
ClusterConnectionProxy(session).exchange(encode(*ex));