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

Deprecate queue-master-locator #11565

Merged
merged 9 commits into from
Jul 12, 2024
Merged

Deprecate queue-master-locator #11565

merged 9 commits into from
Jul 12, 2024

Conversation

mkuratczyk
Copy link
Contributor

  • this should not be a breaking change - all validation should still pass
  • CQs can now use queue-leader-locator
  • queue-leader-locator takes precedence over queue-master-locator if both are used
  • regardless of which name is used, effectively there are only two values: client-local (default) or balanced
  • other values (min-masters, random, least-leaders) are mapped to balanced
  • exclusive queues are always declared locally, as before

@michaelklishin
Copy link
Member

@mkuratczyk I have added the new suite to Bazel.

@mkuratczyk mkuratczyk force-pushed the cq-leader-locator branch 4 times, most recently from deaee1e to 7390cff Compare June 26, 2024 09:20
@mkuratczyk mkuratczyk marked this pull request as ready for review June 26, 2024 10:52
@mkuratczyk mkuratczyk requested a review from ansd June 26, 2024 10:52
Copy link
Member

@ansd ansd left a comment

Choose a reason for hiding this comment

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

Since this PR deprecates queue-master-locator, how can we in future remove support for queue-master-locator? Should queue-master-locator be placed behind a deprecated feature flag such that removal can be enforced in a future RabbitMQ version?

@mkuratczyk
Copy link
Contributor Author

We can, even now, but I wouldn't rush with actually enforcing anything. The amount of code needed to support the old name is tiny and there can be applications that have that name in the codebase and we all know that for some users, application code changes are very hard (this particular setting is probably much more common in policies, that are easier to change, but still).

@ansd
Copy link
Member

ansd commented Jun 28, 2024

We can, even now, but I wouldn't rush with actually enforcing anything.

No, we can't remove support for queue-master-locator right now because - as you wrote - applications use queue-master-locator.
The question is how can we eventually remove support for queue-master-locator in RabbitMQ (e.g. version 5.0)? The deprecated feature subsystem enables "a way to declare deprecated features in the code, not only in our communication.".

Users might not read the documentation and might not even understand that queue-master-locator is deprecated.
As explained in #7390 (comment) deprecation of queue-master-locator would go through the following lifecycle:

  • permitted_by_default
  • denied_by_default
  • disconnected
  • removed

We already use this deprecated feature subsystem for various deprecated features.
It might be a good idea to also "properly" deprecate queue-master-locator using the deprecated feature subsystem.

@dumbbell
Copy link
Member

As I said on Slack, I also favor the use of deprecated features because it increases the chance that the information reaches the user who rely on that feature. It also allows them to test RabbitMQ as if the feature was gone.

deps/rabbit/src/rabbit_queue_location.erl Outdated Show resolved Hide resolved
deps/rabbit/src/rabbit_classic_queue.erl Show resolved Hide resolved
deps/rabbit/src/rabbit_classic_queue.erl Outdated Show resolved Hide resolved
deps/rabbit/src/rabbit_queue_location.erl Outdated Show resolved Hide resolved
deps/rabbit/src/rabbit_queue_location.erl Outdated Show resolved Hide resolved
@mkuratczyk mkuratczyk force-pushed the cq-leader-locator branch 9 times, most recently from 692c40c to 21f03b2 Compare June 30, 2024 22:10
@mkuratczyk
Copy link
Contributor Author

Corresponding docs PR: rabbitmq/rabbitmq-website#1961

deps/rabbit/src/rabbit_classic_queue.erl Outdated Show resolved Hide resolved
deps/rabbit/src/rabbit_classic_queue.erl Outdated Show resolved Hide resolved
deps/rabbit/src/rabbit_classic_queue.erl Outdated Show resolved Hide resolved
deps/rabbit/src/rabbit_classic_queue.erl Outdated Show resolved Hide resolved
deps/rabbit/test/classic_queue_SUITE.erl Outdated Show resolved Hide resolved
deps/rabbit/test/classic_queue_SUITE.erl Outdated Show resolved Hide resolved
@mkuratczyk mkuratczyk force-pushed the cq-leader-locator branch 2 times, most recently from 3feb7fd to 3ca0d74 Compare July 9, 2024 08:23
@mkuratczyk mkuratczyk requested a review from ansd July 9, 2024 08:40
deps/rabbit/src/rabbit_classic_queue.erl Show resolved Hide resolved
deps/rabbit/src/rabbit_classic_queue.erl Show resolved Hide resolved
deps/rabbit/test/classic_queue_SUITE.erl Outdated Show resolved Hide resolved
Copy link
Member

