Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-822

Scopes: concurrent delivery of messages from the same sender

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • 2.10
    • None
    • None
    • 0
    • 0% 0%

    Description

      JGroups delivers messages from different senders concurrently. However, it delivers messages from the same sender sequentially. Sometimes, we can deliver messages from the same sender concurrently too, if the app tells us it is okay. For example:

      • Node N was 3 HTTP sessions: A, B and C
      • Clients update those sessions concurrently
      • As a result, N sends the following messages: A1, B1, A2, C1, C2, C3, B2, A3
      • As NAKACK assigns sequence numbers (seqnos) based on JGroups instances, all messages from N will have to be
        delivered in the same order in which they were sent, e.g. (-> means followed by):
        A1 -> B1 -> A2 -> C1 -> C2 -> C3 -> B2 -> A3
      • This means that, for example, the first update to C (C1) has to wait until A1, B1 and A2 have been delivered
      • This is not optimal, as updates for A, B and C are completely independent, and can be delivered in parallel
      • So a better delivery would be ('||' means concurrent delivery):
        A1 -> A2 -> A3 || B1 -> B2 || C1 -> C2 -> C3
      • A3 needs to be delivered after A2 which needs to be delivered after A1. However, all updates for A can be delivered
        concurrently with messages for B or C.
      • OOB doesn't help: here all messages are delivered concurrently, but there is also no ordering within A, B or C !

      SOLUTION: the sender adds a 'scope' token to a Message, e.g. the jsessionid (A, B or C). JGroups maintains NakReceiverWindows per scope, not per sender. The sender's address is the default token, so in the absence of a scope token, JGroups of course maintains NakReceiverWindows per sender. (NakReceiverWindows are used to keep track of seqnos).
      In the above example, if the scopes sent with each message are A, B and C, then we'd have 3 NakReceiverWindows:
      N::A, N::B, N::C.
      Each window would start with seqno 1, so updates for A, B and C are delivered concurrently with respect to each other, but sequentially within the scope.

      Issues:

      • This is an API change, and should probably be propagated up to the building blocks, such as RpcDispatcher.
      • A scope needs to be associated with an address A (of a JGroups instance): when A leaves or crashes, all associated scopes and their NakReceiverWindows needs to be released, too
      • Should this be done for UNICAST too ?

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-bban Bela Ban
              rhn-engineering-bban Bela Ban
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: