-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Introduce messages fence mechanism for Key_Shared subscription #6977
Conversation
@merlimat Please help take a look at this PR. This implementation is based on your idea #6554 (comment). Thanks for your great idea. |
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.
leave my comments, PTAL
@codelipenghui This is not quite what I was describing in the comment. I don't think it's desirable to "fence" the individual messages, rather just keeping a pointer to where the consumer joined. I have already a fix (working in prod) but it's backed up on #6791. |
@merlimat I have added a pointer to indicate where the consumer joined and if the pointer has been mark deleted, the dispatcher dispatch messages to the consumer. The fenced messages just messages buffer, If messages don't belong to this consumer, the messages can continue dispatch to other consumers. If the buffer is full, the dispatcher will stop dispatch messages. I'm not sure if this is a good approach, the main idea does not stop dispatch messages to other consumers.
Is this mean the fix depends on #6791? Or the fix is only for the consistent hash approach. |
787ef45
to
881bb80
Compare
/pulsarbot run-failure-checks |
should the key_shared subscription in messaging section be updated? |
@codelipenghui |
@feeblefakie #6791 introduces a consistent hash approach for the consumer selector. The current implementation is a hash range split approach. This PR is to fix #6554 |
close via #7106 |
Fixes #6554
Motivation
Introduce messages fence mechanism for Key_Shared subscription to guarantee ordering dispatching.
The fenced message means that the messages can't be delivered at this time. In Key_Shared subscription, the new consumer needs to wait for all messages before the first message that delivers to this consumer are acknowledged. The
fencedMessagesContainer
maintains all fenced messages by a map (mark-delete-position -> fenced messages). When the mark delete position of the cursor is greater than the mark-delete-position in thefencedMessagesContainer
, it means the fenced messages will be lifted.Modifications
Describe the modifications you've done.
Verifying this change
New unit tests added.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation