[ 
https://issues.apache.org/jira/browse/QPID-3666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13164451#comment-13164451
 ] 

Ken Giusti commented on QPID-3666:
----------------------------------

Proposed fix:

Index: cpp/src/qpid/management/ManagementAgent.cpp
===================================================================
--- cpp/src/qpid/management/ManagementAgent.cpp (revision 1211460)
+++ cpp/src/qpid/management/ManagementAgent.cpp (working copy)
@@ -684,7 +684,7 @@
             ManagementObjectMap::iterator destIter = 
managementObjects.find(oid);
             if (destIter != managementObjects.end()) {
                 // duplicate found.  It is OK if the old object has been marked
-                // deleted...
+                // deleted, just replace the old with the new.
                 ManagementObject *oldObj = destIter->second;
                 if (oldObj->isDeleted()) {
                     DeletedObject::shared_ptr dptr(new DeletedObject(oldObj, 
qmf1Support, qmf2Support));
@@ -696,6 +696,10 @@
                     // and complain loudly...
                     QPID_LOG(error, "Detected two management objects with the 
same identifier: " << oid);
                 }
+                // QPID-3666: be sure to replace the -index- also, as non-key 
members of
+                // the index object may be different for the new object!  So 
erase the
+                // entry, rather than []= assign here:
+                managementObjects.erase(destIter);
             }
             managementObjects[oid] = object;
         }

                
> QMF v1 method requests may fail if new object's id overlaps an old deleted 
> object.
> ----------------------------------------------------------------------------------
>
>                 Key: QPID-3666
>                 URL: https://issues.apache.org/jira/browse/QPID-3666
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.14
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>            Priority: Minor
>             Fix For: 0.15
>
>
> If a broker object, such as a queue, is created, deleted, and re-created, the 
> new(est) QMF management object is still indexed by the old key value.  This 
> is OK for QMF v2 keys, but v1 keys contain a sequence number which is not 
> correctly updated.  This may result in v1 queries for the new object to fail.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org

Reply via email to