You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/03/09 17:53:38 UTC

[jira] [Commented] (CURATOR-391) PathChildrenCache missing events upon reconnection

    [ https://issues.apache.org/jira/browse/CURATOR-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15903482#comment-15903482 ] 

ASF GitHub Bot commented on CURATOR-391:
----------------------------------------

GitHub user Randgalt opened a pull request:

    https://github.com/apache/curator/pull/202

    [CURATOR-391] Cannot use only Stat version to determine node change

    Using only Stat version to note node change (for UPDATE event) is not enough. In a split brain if a node delete plus a recreate is missed, the Stat version can appear to be the same. So, when data is available in the cache, compare the data not the stat version

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/curator CURATOR-391

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/202.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #202
    
----
commit 127efd5ee1fc186b5027717119c953c85267f506
Author: randgalt <ra...@apache.org>
Date:   2017-03-09T17:50:11Z

    Using only Stat version to note node change (for UPDATE event) is not enough. In a split brain if a node delete plus a recreate is missed, the Stat version can appear to be the same. So, when data is available in the cache, compare the data not the stat version

----


> PathChildrenCache missing events upon reconnection
> --------------------------------------------------
>
>                 Key: CURATOR-391
>                 URL: https://issues.apache.org/jira/browse/CURATOR-391
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>            Reporter: Benjamin Jaton
>            Assignee: Jordan Zimmerman
>
> PathChildrenCache attempts to check for any change that occurred during a connection loss in applyNewData():
> {code:title=PathChildrenCache.java|borderStyle=solid}
>     else if ( previousData.getStat().getVersion() != stat.getVersion() )
> {code}
> The way to compare stats is erroneous. {{version}} will be reset if the node is recreated. So the above code only works if an update has been made, but it may miss changes that involve a delete event.
> Example:
> - node /tmp is just created, version=0
> - connection loss
> - node /tmp is deleted
> - node /tmp is recreated with new data, version=0
> - reconnect
> - no data change event from PathChildrenCache



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)