Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-picks for 2.10.22-RC.2 #5984

Merged
merged 4 commits into from
Oct 10, 2024
Merged

Cherry-picks for 2.10.22-RC.2 #5984

merged 4 commits into from
Oct 10, 2024

Commits on Oct 10, 2024

  1. Add NumInterest to optimise searching for number of sublist entries

    Signed-off-by: Neil Twigg <neil@nats.io>
    neilalexander committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    386cbca View commit details
    Browse the repository at this point in the history
  2. [FIXED] LeafNode's queue group load balancing and Sublist.NumInterest

    While writing the test, I needed to make sure that each server in
    the hub has registered interest for 2 queue subscribers from the
    same group. I noticed that `Sublist.NumInterest()` (that I was
    invoking from `Account.Interest()` was returning 1, even after
    I knew that the propagation should have happened. It turns out
    that `NumInterest()` was returning the number of queue groups, not
    the number of queue subs in all those queue groups.
    
    For the leafnode queue balancing issue, the code was favoring
    local/routed queue subscriptions, so in the described issue,
    the message would always go from HUB1->HUB2->LEAF2->QSub instead
    of HUB1->LEAF1->QSub.
    
    Since we had another test that was a bit reversed where we had
    a HUB and LEAF1<->LEAF2 connecting to HUB and a qsub on both
    HUB and LEAF1 and requests originated from LEAF2, and we were
    expecting all responses to come from LEAF1 (instead of the
    responder on HUB), I went with the following approach:
    
    If the message originates from a client that connects to a server
    that has a connection from a remote LEAF, then we pick that LEAF the
    same as if it was a local client or routed server.
    However, if the client connects to a server that has a leaf
    connection to another server, then we keep track of the sub
    but do not sent to that one if we have local or routed qsubs.
    
    This makes the 2 tests pass, solving the new test and maintaining
    the behavior for the old test.
    
    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic authored and neilalexander committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    52af203 View commit details
    Browse the repository at this point in the history
  3. Fixed some tests that would not close clients or shutdown servers, etc..

    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic authored and neilalexander committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    6681910 View commit details
    Browse the repository at this point in the history
  4. Update Go versions

    wallyqs authored and neilalexander committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    025bbc8 View commit details
    Browse the repository at this point in the history