@ansd ansd left a comment

Choose a reason for hiding this comment

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

When I want to create a classic queue in the Management UI, I only see the option Master locator although I set

deprecated_features.permit.queue_master_locator = false

in my rabbitmq.conf.

I would expect to see a Leader locator button in the Management UI.

Screenshot 2024-07-11 at 12 47 32

@ansd
Copy link
Member

ansd commented Jul 11, 2024

same for policies in the Management UI:
Screenshot 2024-07-11 at 12 52 44

@ansd
Copy link
Member

ansd commented Jul 11, 2024

I'm unable to test upgrades from v3.13.x to this PR branch using make run-broker because the node fails during boot with this PR branch:

2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0> BOOT FAILED
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0> ===========
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0> Exception during startup:
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0> throw:{timeout,{rabbitmq_metadata,rabbit@V333JFK777}}
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>     rabbit_khepri:-register_projections/0-lc$^9/1-0-/1, line 1087
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>     rabbit_khepri:register_projections/0, line 1088
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>     rabbit_khepri:setup/1, line 255
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>     rabbit:run_prelaunch_second_phase/0, line 380
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>     rabbit:start/2, line 902
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>     application_master:start_it_old/4, line 293
2024-07-11 13:10:08.727825+02:00 [error] <0.262.0>

@ansd
Copy link
Member

ansd commented Jul 11, 2024

If you have tested that upgrades from v3.13 to this PR branch work with classic queues with x-queue-master-locator queue argument or queue-master-locator policy set and a subsequent upgrade where the new deprecated feature is denied, and the classic queue declaration by the client keeps working without having to re-create the classic queue, I'm happy with this PR being merged.

mkuratczyk and others added 9 commits July 12, 2024 09:57
* this should not be a breaking change - all validation should still pass
* CQs can now use `queue-leader-locator`
* `queue-leader-locator` takes precedence over `queue-master-locator` if
  both are used
* regardless of which name is used, effectively there are only two
  values: `client-local` (default) or `balanced`
* other values (`min-masters`, `random`, `least-leaders`) are mapped to
  `balanced`
* exclusive queues are always declared locally, as before
* prevent the warning about deprecated features when they are not
  actually used
* add a feature flag to prevent the use of queue-leader-locator until
  all nodes support it
* don't use is_mixed_version in tests
* keyfind -> keymember
Add leader-locator as an argument for all queue types
Remove master-locator
@mkuratczyk mkuratczyk merged commit f398892 into main Jul 12, 2024
194 checks passed
@mkuratczyk mkuratczyk deleted the cq-leader-locator branch July 12, 2024 11:22
mergify bot pushed a commit that referenced this pull request Jul 12, 2024
* Deprecate queue-master-locator

This should not be a breaking change - all validation should still pass
* CQs can now use `queue-leader-locator`
* `queue-leader-locator` takes precedence over `queue-master-locator` if both are used
* regardless of which name is used, effectively there are only two  values: `client-local` (default) or `balanced`
* other values (`min-masters`, `random`, `least-leaders`) are mapped to `balanced`
* Management UI no longer shows `master-locator` fields when declaring a queue/policy, but such arguments can still be used manually (unless not permitted)
* exclusive queues are always declared locally, as before

(cherry picked from commit f398892)
mkuratczyk added a commit that referenced this pull request Jul 12, 2024
* Deprecate queue-master-locator

This should not be a breaking change - all validation should still pass
* CQs can now use `queue-leader-locator`
* `queue-leader-locator` takes precedence over `queue-master-locator` if both are used
* regardless of which name is used, effectively there are only two  values: `client-local` (default) or `balanced`
* other values (`min-masters`, `random`, `least-leaders`) are mapped to `balanced`
* Management UI no longer shows `master-locator` fields when declaring a queue/policy, but such arguments can still be used manually (unless not permitted)
* exclusive queues are always declared locally, as before

(cherry picked from commit f398892)

Co-authored-by: Michal Kuratczyk <michal.kuratczyk@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants