[fix][broker] Key_Shared subscription: Reject consumers with incompatible policy - #23449
Merged
lhotari merged 7 commits intoOct 21, 2024
Conversation
|
@pdolif Please add the following content to your PR description and select a checkbox: |
lhotari
previously approved these changes
Oct 14, 2024
lhotari
requested review from
codelipenghui,
equanz,
merlimat and
poorbarcode
October 14, 2024 06:31
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23449 +/- ##
============================================
+ Coverage 73.57% 74.29% +0.71%
- Complexity 32624 34904 +2280
============================================
Files 1877 1943 +66
Lines 139502 146995 +7493
Branches 15299 16195 +896
============================================
+ Hits 102638 109206 +6568
- Misses 28908 29345 +437
- Partials 7956 8444 +488
Flags with carried forward coverage won't be shown. Click here to find out more.
|
lhotari
reviewed
Oct 14, 2024
lhotari
dismissed
their stale review
October 14, 2024 08:25
Dismissing review since improving the error messages could be useful.
…patible subscription type or key_shared policy
lhotari
reviewed
Oct 14, 2024
lhotari
reviewed
Oct 14, 2024
…rror check to AbstractSubscription
…tion-reject-incompatible-consumer
Member
|
there's some unrelated test flakiness such as #23486 which caused the first attempt to fail. |
lhotari
reviewed
Oct 20, 2024
…tion-reject-incompatible-consumer
hanmz
pushed a commit
to hanmz/pulsar
that referenced
this pull request
Feb 12, 2025
This file contains hidden or 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
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.
Fixes #23272
Motivation
When a consumer with a different Key_Shared policy connects, the current behavior is that the existing consumer will be closed and replaced with the consumer with the different policy. Since the replaced consumer gets disconnected, it will connect again and swap with the other consumer, and this replacement loop keeps going on.
Taken from #23272 by @lhotari:
When multiple consumers are using different policies, this should be properly handled.
One possibility is to keep the policy of the connected consumers and reject any other consumers and return a proper error message.
Modifications
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: pdolif#4