-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Start mirrors synchronously when transferring CMQ leadership #2751
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
Conversation
of classic mirrored queues. There are cases when asynchronously adding mirrors makes a lot of sense: e.g. when a new node joins the cluster. In this case, if we add mirrors asynchronously, this operation will race with the step that removes mirrors. As a result, we can end up with a queue that decided that it had no promotable replicas => data loss from the transfer. Closes #2749. Pairs: @dcorbacho, @mkuratczyk
Since we only consider nodes hosting in-sync replicas for transfer candidates, we can drop only one mirror instead of N, and reduce the load caused by this operation. This does not affect CMQ leadership transfer when performed in the context 'rabbitmq-queues rebalance' Pair: @dcorbacho, @mkuratczyk
not only it uses unfortunate terms to refer to secondaries, it is not particularly clear.
We are considering exclude CMQ leadership transfer from maintenance mode because it can take quite some time in clusters with a lot of queue, and this cannot really be optimized. Quorum queues transfer leadership a lot more efficiently, so that can stay. However, this change can be merged as is. |
QPid = amqqueue:get_pid(Q), | ||
SPids = amqqueue:get_slave_pids(Q), | ||
case [Pid || Pid <- [QPid | SPids], node(Pid) =:= MirrorNode] of | ||
PrimaryPid = amqqueue:get_pid(Q), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
John O'Hara - inventor of AMQP - will be sad to see the demise of QPid - AMQP's first implementation - from the RabbitMQ codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahaha. Definitely a good one 🤓
Start mirrors synchronously when transferring CMQ leadership (cherry picked from commit 50761cb)
Starting with 3.8.12, `rabbitmq-upgrade` drain will not transfer classic mirrored queue leaders. See rabbitmq/rabbitmq-server#2751 for more info
Proposed Changes
This changes classic mirror queue leadership transfer to add mirrors synchronously and also delete
fewer mirrors where it's not warranted.
We also used this as an opportunity to rename a few things around the relevant code paths.
Closes #2749.
References #2737.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
Pairs: @dcorbacho @mkuratczyk.