-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix returned wrong hash ranges for the consumer with same consumer na…
…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.
- Loading branch information
1 parent
1497ddf
commit 9abd6d3
Showing
10 changed files
with
139 additions
and
40 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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