You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Jack Luo <jl...@rim.com> on 2012/07/05 16:24:16 UTC
How is watcher client notified once writer client is disconnected?
Hi All,
I am using Zookeeper for a distributed project. This project includes one writer client, which updates the specific znode data every 5 minutes, and 500 watcher clients, which monitor the specific znode and retrieve the updated data once change notification is received.
One of project requirements is that watcher clients should be notified immediately once writer client is disconnected. I have checked the ZooKeeper online documents and cann't find a way to do it. Any idea on how to implement this feature?
Thanks f or your time and help in advance!
Jack
---------------------------------------------------------------------
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.
Data change notification is lost during failover
Posted by Jack Luo <jl...@rim.com>.
Hi All,
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!
Jack
---------------------------------------------------------------------
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.
RE: How is watcher client notified once writer client is
disconnected?
Posted by Jack Luo <jl...@rim.com>.
Thanks!
Jack
-----Original Message-----
From: Jordan Zimmerman [mailto:jordan@jordanzimmerman.com]
Sent: Thursday, July 05, 2012 11:41 AM
To: user@zookeeper.apache.org
Subject: Re: How is watcher client notified once writer client is disconnected?
The writer could create an ephemeral node. Interested clients would
watch it for deletion.
====================
Jordan Zimmerman
On Jul 5, 2012, at 7:24 AM, Jack Luo <jl...@rim.com> wrote:
> Hi All,
> I am using Zookeeper for a distributed project. This project includes one writer client, which updates the specific znode data every 5 minutes, and 500 watcher clients, which monitor the specific znode and retrieve the updated data once change notification is received.
> One of project requirements is that watcher clients should be notified immediately once writer client is disconnected. I have checked the ZooKeeper online documents and cann't find a way to do it. Any idea on how to implement this feature?
> Thanks f or your time and help in advance!
> Jack
>
>
> ---------------------------------------------------------------------
> 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.
---------------------------------------------------------------------
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.
Re: How is watcher client notified once writer client is disconnected?
Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
The writer could create an ephemeral node. Interested clients would
watch it for deletion.
====================
Jordan Zimmerman
On Jul 5, 2012, at 7:24 AM, Jack Luo <jl...@rim.com> wrote:
> Hi All,
> I am using Zookeeper for a distributed project. This project includes one writer client, which updates the specific znode data every 5 minutes, and 500 watcher clients, which monitor the specific znode and retrieve the updated data once change notification is received.
> One of project requirements is that watcher clients should be notified immediately once writer client is disconnected. I have checked the ZooKeeper online documents and cann't find a way to do it. Any idea on how to implement this feature?
> Thanks f or your time and help in advance!
> Jack
>
>
> ---------------------------------------------------------------------
> 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.