-
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
Pass the message to rabbit_backing_queue:discard
callback
#9620
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 <noxdafox@gmail.com>
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
@noxdafox thank you but now a few months later and with Khepri merged into So this work may or may not be considered. |
The team is leaning towards not doing any more CMQ work that is perceived as risky, and we have prior evidence that this sort of change is risky for upgrades :( Thank you for taking the time to contribute. By Oct 2024 you won't have to worry about the CQ mirroring code path at all, so at least there's that. |
@michaelklishin issue is not with the mirroring queue at all but with the As it is right now, it prevents proper implementations both for the priority and the deduplication queue. The meaningful changes within this PR are related to the Hence, we can either push this change through and remove the HA side when deleting the related files or I can provide a different PR for fixing only the above without providing the HA changes. |
I agree that we should make this change, but we should do the change after CMQs are removed (in the same release, 4.0). We will remove CMQs from the main branch some time after branching out 3.13, and the PR should be submitted again at that time IMO. |
@noxdafox all I am saying is that this PR hits an unfortunate timing where CMQs are soon to be removed, which greatly reduces our team's interest in considering any changes to classic queues. This should be over fairly soon, in maybe a month or so. |
Allright, what is the target tag so I can keep an eye on it? |
Around 4.0-alpha-1 would be a good time. |
I'd say |
Proposed Changes
This is a re-attempt at PR #7802 which was not rolling-upgrade safe.
I ended up partly following @lhoguin suggestion: the
gm
receives the full message but forwards to the slaves only theMsgId
. The slaves do not call the underlyingBQ:discard
function.Rationale behind this logic is all BQ implementations resolve to
rabbit_variable_queue:discard
which does nothing. Hence, there is no difference from slaves perspective on whether to call or not thediscard
implementation.Therefore:
MsgId
to old nodes which will handle it as suchMsgId
and simply do not callBQ:discard
as un-relevantDrawback for this implementation is we loose uniformity of implementation. Benefit is a simpler code-base as we do not need to maintain 2 callbacks for
discard
.Here I include the previous PR description:
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 the rabbit_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, the discard callback is invoked instead of publish_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 the discard 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
Checklist
CONTRIBUTING.md
documentFurther Comments
Is there a way to run tests concurrently? It takes fairly long on my machine to run the entire
rabbit
test suite. OFC I can pin down to relevant tests but it would be nice to run the entire suite.