-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][broker] Add keyHashRangeIndex to distinguish the same hashRanges with the same consumerName
#16672
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
Conversation
|
@Technoboy- Please provide a correct documentation label for your PR. |
|
I think this will remove the possibility of having a stable assignment logic. Right now, if you specify the same consumer names, you will be guaranteed to receive the same keys after reconnections. |
Oh, good point. Maybe we should try to add more information to the topic stats instead of changing the behavior. |
| return result; | ||
| } | ||
|
|
||
| private String getConsumerUniqueId(Consumer consumer) { |
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.
should we make consumerUniqueId a method of Consumer?
keyHashRangeIndex to distinguish the same consumerName with the same hashRanges
keyHashRangeIndex to distinguish the same consumerName with the same hashRangeskeyHashRangeIndex to distinguish the same hashRanges with the same consumerName
Add a new field to help user distinguish the same hashRanges. |
| long sameNameConsumerCount = consumerKeyHashRanges.keySet() | ||
| .stream() | ||
| .filter(c -> c.consumerName().equals(consumer.consumerName())) | ||
| .count(); |
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.
Can we get the consumer count without going through all the items of consumerKeyHashRanges? If we have many consumers under a topic, this might introduce CPU spike
|
Decide to add more descriptions for this part. |
Fixes #16654
Master Issue: #16654
Motivation
Add
keyHashRangeIndexto distinguish the same hashRanges with the same consumerName.Documentation
doc-not-needed