When using a key-shared subscriptions: - I open a ...
# general
g
When using a key-shared subscriptions: • I open a consumer C1, it gets all keys • I open a consumer C2, some keys leave C1 to C2 • I open a consumer C3, some keys leave C1, C2 to C3 My question is: when I open C3, is that possible that some key that were on C2 return to C1?
a
As far as I know it uses ‘consistent hashing’ under the hood, so the answer should be no, adding C3 should only reassign some of the C1 and C2 keys to C3, just as removing a consumer will only redistribute its keys among the consumers that are still active
🙏 1
Maybe someone who has touched the code can confirm this though
g
To be explicit, I’m asking because I’m debugging some weird behaviors with last version
l
Yes, @Alexander Preuß 's description is a good one for the expected behaviour. Consistent hashing is the default when AUTO_SPLIT mode is set. Controlled with https://github.com/apache/pulsar/blob/57a616eaa79096af5b49db89c99cd39ccc94ec00/conf/broker.conf#L242 . @Gilles Barbier what is the change in behaviour that you are observing? What is your previous baseline version?
This seems to be a major change in Key_Shared: https://github.com/apache/pulsar/pull/22245 . For some reason I think it's missing from the release notes. Will have to check if it was included in the latest release or not.