Author: aconway
Date: Wed Dec 15 14:40:01 2010
New Revision: 1049566

URL: http://svn.apache.org/viewvc?rev=1049566&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h
    qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
    qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp
    qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.h
    qpid/trunk/qpid/cpp/xml/cluster.xml

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=1049566&r1=1049565&r2=1049566&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Wed Dec 15 14:40:01 2010
@@ -198,7 +198,7 @@ namespace _qmf = ::qmf::org::apache::qpi
  * 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;

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp?rev=1049566&r1=1049565&r2=1049566&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp Wed Dec 15 14:40:01 2010
@@ -632,15 +632,23 @@ void Connection::addQueueListener(const 
 //
 // 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
 

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h?rev=1049566&r1=1049565&r2=1049566&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h Wed Dec 15 14:40:01 2010
@@ -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:

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp?rev=1049566&r1=1049565&r2=1049566&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp Wed Dec 15 14:40:01 
2010
@@ -205,22 +205,12 @@ void UpdateClient::updateManagementSetup
     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()

Modified: qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp?rev=1049566&r1=1049565&r2=1049566&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp Wed Dec 15 
14:40:01 2010
@@ -507,7 +507,7 @@ void ManagementAgent::sendBufferLH(Buffe
                                    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
     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;

Modified: qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.h?rev=1049566&r1=1049565&r2=1049566&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.h Wed Dec 15 
14:40:01 2010
@@ -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);

Modified: qpid/trunk/qpid/cpp/xml/cluster.xml
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/xml/cluster.xml?rev=1049566&r1=1049565&r2=1049566&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/xml/cluster.xml (original)
+++ qpid/trunk/qpid/cpp/xml/cluster.xml Wed Dec 15 14:40:01 2010
@@ -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>



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to