You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Benjamin Jaton <be...@gmail.com> on 2017/03/06 20:05:12 UTC

PathChildrenCacheListener missing CHILD_UPDATED events when Connection is lost

I am getting those events using PathChildrenCacheListener:

PathChildrenCacheEvent{type=CONNECTION_SUSPENDED, data=null}
PathChildrenCacheEvent{type=CONNECTION_LOST, data=null}
PathChildrenCacheEvent{type=CONNECTION_RECONNECTED data=null}

The data monitored changed during those events, but there is not
CHILD_UPDATED event received.

What are the guaranties in this case?
Is it expected to have to fetch the data manually and do a manual diff when
there is a reconnection?

Thanks
Benjamin

Re: PathChildrenCacheListener missing CHILD_UPDATED events when Connection is lost

Posted by Benjamin Jaton <be...@gmail.com>.
Logged under https://issues.apache.org/jira/browse/CURATOR-391

On Tue, Mar 7, 2017 at 10:45 AM, Jordan Zimmerman <
jordan@jordanzimmerman.com> wrote:

> Oh - interesting. If you don't mind - please open an issue in our Jira.
> This is a bug.
>
> -Jordan
>
> On Mar 7, 2017, at 10:44 AM, Benjamin Jaton <be...@gmail.com>
> wrote:
>
> if ( previousData.getStat().getVersion() != stat.getVersion() )
>
> I think this is the problem.
> If the node is deleted then recreated, the version will be reset to 0.
>
> So for instance in my case, the previous stat data version is 0.
> Then I recreate the node with different data, but the version is also 0.
>
>
> On Mon, Mar 6, 2017 at 12:17 PM, Jordan Zimmerman <
> jordan@jordanzimmerman.com> wrote:
>
>> PathChildrenCache sets a ConnectionStateListener. When the RECONNECTED
>> state is received, it refreshes the cache. You will only get a
>> CHILD_UPDATED if the Stat Version has changed. See the  applyNewData()
>> method.
>>
>> -Jordan
>>
>> > On Mar 6, 2017, at 12:05 PM, Benjamin Jaton <be...@gmail.com>
>> wrote:
>> >
>> > I am getting those events using PathChildrenCacheListener:
>> >
>> > PathChildrenCacheEvent{type=CONNECTION_SUSPENDED, data=null}
>> > PathChildrenCacheEvent{type=CONNECTION_LOST, data=null}
>> > PathChildrenCacheEvent{type=CONNECTION_RECONNECTED data=null}
>> >
>> > The data monitored changed during those events, but there is not
>> CHILD_UPDATED event received.
>> >
>> > What are the guaranties in this case?
>> > Is it expected to have to fetch the data manually and do a manual diff
>> when there is a reconnection?
>> >
>> > Thanks
>> > Benjamin
>>
>>
>
>

Re: PathChildrenCacheListener missing CHILD_UPDATED events when Connection is lost

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
Oh - interesting. If you don't mind - please open an issue in our Jira. This is a bug.

-Jordan

> On Mar 7, 2017, at 10:44 AM, Benjamin Jaton <be...@gmail.com> wrote:
> 
> if ( previousData.getStat().getVersion() != stat.getVersion() )
> 
> I think this is the problem.
> If the node is deleted then recreated, the version will be reset to 0.
> 
> So for instance in my case, the previous stat data version is 0.
> Then I recreate the node with different data, but the version is also 0.
> 
> 
> On Mon, Mar 6, 2017 at 12:17 PM, Jordan Zimmerman <jordan@jordanzimmerman.com <ma...@jordanzimmerman.com>> wrote:
> PathChildrenCache sets a ConnectionStateListener. When the RECONNECTED state is received, it refreshes the cache. You will only get a CHILD_UPDATED if the Stat Version has changed. See the  applyNewData() method.
> 
> -Jordan
> 
> > On Mar 6, 2017, at 12:05 PM, Benjamin Jaton <benjamin.jaton@gmail.com <ma...@gmail.com>> wrote:
> >
> > I am getting those events using PathChildrenCacheListener:
> >
> > PathChildrenCacheEvent{type=CONNECTION_SUSPENDED, data=null}
> > PathChildrenCacheEvent{type=CONNECTION_LOST, data=null}
> > PathChildrenCacheEvent{type=CONNECTION_RECONNECTED data=null}
> >
> > The data monitored changed during those events, but there is not CHILD_UPDATED event received.
> >
> > What are the guaranties in this case?
> > Is it expected to have to fetch the data manually and do a manual diff when there is a reconnection?
> >
> > Thanks
> > Benjamin
> 
> 


Re: PathChildrenCacheListener missing CHILD_UPDATED events when Connection is lost

Posted by Benjamin Jaton <be...@gmail.com>.
if ( previousData.getStat().getVersion() != stat.getVersion() )

I think this is the problem.
If the node is deleted then recreated, the version will be reset to 0.

So for instance in my case, the previous stat data version is 0.
Then I recreate the node with different data, but the version is also 0.


On Mon, Mar 6, 2017 at 12:17 PM, Jordan Zimmerman <
jordan@jordanzimmerman.com> wrote:

> PathChildrenCache sets a ConnectionStateListener. When the RECONNECTED
> state is received, it refreshes the cache. You will only get a
> CHILD_UPDATED if the Stat Version has changed. See the  applyNewData()
> method.
>
> -Jordan
>
> > On Mar 6, 2017, at 12:05 PM, Benjamin Jaton <be...@gmail.com>
> wrote:
> >
> > I am getting those events using PathChildrenCacheListener:
> >
> > PathChildrenCacheEvent{type=CONNECTION_SUSPENDED, data=null}
> > PathChildrenCacheEvent{type=CONNECTION_LOST, data=null}
> > PathChildrenCacheEvent{type=CONNECTION_RECONNECTED data=null}
> >
> > The data monitored changed during those events, but there is not
> CHILD_UPDATED event received.
> >
> > What are the guaranties in this case?
> > Is it expected to have to fetch the data manually and do a manual diff
> when there is a reconnection?
> >
> > Thanks
> > Benjamin
>
>

Re: PathChildrenCacheListener missing CHILD_UPDATED events when Connection is lost

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
PathChildrenCache sets a ConnectionStateListener. When the RECONNECTED state is received, it refreshes the cache. You will only get a CHILD_UPDATED if the Stat Version has changed. See the  applyNewData() method.

-Jordan

> On Mar 6, 2017, at 12:05 PM, Benjamin Jaton <be...@gmail.com> wrote:
> 
> I am getting those events using PathChildrenCacheListener:
> 
> PathChildrenCacheEvent{type=CONNECTION_SUSPENDED, data=null}
> PathChildrenCacheEvent{type=CONNECTION_LOST, data=null}
> PathChildrenCacheEvent{type=CONNECTION_RECONNECTED data=null}
> 
> The data monitored changed during those events, but there is not CHILD_UPDATED event received.
> 
> What are the guaranties in this case?
> Is it expected to have to fetch the data manually and do a manual diff when there is a reconnection?
> 
> Thanks
> Benjamin