-
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
QQ: fix bug when subscribing using an already existing consumer tag #9158
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkuratczyk
approved these changes
Aug 23, 2023
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 been running this patch for many hours and the issue hasn't occurred.
Without this PR, it occurred multiple times per minute.
kjnilsson
changed the title
QQ: fix bug when subscribing using an already existing consumer tag
DO NOT MERGE: QQ: fix bug when subscribing using an already existing consumer tag
Aug 23, 2023
When subscribing using a consumer tag that is already in the quorum queues state (but perhaps with a cancelled status) and that has pending messages the next_msg_id which is used to initialise the queue type consumer state did not take the in flight message ids into account. This resulted in some messages occasionally not being delivered to the clint and thus would appear stuck as awaiting acknowledgement for the consumer. When a new checkout operation detects there are in-flight messages we set the last_msg_id to `undefined` and just accept the next message that arrives, irrespective of their message id. This isn't 100% fool proof as there may be cases where messages are lost between queue and channel where we'd miss to trigger the fallback query for missing messages. It is however much better than what we have atm. NB: really the ideal solution would be to make checkout operations async so that any inflight messages are delivered before the checkout result. That is a much bigger change for another day.
kjnilsson
changed the title
DO NOT MERGE: QQ: fix bug when subscribing using an already existing consumer tag
QQ: fix bug when subscribing using an already existing consumer tag
Aug 23, 2023
Cool, I've run multiple tests with the second version of the fix and could not reproduce neither missed nor duplicated messages. |
michaelklishin
added a commit
that referenced
this pull request
Aug 23, 2023
QQ: fix bug when subscribing using an already existing consumer tag (backport #9158)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When subscribing using a consumer tag that is already in the quorum
queues state (but perhaps with a cancelled status) and that has
pending messages the next_msg_id which is used to initialise the
queue type consumer state did not take the in flight message ids into
account. This resulted in some messages occasionally not being delivered
to the clint and thus would appear stuck as awaiting acknowledgement
for the consumer.
When a new checkout operation detects there are in-flight messages
we set the last_msg_id to
undefined
and just accept the next messagethat arrives, irrespective of their message id. This isn't 100% fool proof
as there may be cases where messages are lost between queue and channel
where we'd miss to trigger the fallback query for missing messages.
It is however much better than what we have atm.
NB: really the ideal solution would be to make checkout operations
async so that any inflight messages are delivered before the checkout
result. That is a much bigger change for another day.