lhotari commented on code in PR #23447:
URL: https://github.com/apache/pulsar/pull/23447#discussion_r1798815830
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ConsistentHashingStickyKeyConsumerSelector.java:
##########
@@ -147,9 +208,15 @@ public Optional<ImpactedConsumersResult>
removeConsumer(Consumer consumer) {
// Remove all the points that were added for this consumer
for (int i = 0; i < numberOfPoints; i++) {
int hash = calculateHashForConsumerAndIndex(consumer,
consumerNameIndex, i);
- if (hashRing.remove(hash, consumerIdentityWrapper)) {
-
consumerNameIndexTracker.decreaseConsumerRefCount(consumerIdentityWrapper);
- }
+ hashRing.compute(hash, (k, hashRingPointEntry) -> {
+ assert hashRingPointEntry != null : "hash ring entry
wasn't found for hash " + hash;
Review Comment:
[Maven Surefire plugin enables assertions for tests by
default](https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#enableAssertions)
and that's sufficient for this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]