You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Jun Rao <ju...@gmail.com> on 2013/12/30 20:15:10 UTC

detecting child changes reliably

Hi,

When a child watcher is fired, it can happen that when the children are
read, a deleted node is already added back. So, from the list of children,
it's as if nothing has changed. However, it could be important for an app
to know in this case that something has changed. I could include some
metadata per node and read every child node each. However, reading the data
for every child could be expensive. What's best way to handle this case?

Thanks,

Jun

Re: detecting child changes reliably

Posted by "Asta, Greg" <gr...@omnigon.com>.
You could check the version of the nodes or cversion of the parent.

On 12/30/2013 02:15 PM, Jun Rao wrote:
> Hi,
>
> When a child watcher is fired, it can happen that when the children are
> read, a deleted node is already added back. So, from the list of children,
> it's as if nothing has changed. However, it could be important for an app
> to know in this case that something has changed. I could include some
> metadata per node and read every child node each. However, reading the data
> for every child could be expensive. What's best way to handle this case?
>
> Thanks,
>
> Jun
>