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

Support leader and members info types in Classic Queues (as with Quorum Queues) #12422

Closed
wants to merge 3 commits into from

Conversation

Ayanda-D
Copy link
Contributor

@Ayanda-D Ayanda-D commented Oct 2, 2024

Proposed Changes

Hi

Create a mix of both Quorum and Classic queues, and list-queues specifying leader and members info type. We expect both queue types to list both the leader node and members (despite CQ always having same leader/member values). Classic Queues currently doesnt support these info items. See below.

Current behaviour:

rabbitmqctl list_queues name type leader members
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name	type	leader	members
CQ.2	classic
CQ.1	classic
QQ.2	quorum	rabbit@host	[rabbit@host]
CQ.3	classic
QQ.1	quorum	rabbit@host	[rabbit@host]
QQ.3	quorum	rabbit@host	[rabbit@host]

With the patch:

rabbitmqctl list_queues name type leader members
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name	type	leader	members
CQ.2	classic	rabbit@host	[rabbit@host]
CQ.1	classic	rabbit@host	[rabbit@host]
QQ.2	quorum	rabbit@host	[rabbit@host]
CQ.3	classic	rabbit@host	[rabbit@host]
QQ.1	quorum	rabbit@host	[rabbit@host]
QQ.3	quorum	rabbit@host	[rabbit@host]

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc.

@Ayanda-D Ayanda-D changed the title Support leader and members info type in Classic Queues (as with Quorum Queues) Support leader and members info types in Classic Queues (as with Quorum Queues) Oct 2, 2024
@michaelklishin
Copy link
Member

See #12437.

Copy link
Member

@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.

This newly added test fails in CI with

=== Location: [{classic_queue_SUITE,'-leader_locator_client_local/1-lc$^0/1-0-',[87](https://github.com/rabbitmq/rabbitmq-server/pull/12422/classic_queue_suite.src.html#87)},
              {classic_queue_SUITE,'-leader_locator_client_local/1-lc$^0/1-0-',[91](https://github.com/rabbitmq/rabbitmq-server/pull/12422/classic_queue_suite.src.html#91)},
              {test_server,ts_tc,1793},
              {test_server,run_test_case_eval1,1302},
              {test_server,run_test_case_eval,1234}]
=== === Reason: {assertEqual,
                     [{module,classic_queue_SUITE},
                      {line,87},
                      {expression,
                          "rabbit_ct_broker_helpers : rpc ( Config , Server , rabbit_amqqueue , info , [ Leader0 , [ leader , members ] ] )"},
                      {expected,
                          [{leader,'rmq-ct-cluster_size_3-2-21192@localhost'},
                           {members,
                               ['rmq-ct-cluster_size_3-2-21192@localhost']}]},
                      {value,[{leader,''},{members,''}]}]}
  in function  classic_queue_SUITE:'-leader_locator_client_local/1-lc$^0/1-0-'/2 (classic_queue_SUITE.erl, line 87)
  in call from classic_queue_SUITE:'-leader_locator_client_local/1-lc$^0/1-0-'/2 (classic_queue_SUITE.erl, line 91)
  in call from test_server:ts_tc/3 (test_server.erl, line 1793)
  in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1302)
  in call from test_server:run_test_case_eval/9 (test_server.erl, line 1234)

@@ -83,6 +83,8 @@ leader_locator_client_local(Config) ->
{<<"x-queue-leader-locator">>, longstr, <<"client-local">>}])),
{ok, Leader0} = rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, lookup, [rabbit_misc:r(<<"/">>, queue, Q)]),
Leader = amqqueue:qnode(Leader0),
?assertEqual([{leader, Leader}, {members, [Leader]}],
Copy link
Member

Choose a reason for hiding this comment

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

This test fails in CI.

Copy link
Member

Choose a reason for hiding this comment

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

This assertion generally does not belong to this test. It does not test info items returned by CQ processes.

@michaelklishin
Copy link
Member

Merged in #12437.

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.

2 participants