You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Stack <st...@duboce.net> on 2010/10/28 23:39:14 UTC

Client seeing wrong data on nodeDataChanged

I'm trying to debug an issue that maybe you fellas have some ideas for figuring.

In short:

Client 1 updates a znode setting its content to X, then X again, then
Y, and then finally it deletes the znode.  Client 1 is watching the
znode and I can see that its getting three nodeDataChanged events and
a nodeDeleted.

Client 2 is also watching the znode.  It gets notified three times:
two nodeDataChanged events(only) and a nodeDeleted event.  I'd expect
3 nodeDataChanged events but understand a client might skip states.
The problem is that when client 2 looks at the data in the znode on
nodeDataChanged, for both cases the data is Y.  Not X and then Y, but
Y both times.  This is unexpected.

This is 3.3.1 on a 5 node ensemble.

I have full zk logging enabled.  Would it help posting these?

St.Ack

Re: Client seeing wrong data on nodeDataChanged

Posted by Ted Dunning <te...@gmail.com>.
On Thu, Oct 28, 2010 at 9:56 PM, Stack <st...@duboce.net> wrote:

> On Thu, Oct 28, 2010 at 7:32 PM, Ted Dunning <te...@gmail.com>
> wrote:
> > Client 2 is not guaranteed to see X if it doesn't get to asking before
> the
> > value has been updated to Y.
> >
> Right, but I wouldn't expect the watch to be triggered twice with value Y.
>

It may not have been.  It may have been triggered with the change from x to
x, but by the time the client got around to
looking when the value was already y.  The trigger and the value are not
connected.

Re: Client seeing wrong data on nodeDataChanged

Posted by Stack <st...@duboce.net>.
On Thu, Oct 28, 2010 at 7:32 PM, Ted Dunning <te...@gmail.com> wrote:
> Client 2 is not guaranteed to see X if it doesn't get to asking before the
> value has been updated to Y.
>
Right, but I wouldn't expect the watch to be triggered twice with value Y.

Anyways, I think we have a handle on whats going on: at the time of
the above incident, the master process is experiencing a flood of zk
changes and our thought is that we're not paying sufficient attention
to the order of receipt.  Will be back if this is not the issue.

Thanks,
St.Ack

Re: Client seeing wrong data on nodeDataChanged

Posted by Ted Dunning <te...@gmail.com>.
Client 2 is not guaranteed to see X if it doesn't get to asking before the
value has been updated to Y.

On Thu, Oct 28, 2010 at 2:39 PM, Stack <st...@duboce.net> wrote:

> Client 2 is also watching the znode.  It gets notified three times:
> two nodeDataChanged events(only) and a nodeDeleted event.  I'd expect
> 3 nodeDataChanged events but understand a client might skip states.
> The problem is that when client 2 looks at the data in the znode on
> nodeDataChanged, for both cases the data is Y.  Not X and then Y, but
> Y both times.  This is unexpected.
>