kezhuw commented on PR #1950: URL: https://github.com/apache/zookeeper/pull/1950#issuecomment-1557685392
> Regarding the multi-op API, will the order of watch event be different from the order of write operations in the same multi-op tx? @gu0keno0 They are same from my knowledge. > order the events in the main memory on the watch event consumer side, and deal with the watch events one by one to maintain the cache consistency I think this is crucial. The "deal" should tolerate to disconnection. [`autoWatchReset`](https://issues.apache.org/jira/browse/ZOOKEEPER-43) is fragile on its own from my observation. Says, "/foo" and "/bar" are watched in a sub tree. Two changes(`setData` for example) are made in server to "/foo" and "/bar" in order. The first "deal" succeed and update `lastZxid` in client side. The updated `lastZxid` covers change to "/bar". Assumes that the second "deal" fails due to connection issue. * In standard watch: No event for "/bar" after reconnected as client's `lastZxid` is up to date. We have to retry "/bar" here. * In persistent watch: There is [no `autoWatchReset`](https://github.com/apache/zookeeper/pull/1106#issuecomment-543860329). So all events during disconnection are simple [lost](https://github.com/kezhuw/zookeeper/commit/31d89e9829380559066fc2b83e3d38462380c5d4). Currently, Curator [rebuilt](https://github.com/apache/curator/blob/1e82d0c1d0708d84d06e5757e435d1d9dbebfb48/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/CuratorCacheImpl.java#L90) on [reconnected](https://github.com/apache/curator/blob/1e82d0c1d0708d84d06e5757e435d1d9dbebfb48/curator-recipes/src/main/java/org/apache/curator/framework/recipes/watch/PersistentWatcher.java#L67). > FWIW, we only need the cache to be eventually consistent, yet the simplification gain we can get from leveraging persistent watch will be a lot. Though, persistent watch [does not work well](https://github.com/kezhuw/zookeeper/commit/31d89e9829380559066fc2b83e3d38462380c5d4#diff-cfd09b7021c88da6631872e8a4a271f830162f7c5a63a140839ba029048493fdR227-R230) with `autoWatchReset`, it is still a great feature. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org