-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Add federation support for quorum queues #2804
Conversation
deps/rabbit/src/rabbit_fifo.erl
Outdated
@@ -456,11 +460,13 @@ apply(#{system_time := Ts} = Meta, {down, Pid, noconnection}, | |||
% Monitor the node so that we can "unsuspect" these processes when the node | |||
% comes back, then re-issue all monitors and discover the final fate of | |||
% these processes | |||
|
|||
NotifyEffect = notify_decorators_effect(State), |
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.
what is the scenario we are notifying here?
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.
Consumers are marked as suspected down, so it could end up with no active consumers at all and that needs to be notified.
deps/rabbit/src/rabbit_fifo.erl
Outdated
{State1, _Result, Effects1} = checkout0(Meta, checkout_one(Meta, State0), | ||
Effects0, {#{}, #{}}), | ||
case evaluate_limit(Index, false, OldState, State1, Effects1) of | ||
{State, true, Effects} -> | ||
update_smallest_raft_index(Index, State, Effects); | ||
case have_active_consumers_changed(OldState, State) of |
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.
I am not sure about adding more code this very hot path. is there nowhere else we an do this and achieve the same?
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.
We have to detect changes in the active consumers, unless we keep track of them on a different way for this exclusive use I'm not sure how we can do it
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.
If we don't do this here, what would be the observable effects? If it's a minor delay in consumer topology changes, we can live with that over more code executed on the hot path.
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.
I've removed the notifications for enqueue/return/credit/settle/discard operations. It seems enough for federation purposes (our only decorator?) to only notify on checkout/node up/node down/config updates. At least, federation test suite still passes.
6fce713
to
7a31e1b
Compare
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.
Right now policies that include federation-related keys are not applied to quorum queues.
It's not possible to know all aplicable policies since plugins can extend these, i.e. federation. Thus, we'll exclude the known unapplicable core policies and allow through any other policy.
7a31e1b
to
8592291
Compare
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.
The function naming is the main thing I think we should clarify before merging.
Adds decorator support for quorum queues, in order to support the federation plugin. There are no changes on the federation plugin, but the queue specific test suite uses now both classic and quorum queues.
This is part of #2756, which will be finished when this is backported to
master
. Small changes are needed to apply this patch inmaster
, due to the queue type refactor.Types of Changes
Checklist
CONTRIBUTING.md
document