-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix returned wrong hash ranges for the consumer with same consumer name #12212
Merged
codelipenghui
merged 2 commits into
apache:master
from
codelipenghui:penghui/fix-hash-ranges-with-same-consumer-name
Sep 28, 2021
Merged
Fix returned wrong hash ranges for the consumer with same consumer name #12212
codelipenghui
merged 2 commits into
apache:master
from
codelipenghui:penghui/fix-hash-ranges-with-same-consumer-name
Sep 28, 2021
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
Currently, we are using the consumer name to generate the hash ranges to the admin client. If there are consumers with the same name, we will get same hash ranges for different consumers, this will confuse when troubleshooting issue. The following is an example: ``` "consumers" : [ { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 46320, "msgOutCounter" : 1020, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "5253f", "availablePermits" : -20, "unackedMessages" : 1000, "avgMessagesPerEntry" : 56, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:11494", "lastAckedTimestamp" : 1632731049993, "lastConsumedTimestamp" : 1632731030268, "keyHashRanges" : [ "[0, 16384]" ], "metadata" : { }, "address" : "/127.0.0.1:54702", "connectedSince" : "2021-09-27T16:23:49.891+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19505", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54708", "connectedSince" : "2021-09-27T16:23:59.031+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19514", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54717", "connectedSince" : "2021-09-27T16:24:03.927+08:00", "clientVersion" : "2.8.1" } ], ``` The fix is to use the equals method of the consumer to generate the key hash ranges. New tests added.
hangc0276
approved these changes
Sep 28, 2021
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.
LGTM
315157973
approved these changes
Sep 28, 2021
...broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Outdated
Show resolved
Hide resolved
codelipenghui
added a commit
that referenced
this pull request
Sep 29, 2021
…me (#12212) Currently, we are using the consumer name to generate the hash ranges to the admin client. If there are consumers with the same name, we will get same hash ranges for different consumers, this will confuse when troubleshooting issue. The following is an example: ``` "consumers" : [ { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 46320, "msgOutCounter" : 1020, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "5253f", "availablePermits" : -20, "unackedMessages" : 1000, "avgMessagesPerEntry" : 56, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:11494", "lastAckedTimestamp" : 1632731049993, "lastConsumedTimestamp" : 1632731030268, "keyHashRanges" : [ "[0, 16384]" ], "metadata" : { }, "address" : "/127.0.0.1:54702", "connectedSince" : "2021-09-27T16:23:49.891+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19505", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54708", "connectedSince" : "2021-09-27T16:23:59.031+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19514", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54717", "connectedSince" : "2021-09-27T16:24:03.927+08:00", "clientVersion" : "2.8.1" } ], ``` The fix is to use the equals method of the consumer to generate the key hash ranges. New tests added. (cherry picked from commit 9abd6d3)
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Feb 2, 2022
…me (apache#12212) Currently, we are using the consumer name to generate the hash ranges to the admin client. If there are consumers with the same name, we will get same hash ranges for different consumers, this will confuse when troubleshooting issue. The following is an example: ``` "consumers" : [ { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 46320, "msgOutCounter" : 1020, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "5253f", "availablePermits" : -20, "unackedMessages" : 1000, "avgMessagesPerEntry" : 56, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:11494", "lastAckedTimestamp" : 1632731049993, "lastConsumedTimestamp" : 1632731030268, "keyHashRanges" : [ "[0, 16384]" ], "metadata" : { }, "address" : "/127.0.0.1:54702", "connectedSince" : "2021-09-27T16:23:49.891+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19505", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54708", "connectedSince" : "2021-09-27T16:23:59.031+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19514", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54717", "connectedSince" : "2021-09-27T16:24:03.927+08:00", "clientVersion" : "2.8.1" } ], ``` The fix is to use the equals method of the consumer to generate the key hash ranges. New tests added. (cherry picked from commit 9abd6d3)
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
…me (apache#12212) Currently, we are using the consumer name to generate the hash ranges to the admin client. If there are consumers with the same name, we will get same hash ranges for different consumers, this will confuse when troubleshooting issue. The following is an example: ``` "consumers" : [ { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 46320, "msgOutCounter" : 1020, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "5253f", "availablePermits" : -20, "unackedMessages" : 1000, "avgMessagesPerEntry" : 56, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:11494", "lastAckedTimestamp" : 1632731049993, "lastConsumedTimestamp" : 1632731030268, "keyHashRanges" : [ "[0, 16384]" ], "metadata" : { }, "address" : "/127.0.0.1:54702", "connectedSince" : "2021-09-27T16:23:49.891+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19505", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54708", "connectedSince" : "2021-09-27T16:23:59.031+08:00", "clientVersion" : "2.8.1" }, { "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "msgRateRedeliver" : 0.0, "chunkedMessageRate" : 0.0, "consumerName" : "my-name", "availablePermits" : 10, "unackedMessages" : 0, "avgMessagesPerEntry" : 1000, "blockedConsumerOnUnackedMsgs" : false, "readPositionWhenJoining" : "10:19514", "lastAckedTimestamp" : 0, "lastConsumedTimestamp" : 0, "keyHashRanges" : [ "[16385, 40960]", "[40961, 65536]" ], "metadata" : { }, "address" : "/127.0.0.1:54717", "connectedSince" : "2021-09-27T16:24:03.927+08:00", "clientVersion" : "2.8.1" } ], ``` The fix is to use the equals method of the consumer to generate the key hash ranges. New tests added.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-2.8
Archived: 2.8 is end of life
doc-not-needed
Your PR changes do not impact docs
release/2.8.2
release/2.9.0
type/bug
The PR fixed a bug or issue reported a bug
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.
Currently, we are using the consumer name to generate the hash ranges to the admin client.
If there are consumers with the same name, we will get same hash ranges for different consumers,
this will confuse when troubleshooting issue. The following is an example:
The fix is to use the equals method of the consumer to generate the key hash ranges.
New tests added.