You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Marc Celani (Created) (JIRA)" <ji...@apache.org> on 2011/11/05 02:49:51 UTC

[jira] [Created] (ZOOKEEPER-1289) Multi Op Watch Events

Multi Op Watch Events
---------------------

                 Key: ZOOKEEPER-1289
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1289
             Project: ZooKeeper
          Issue Type: New Feature
          Components: c client, java client, server
            Reporter: Marc Celani


Caches built on top of zookeeper clients can become inconsistent because of lack of multi op watches. Our clients receive watch notifications for paths one at a time, and in their watch handling, invalidate the path in the cache. However, the cache now has an inconsistent view of zookeeper, since it is receiving the notifications one at a time. In general, the watch handling semantics do not conform with the idea of a multi op. If changes can be made to multiple paths atomically, all clients should be notified of that change atomically.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ZOOKEEPER-1289) Multi Op Watch Events

Posted by "Ted Dunning (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144520#comment-13144520 ] 

Ted Dunning commented on ZOOKEEPER-1289:
----------------------------------------

Can you suggest an economical way to do this?
                
> Multi Op Watch Events
> ---------------------
>
>                 Key: ZOOKEEPER-1289
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1289
>             Project: ZooKeeper
>          Issue Type: New Feature
>          Components: c client, java client, server
>            Reporter: Marc Celani
>
> Caches built on top of zookeeper clients can become inconsistent because of lack of multi op watches. Our clients receive watch notifications for paths one at a time, and in their watch handling, invalidate the path in the cache. However, the cache now has an inconsistent view of zookeeper, since it is receiving the notifications one at a time. In general, the watch handling semantics do not conform with the idea of a multi op. If changes can be made to multiple paths atomically, all clients should be notified of that change atomically.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ZOOKEEPER-1289) Multi Op Watch Events

Posted by "Marc Celani (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160388#comment-13160388 ] 

Marc Celani commented on ZOOKEEPER-1289:
----------------------------------------

Ted, have you had a chance to review my proposal?

Thanks
                
> Multi Op Watch Events
> ---------------------
>
>                 Key: ZOOKEEPER-1289
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1289
>             Project: ZooKeeper
>          Issue Type: New Feature
>          Components: c client, java client, server
>            Reporter: Marc Celani
>
> Caches built on top of zookeeper clients can become inconsistent because of lack of multi op watches. Our clients receive watch notifications for paths one at a time, and in their watch handling, invalidate the path in the cache. However, the cache now has an inconsistent view of zookeeper, since it is receiving the notifications one at a time. In general, the watch handling semantics do not conform with the idea of a multi op. If changes can be made to multiple paths atomically, all clients should be notified of that change atomically.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ZOOKEEPER-1289) Multi Op Watch Events

Posted by "Marc Celani (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144610#comment-13144610 ] 

Marc Celani commented on ZOOKEEPER-1289:
----------------------------------------

Ted,

We'd need two changes. On the server side, we need a WatchedEvent with a new EventType Multi. Its comprised more watched events, much like multi response looks. After committing a multi op, the watch manager would calculate the set of clients that should receive notifications, and for each client, the list of events that it is interested in. This multi watch event is sent to the client. That's the easy part.

On the client side, we know we received all of the watches together and can fire the individual watch handlers in the order they are listed. This is probably the best way of doing it without breaking backwards compatibility. For more interesting watch scenarios, we could add an API to add a multi watch function, which handles multi op watches either before or after the corresponding individual watches (could be an option in the API).

Going from my issue of cache consistency, receiving all of the watches in one packet prevents a partition from causing inconsistency, which is our main concern. In order to atomically invalidate the entries in my cache, I could add a multi op watch function that locks all of the affected cache entries and invalidates them. I would specify that my multi op watch function is fired before the corresponding individual watches, so that if my watch handling fails in any manner, I don't commit only some of the invalidates but not all of them (our cache is a persisted cache, so the possibility of failure is very possible). Maybe as an additional "nice to have", I could specify in the multi op watch handler registration API that multi ops should be handled by the multi op handler only, and all other watchers should not be notified.
                
> Multi Op Watch Events
> ---------------------
>
>                 Key: ZOOKEEPER-1289
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1289
>             Project: ZooKeeper
>          Issue Type: New Feature
>          Components: c client, java client, server
>            Reporter: Marc Celani
>
> Caches built on top of zookeeper clients can become inconsistent because of lack of multi op watches. Our clients receive watch notifications for paths one at a time, and in their watch handling, invalidate the path in the cache. However, the cache now has an inconsistent view of zookeeper, since it is receiving the notifications one at a time. In general, the watch handling semantics do not conform with the idea of a multi op. If changes can be made to multiple paths atomically, all clients should be notified of that change atomically.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ZOOKEEPER-1289) Multi Op Watch Events

Posted by "Ted Dunning (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160434#comment-13160434 ] 

Ted Dunning commented on ZOOKEEPER-1289:
----------------------------------------

Yeah.  And I really don't see a good way forward.  The master knows that the changes occurred in a multi, but I don't see how to notify the clients correctly in the context of the current API.

The problems that I see are these:

a) ordinary watches have to work even if a node is updated in a multi.  Moreover, ordinary watches on one client have to work even if another client wants a multi-watch.

b) what does it mean if I set a watch on one object and it and many others are modified?  What if one object is subject to multi-watching and another is subject to normal watching and both are in a multi?

I suppose that you might imagine that the server always sends multi notifications as multi's and never as individuals unless talking to a down-rev client.  Then the client would have to understand whether to deliver the notifications one at a time (old style) or all at once (multi-style).  The client could have a magic switch that says to deliver multi's as multi's.  But that still leaves the problem of what happens in case (b).

                
> Multi Op Watch Events
> ---------------------
>
>                 Key: ZOOKEEPER-1289
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1289
>             Project: ZooKeeper
>          Issue Type: New Feature
>          Components: c client, java client, server
>            Reporter: Marc Celani
>
> Caches built on top of zookeeper clients can become inconsistent because of lack of multi op watches. Our clients receive watch notifications for paths one at a time, and in their watch handling, invalidate the path in the cache. However, the cache now has an inconsistent view of zookeeper, since it is receiving the notifications one at a time. In general, the watch handling semantics do not conform with the idea of a multi op. If changes can be made to multiple paths atomically, all clients should be notified of that change atomically.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira