I send following email to dev maillist for deep insight into this issue and more suggestion. Thanks!
I am using Zookeeper3.3.5 for a distributed project. During the test, a watch related issue is found. Our monitor program places 100 watches on 100 different paths (e.g. /goo1 .... /goo100) for monitoring the data change, and another writer program updates one of paths at a specified interval. We found sometimes some data change notification messages are lost when the monitor program is switched to a new server due to the failure of current server.
I check the "watch management" section in current release notes http://zookeeper.apache.org/doc/trunk/releasenotes.html and find a statement "In this release the client library tracks watches that a client has registered and reregisters the watches when a connection is made to a new server." So based on the information, look like during server failover it is expected behavior to lose data change notifications before watches are successfully re-registered in a new server.
The solution that I figure out to this issue is to query all 100 paths to check if there is any data change after the monitor program is connected to a new server.
However if we need to monitor 1000 or 10K paths, this solution may not be good. Can anyone suggest a better solution to this issue?
Furthermore, can ZK service is enhanced to replicate the watches on each ZK server to solve this issue forever?
Thanks for your time and help!
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.