Skip to content

Quorum queue local delivery #2146

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

Merged
merged 3 commits into from
Nov 15, 2019
Merged

Quorum queue local delivery #2146

merged 3 commits into from
Nov 15, 2019

Conversation

kjnilsson
Copy link
Contributor

@kjnilsson kjnilsson commented Oct 22, 2019

This allows consumer deliveries to be sent from followers that are local to the consuming channels (when available). When there isn't a local follower the leader will deliver the message as before.

This saves unnecessary network hops.

Needs latest Ra master.

So that a follower can deliver them if the consuming channel is local to
them in the cluster.

[#161555213]
@kjnilsson kjnilsson changed the title Qq local delivery Quorum queue local delivery Nov 14, 2019
@kjnilsson kjnilsson marked this pull request as ready for review November 14, 2019 15:17
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do any test suite assertions need updating?

rabbit_fifo_SUITE > tests > return_checked_out_test
    #1. {error,
            {{badmatch,
                 {{rabbit_fifo,
                      {cfg,test,
                          {resource,"/",queue,<<"test">>},
                          {0,64000},
                          undefined,undefined,undefined,undefined,competing,
                          undefined,undefined,undefined},
                      #{},undefined,2,
                      {0,{[],[]}},
                      1,
                      #{<0.178.0> => {enqueuer,2,[],up}},
                      {rabbit_fifo_index,#{1 => ''},1,1},
                      {0,{[],[]}},
                      #{{<<"cid">>,<0.178.0>} =>
                            {consumer,#{},
                                #{0 => {1,{1,{0,first}}}},
                                1,0,1,simple_prefetch,auto,up}},
                      {[],[]},
                      {[],[]},
                      0,0,[],0,0},
                  [{monitor,process,<0.178.0>},
                   {send_msg,<0.178.0>,
                       {delivery,<<"cid">>,[{0,{0,first}}]},
                       [local,ra_event]},
                   {aux,active}]}},
             [{rabbit_fifo_SUITE,return_checked_out_test,1,
                  [{file,"test/rabbit_fifo_SUITE.erl"},{line,310}]},
              {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1754}]},
              {test_server,run_test_case_eval1,6,
                  [{file,"test_server.erl"},{line,1263}]},
              {test_server,run_test_case_eval,9,
                  [{file,"test_server.erl"},{line,1195}]}]}}

rabbit_fifo_SUITE > tests > return_checked_out_limit_test
    #1. {error,
            {{badmatch,
                 {{rabbit_fifo,
                      {cfg,test,
                          {resource,"/",queue,<<"test">>},
                          {0,64000},
                          undefined,undefined,undefined,undefined,competing,1,
                          undefined,undefined},
                      #{},undefined,2,
                      {0,{[],[]}},
                      1,
                      #{<0.181.0> => {enqueuer,2,[],up}},
                      {rabbit_fifo_index,#{1 => ''},1,1},
                      {0,{[],[]}},
                      #{{<<"cid">>,<0.181.0>} =>
                            {consumer,#{},
                                #{0 => {1,{1,{0,first}}}},
                                1,0,1,simple_prefetch,auto,up}},
                      {[],[]},
                      {[],[]},
                      0,0,[],0,0},
                  [{monitor,process,<0.181.0>},
                   {send_msg,<0.181.0>,
                       {delivery,<<"cid">>,[{0,{0,first}}]},
                       [local,ra_event]},
                   {aux,active}]}},
             [{rabbit_fifo_SUITE,return_checked_out_limit_test,1,
                  [{file,"test/rabbit_fifo_SUITE.erl"},{line,327}]},
              {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1754}]},
              {test_server,run_test_case_eval1,6,
                  [{file,"test_server.erl"},{line,1263}]},
              {test_server,run_test_case_eval,9,
                  [{file,"test_server.erl"},{line,1195}]}]}}

@lukebakken
Copy link
Collaborator

FWIW I see the same failures in rabbit_fifo_SUITE

@kjnilsson
Copy link
Contributor Author

Ah yes I missed to run that suite. yes they will need updating as they assert of the effect which has now changed.

@michaelklishin michaelklishin merged commit 880965a into master Nov 15, 2019
michaelklishin added a commit that referenced this pull request Nov 15, 2019
Quorum queue local delivery

(cherry picked from commit 880965a)
@michaelklishin michaelklishin deleted the qq-local-delivery branch November 15, 2019 19:12
@michaelklishin
Copy link
Collaborator

Backported to v3.8.x.

@michaelklishin michaelklishin added this to the 3.8.2 milestone Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants