-
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
REVERTED Pass the message to rabbit_backing_queue:discard
callback
#7802
Conversation
The previous behaviour was passing solely the message ID making queue implementations such as, for example, the priority one hard to fulfil. Signed-off-by: Matteo Cafasso <[email protected]>
Signed-off-by: Matteo Cafasso <[email protected]>
rabbit_backing_queue:discard
callback rabbit_backing_queue:discard
callback
Let's limit this to |
Pass the message to `rabbit_backing_queue:discard` callback (backport #7802)
This change is not rolling-upgrade safe: if the leader of the queue is on an old node, the new ones would not be able to handle this updated message. Now, this can be addressed by making 3.12 nodes support for message IDs and messages. But old nodes won't support them. @noxdafox I'm afraid in the interest of shipping 3.12.0 soon I have to revert this. Back to the drawing board. |
rabbit_backing_queue:discard
callback rabbit_backing_queue:discard
callback
Using a feature flag on the hot path has risks. Perhaps the PR should be adjusted so that all modules support both message IDs and message records, and backported to Then, at some point, we can pass the entire message record along. |
I did not consider the rolling updates scenario during the implementation of this. @michaelklishin I am happy to help covering this as well but I might need some guidance. Are you suggesting to provide 2 implementations for backwards compatibility? I guess we can implement 2 callbacks one with the MsgID and the other with the whole Msg? |
Yes, that's the idea: have function heads that would cover both cases. @lhoguin may have something different to suggest. |
My idea is to just send |
Proposed Changes
The
rabbit_backing_queue:discard
callback is passing the message ID to the implementer. This is often not enough to carry on some necessary work as it's seen in therabbit_priority_queue
comment.In my particular case, this makes it hard to fix the following issue:
noxdafox/rabbitmq-message-deduplication#96
In the above issue a consumer starts consuming with
noAck
over an empty queue. A publisher publishes a single message which gets forwarded directly to the consumer. In this case, thediscard
callback is invoked instead ofpublish_delivered
and therefore it's header is not removed from the deduplication cache.Problem is the
discard
callback only forwards the message ID and not the whole message not providing enough context for the implementer.This patch adjust the
rabbit_backing_queue
behaviour passing the whole message to thediscard
callback instead of its sole ID.This implementation has some drawback as, when using mirrored queues, more data will now be exchanged between the master node and the slaves. This will be detrimental to empty HA queue performance.
Yet the following observations should be considered:
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
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.
CONTRIBUTING.md
document