On 31 October 2015 at 12:54, kamel zaarouri <[email protected]> wrote:
> I will present here two scenarios: > > **Scenario 1:** > > Assuming I have the following tree > > parent > |____ child > > And 2 clients A and B. > > - Assume `B` is listening on changes of `child` and `parent` > - `A` updates `child` once and then updates `parent` once > > Can `B` see changes of `parent` before seeing the changes of `child`? > It cannot, all writes are serialized which means that dispatching watches are serialized as well. So unless there's a bug in the client application with how watchers are called the should see thing in order. > > > **Scenario 2** > > Assuming I have the following tree > > parent > |____ child_1 > |____ child_2 > > If we have 3 clients `A`, `B` and `C` watching on changes from the children > of `parent` node. if client `A` received a callback that `child_1` has > changed and is about to update `child_2`. Can I safely assume that all the > clients `A`, `B` and `C` have already seen changes on `child_1` before > seeing the changes on `child_2`? > Yeah same thing, watches will be delivered in order. What you actually see depends on when you issue the corresponding reads. Btw, when I had to debug similar things before I've used zk-dump [0] to see watches being delivered (and to make sure things are in order). -rgs [0] https://github.com/twitter/zktraffic
