summaryrefslogtreecommitdiff
path: root/qpid
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-12-15 14:40:01 +0000
committerAlan Conway <aconway@apache.org>2010-12-15 14:40:01 +0000
commit9f13478e6ad313df9f548a65553c1cb18e00d43b (patch)
tree0c0df8af36f38ffa41973c43a94618c1cc13e323 /qpid
parent8ad734ad94e5fca9c358326496515943250a5ac5 (diff)
downloadqpid-python-9f13478e6ad313df9f548a65553c1cb18e00d43b.tar.gz
Bug 662765 - Management broker ID should be the same for members of a cluster.
Replicate management UUID and name to members of a cluster. See https://bugzilla.redhat.com/show_bug.cgi?id=662765. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1049566 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
-rw-r--r--qpid/cpp/src/qpid/cluster/Cluster.cpp2
-rw-r--r--qpid/cpp/src/qpid/cluster/Connection.cpp14
-rw-r--r--qpid/cpp/src/qpid/cluster/Connection.h8
-rw-r--r--qpid/cpp/src/qpid/cluster/UpdateClient.cpp20
-rw-r--r--qpid/cpp/src/qpid/management/ManagementAgent.cpp4
-rw-r--r--qpid/cpp/src/qpid/management/ManagementAgent.h7
-rw-r--r--qpid/cpp/xml/cluster.xml4
7 files changed, 34 insertions, 25 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Cluster.cpp b/qpid/cpp/src/qpid/cluster/Cluster.cpp
index 4f98c60cad..0013c370a7 100644
--- a/qpid/cpp/src/qpid/cluster/Cluster.cpp
+++ b/qpid/cpp/src/qpid/cluster/Cluster.cpp
@@ -198,7 +198,7 @@ namespace _qmf = ::qmf::org::apache::qpid::cluster;
* Currently use SVN revision to avoid clashes with versions from
* different branches.
*/
-const uint32_t Cluster::CLUSTER_VERSION = 1039478;
+const uint32_t Cluster::CLUSTER_VERSION = 1045272;
struct ClusterDispatcher : public framing::AMQP_AllOperations::ClusterHandler {
qpid::cluster::Cluster& cluster;
diff --git a/qpid/cpp/src/qpid/cluster/Connection.cpp b/qpid/cpp/src/qpid/cluster/Connection.cpp
index 2a98800484..2797fdcf02 100644
--- a/qpid/cpp/src/qpid/cluster/Connection.cpp
+++ b/qpid/cpp/src/qpid/cluster/Connection.cpp
@@ -632,15 +632,23 @@ void Connection::addQueueListener(const std::string& q, uint32_t listener) {
//
// This is the handler for incoming managementsetup messages.
//
-void Connection::managementSetupState(uint64_t objectNum, uint16_t bootSequence)
+void Connection::managementSetupState(
+ uint64_t objectNum, uint16_t bootSequence, const framing::Uuid& id,
+ const std::string& vendor, const std::string& product, const std::string& instance)
{
- QPID_LOG(debug, "Running managementsetup state handler, new objectnum "
- << objectNum << " seq " << bootSequence);
+ QPID_LOG(debug, cluster << " updated management: object number="
+ << objectNum << " boot sequence=" << bootSequence
+ << " broker-id=" << id
+ << " vendor=" << vendor
+ << " product=" << product
+ << " instance=" << instance);
management::ManagementAgent* agent = cluster.getBroker().getManagementAgent();
if (!agent)
throw Exception(QPID_MSG("Management schema update but management not enabled."));
agent->setNextObjectId(objectNum);
agent->setBootSequence(bootSequence);
+ agent->setUuid(id);
+ agent->setName(vendor, product, instance);
}
}} // Namespace qpid::cluster
diff --git a/qpid/cpp/src/qpid/cluster/Connection.h b/qpid/cpp/src/qpid/cluster/Connection.h
index 95d846eaf8..69b8cb1450 100644
--- a/qpid/cpp/src/qpid/cluster/Connection.h
+++ b/qpid/cpp/src/qpid/cluster/Connection.h
@@ -177,7 +177,13 @@ class Connection :
OutputInterceptor& getOutput() { return output; }
void addQueueListener(const std::string& queue, uint32_t listener);
- void managementSetupState(uint64_t objectNum, uint16_t bootSequence);
+ void managementSetupState(uint64_t objectNum,
+ uint16_t bootSequence,
+ const framing::Uuid&,
+ const std::string& vendor,
+ const std::string& product,
+ const std::string& instance);
+
void setSecureConnection ( broker::SecureConnection * sc );
private:
diff --git a/qpid/cpp/src/qpid/cluster/UpdateClient.cpp b/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
index 7d73f3c1db..c52caf6aa9 100644
--- a/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
+++ b/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
@@ -205,22 +205,12 @@ void UpdateClient::updateManagementSetupState()
management::ManagementAgent* agent = updaterBroker.getManagementAgent();
if (!agent) return;
- //
- // 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.
- //
- qmf::org::apache::qpid::broker::ManagementSetupState mss(agent, 0);
- mss.set_objectNum(agent->getNextObjectId());
- mss.set_bootSequence(agent->getBootSequence());
- QPID_LOG(debug, updaterId << " updating management-setup-state "
- << mss.get_objectNum()
- << " " << mss.get_bootSequence() << "\n");
+ QPID_LOG(debug, updaterId << " updating management setup-state.");
+ std::string vendor, product, instance;
+ agent->getName(vendor, product, instance);
ClusterConnectionProxy(session).managementSetupState(
- mss.get_objectNum(), mss.get_bootSequence());
+ agent->getNextObjectId(), agent->getBootSequence(), agent->getUuid(),
+ vendor, product, instance);
}
void UpdateClient::updateManagementAgent()
diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.cpp b/qpid/cpp/src/qpid/management/ManagementAgent.cpp
index fbbdf111c7..4bacb95c7b 100644
--- a/qpid/cpp/src/qpid/management/ManagementAgent.cpp
+++ b/qpid/cpp/src/qpid/management/ManagementAgent.cpp
@@ -507,7 +507,7 @@ void ManagementAgent::sendBufferLH(Buffer& buf,
string routingKey)
{
if (suppressed) {
- QPID_LOG(trace, "Suppressed management message to " << routingKey);
+ QPID_LOG(trace, "Suppressing management message to " << routingKey);
return;
}
if (exchange.get() == 0) return;
@@ -562,7 +562,7 @@ void ManagementAgent::sendBufferLH(const string& data,
Variant::Map::const_iterator i;
if (suppressed) {
- QPID_LOG(trace, "Suppressed management message to " << routingKey);
+ QPID_LOG(trace, "Suppressing management message to " << routingKey);
return;
}
if (exchange.get() == 0) return;
diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.h b/qpid/cpp/src/qpid/management/ManagementAgent.h
index 9829094a0f..7f5f3a856e 100644
--- a/qpid/cpp/src/qpid/management/ManagementAgent.h
+++ b/qpid/cpp/src/qpid/management/ManagementAgent.h
@@ -113,8 +113,6 @@ public:
const bool topic,
int qmfVersion);
- const framing::Uuid& getUuid() const { return uuid; }
-
/** Disallow a method. Attempts to call it will receive an exception with message. */
void disallow(const std::string& className, const std::string& methodName, const std::string& message);
@@ -138,7 +136,10 @@ public:
void setNextObjectId(uint64_t o) { nextObjectId = o; }
uint16_t getBootSequence(void) { return bootSequence; }
- void setBootSequence(uint16_t b) { bootSequence = b; }
+ void setBootSequence(uint16_t b) { bootSequence = b; writeData(); }
+
+ const framing::Uuid& getUuid() const { return uuid; }
+ void setUuid(const framing::Uuid& id) { uuid = id; writeData(); }
// TODO: remove these when Variant API moved into common library.
static types::Variant::Map toMap(const framing::FieldTable& from);
diff --git a/qpid/cpp/xml/cluster.xml b/qpid/cpp/xml/cluster.xml
index dfe9554ad1..0462838b1b 100644
--- a/qpid/cpp/xml/cluster.xml
+++ b/qpid/cpp/xml/cluster.xml
@@ -267,6 +267,10 @@
<control name="management-setup-state" code="0x36">
<field name="objectNum" type="uint64"/>
<field name="bootSequence" type="uint16"/>
+ <field name="broker-id" type="uuid"/>
+ <field name="vendor" type="str32"/>
+ <field name="product" type="str32"/>
+ <field name="instance" type="str32"/>
</control>
</class>
</amqp>