Randgalt commented on PR #1106:
URL: https://github.com/apache/zookeeper/pull/1106#issuecomment-1366445670

   > > Yes. It’s the triggering of missed events that I’m concerned about. It 
would be easy to add but I’m unsure if it’s needed.
   > 
   > @Randgalt I run into this case today. How can it be easy to add? At least 
we need to associate zxid with the request and the data tree node, as well as 
bookkeep the changes. Then we can filter the changes between the client 
setwatches request and the server state. Or we send some duplicate but the 
client can filter with some revisions.
   
   The persistentWatches should be easy. Something like:
   
   ```
           for (String path : persistentWatches) {
               DataNode node = getNode(path);
               // determine if there's a change similar to code above this and 
process the watch if needed
               this.childWatches.addWatch(path, watcher, 
WatcherMode.PERSISTENT);
               this.dataWatches.addWatch(path, watcher, WatcherMode.PERSISTENT);
           }
   ```
   
   persistentRecursiveWatches are harder. For each persistent recursive watch 
you'd need to walk down child paths of each watch, get the node and determine 
if the watch needs to be called. Depending on the level of the watch it could 
end up walking the entire database but there's no choice.


-- 
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

Reply via email to