Skip to content
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 (backport #9158) (backport #9161) #9164

Merged
merged 2 commits into from Aug 25, 2023

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Aug 23, 2023

This is an automatic backport of pull request #9161 done by Mergify.
Cherry-pick of 0390886 has failed:

On branch mergify/bp/v3.11.x/pr-9161
Your branch is up to date with 'origin/v3.11.x'.

You are currently cherry-picking commit 0390886305.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   deps/rabbit/src/rabbit_fifo.erl
	modified:   deps/rabbit/test/quorum_queue_SUITE.erl

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deps/rabbit/src/rabbit_fifo_client.erl
	both modified:   deps/rabbit/test/rabbit_fifo_SUITE.erl

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

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.

(cherry picked from commit 49108a6)
(cherry picked from commit 0390886)

# Conflicts:
#	deps/rabbit/src/rabbit_fifo_client.erl
#	deps/rabbit/test/rabbit_fifo_SUITE.erl
@mergify mergify bot added the conflicts label Aug 23, 2023
@michaelklishin michaelklishin deleted the mergify/bp/v3.11.x/pr-9161 branch August 23, 2023 19:53
@kjnilsson kjnilsson restored the mergify/bp/v3.11.x/pr-9161 branch August 25, 2023 14:11
@kjnilsson kjnilsson reopened this Aug 25, 2023
@michaelklishin michaelklishin added this to the 3.11.23 milestone Aug 25, 2023
@michaelklishin michaelklishin merged commit e57661c into v3.11.x Aug 25, 2023
16 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v3.11.x/pr-9161 branch August 25, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants