lhotari opened a new issue #13965: URL: https://github.com/apache/pulsar/issues/13965
**Describe the bug** Quoting @BewareMyPower from #13963 > I tried to use three Java consumers with `Key_Shared` subscription to consume the topic produced by C++ test `KeySharedConsumerTest.testMultiTopics`. Sometimes not all messages can be received as well. It looks like there is something wrong with the consistent hashing implementation of `Key_Shared` dispatcher. I also made similar observations based on [C++ test logs](https://github.com/apache/pulsar/actions/workflows/ci-cpp.yaml): [Example of failures](https://github.com/apache/pulsar/runs/4950442211?check_suite_focus=true#step:11:511): ``` FAILED TESTS (3/279): 9941 ms: ./main KeySharedConsumerTest.testMultiTopics (try #1) 6242 ms: ./main KeySharedConsumerTest.testKeyBasedBatching (try #1) 9740 ms: ./main KeySharedConsumerTest.testMultiTopics (try #2) ``` full logs in https://github.com/apache/pulsar/suites/5064608592/artifacts/150614790 ``` 2022-01-26 11:26:24.372 INFO [140238723073792] MultiTopicsConsumerImpl:95 | Successfully Subscribed to Topics 2022-01-26 11:26:33.950 INFO [140238845213440] KeySharedConsumerTest:124 | messagesPerConsumer: {0 => 1098, 1 => 811, 2 => 1027} /pulsar/pulsar-client-cpp/tests/KeySharedConsumerTest.cc:129: Failure Value of: expectedNumTotalMessages Actual: 3000 Expected: numTotalMessages Which is: 2936 2022-01-26 11:26:33.951 INFO [140238845213440] ClientImpl:496 | Closing Pulsar client with 3 producers and 3 consumers ``` **To Reproduce** Steps to reproduce the behavior: 1. Set `subscriptionKeySharedUseConsistentHashing=true` 2. Produce messages to multiple topics using key shared 3. Consume messages **Expected behavior** There shouldn't be any message loss -- 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]
