Qpid
  1. Qpid
  2. QPID-3666

QMF v1 method requests may fail if new object's id overlaps an old deleted object.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.14
    • Fix Version/s: 0.15
    • Component/s: C++ Broker
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Ken Giusti added a comment -

        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;
          }

        Show
        Ken Giusti added a comment - 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; }
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/3052/
        -----------------------------------------------------------

        Review request for qpid and Ted Ross.

        Summary
        -------

        Not very pretty, but seems to be the correct solution.

        This addresses bug qpid-3666.
        https://issues.apache.org/jira/browse/qpid-3666

        Diffs


        /trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp 1211460

        Diff: https://reviews.apache.org/r/3052/diff

        Testing
        -------

        unit.

        Thanks,

        Kenneth

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/3052/ ----------------------------------------------------------- Review request for qpid and Ted Ross. Summary ------- Not very pretty, but seems to be the correct solution. This addresses bug qpid-3666. https://issues.apache.org/jira/browse/qpid-3666 Diffs /trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp 1211460 Diff: https://reviews.apache.org/r/3052/diff Testing ------- unit. Thanks, Kenneth

          People

          • Assignee:
            Ken Giusti
            Reporter:
            Ken Giusti
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development