PapaCharlie opened a new pull request, #1950:
URL: https://github.com/apache/zookeeper/pull/1950

   With the recent addition of persistent watches, many doors have opened up to 
significantly more performant and intuitive local caches of remote state, but 
the actual implementation can be difficult because to cache data locally, one 
needs to execute the following steps:
   
   1. Set the watch
   2. Bootstrap the watched subtree
   3. Catch up on the events that fired during the bootstrap
   
   The issue is it's now very difficult to deduplicate and sanely resolve the 
remote state during step 3 because it's unknown whether an event arrived during 
the bootstrap or after. For example, imagine that between steps 1 and 2, a node 
/a was deleted then re-created. By the time step 3 is executed, there will be a 
NodeDeleted event queued up followed by a NodeCreated, causing at best a double 
read (one from the bootstrap, one from the NodeCreated) or at worst some data 
inconsistencies in the local cache.
   
   This change sets the Zxid in the response header whenever the watch event 
type is NodeCreated, NodeDeleted, NodeDataChanged or NodeChildrenChanged.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to