[Bug] Topic list watcher will miss changes while metadata store connection is disconnected
Search before reporting
- [x] I searched in the issues and found nothing similar.
Read release policy
- [x] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
User environment
Any released version
Issue Description
This org.apache.pulsar.broker.service.TopicListService implementation doesn't currently handle session events (org.apache.pulsar.metadata.api.extended.SessionEvent) at all.
The consequence of this is that the state on the client side can get out of sync when the metadata store session has a temporary disruption.
Error messages
None
Reproducing the issue
Additional information
One potential solution is to retrieve the list of topics for the namespace after the metadata store session resumes after disconnection. It could then compare the changes and reconstruct the missed add/delete events to send to the client.
Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
One potential solution is to retrieve the list of topics for the namespace after the metadata store session resumes after disconnection. It could then compare the changes and reconstruct the missed add/delete events to send to the client.
I think this could be useful. The client implementation needs a change since by now, the hash has been ignored.
The correct approach should be to restart the topic watcher or request a full topic listing if the hash doesn't match after applying the changes. This way the client could be kept in sync with the actual state on the broker side.
Hi, @lhotari are you working on this? If this issue is not assigned, I would like to help fix this.