Qpid
  1. Qpid
  2. QPID-3215

cached exchange reference can cause cluster inconsistencies if exchange is deleted/recreated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.10
    • Fix Version/s: 0.11
    • Component/s: C++ Broker, C++ Clustering
    • Labels:
      None

      Description

      Description of problem:

      SemanticState::route() uses a simple cache variable to avoid looking up the
      exchange for every message. However if the exchange in question is deleted,
      even if then recreated, this can cause inconsistencies in a cluster.

      Version-Release number of selected component (if applicable):

      1.3

      How reproducible:

      100% (Quite a contrived example though)

      Steps to Reproduce:
      1. start one cluster node
      2. create an exchange, a queue and a binding between them

      qpid-config add exchange topic x
      qpid-config add queue q
      qpid-config bind x q k

      3. start a session and send a message to the exchange with the relevant key
      (leave session running)

      qpid-send --content-stdin --address x/k

      then enter a few lines to send some messages

      4. start a new cluster node
      5. delete and recreate the exchange, this time add in a different binding

      qpid-config del exchange x
      qpid-config add exchange topic x
      qpid-config add queue q2
      qpid-config bind x q2 k

      6. send some more messages on the session from 3. with same exchange and key
      (i.e. type in some more messages if using qpid-send as suggested)

      now have an inconsistency where the second node has some messages in q2 and
      some (though fewer than first node) in q1, whereas for first node all the
      messages are in q1

      7. qpid-receive --address 'q2;

      {mode: browse}

      ' --broker localhost:5673
      --capacity 1 (assuming second node is 5673)

      Actual results:

      First node shutsdown with inconsistent error

      Expected results:

      No inconsistency, should be able to run the command in 7 against q or q2 on
      either node and see the same results.

        Activity

        Hide
        Alan Conway added a comment -
        Show
        Alan Conway added a comment - Review https://reviews.apache.org/r/623/
        Hide
        Alan Conway added a comment -

        fixed on trunk r1095144

        Show
        Alan Conway added a comment - fixed on trunk r1095144
        Hide
        Alan Conway added a comment -

        I think this is a standalone bug as well. Messages should not be routed by a
        deleted exchange. Invalidating the cache when the exchange is deleted would
        solve both standalone and cluster issues.

        Show
        Alan Conway added a comment - I think this is a standalone bug as well. Messages should not be routed by a deleted exchange. Invalidating the cache when the exchange is deleted would solve both standalone and cluster issues.

          People

          • Assignee:
            Alan Conway
            Reporter:
            Alan Conway
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development