/srv/irclogs.ubuntu.com/2011/06/06/#ubuntu-ensemble.txt

kiranmurariExecuting 'bin/ensemble', gives the error "ImportError: No module named txzookeeper.utils"14:14
hazmatkiranmurari, how did you install ensemble (ppa.. bzr.. etc) ?  looks like your missing a dependency.14:18
kiranmurarihazmat, downloaded the code from lp:ensemble and executed setup.py install14:19
kiranmurarihazmat, followed the getting started document https://ensemble.ubuntu.com/docs/getting-started.html14:20
hazmatkiranmurari, so that won't install any of the c extension dependencies, and it will install older versions of pure python deps from pypi14:20
* hazmat looks14:20
hazmatkiranmurari, are you using a virtualenv or the system python (/usr/bin/python)?14:21
kiranmurarihazmat, i'm using a virtual environment14:22
hazmatkiranmurari, awesome... that's a little easier to fix then14:22
kiranmurarihazmat, this has been reported as bug 788950 on lp14:23
_mup_Bug #788950: Getting Started Documention is missing dependancies <Ensemble:New> < https://launchpad.net/bugs/788950 >14:23
kiranmurari_mup_, i was referring to the same one14:23
hazmatkiranmurari, so we have a daily ppa now.. which is probably easiest for getting started... but your most of the way through a source install.. to finish the source install you'll need to cd .. & bzr branch lp:txzookeeper && cd txzookeeper && python setup.py develop14:23
hazmatkiranmurari, with the virtualenv python14:24
hazmatkiranmurari, fwiw mup is a bot.. bugs  info and commit messages.. along with logs at irclogs.ubuntu.com14:24
hazmatkiranmurari, thanks for filing the bug14:24
kiranmurarihazmat, the bug was already in place ;)14:25
hazmatugh... time to fix it then14:25
niemeyerGood mornings!14:25
hazmatniemeyer, g'morning14:25
kiranmurarihazmat, thx for the pointer. let me try your suggestion14:25
kiranmurariIs there a Ubuntu docs page for txzookeeper like the ensemble docs page14:28
hazmatkiranmurari, there's an older version of txzookeeper on pypi that got install into the virtualenv ... which is what caused the error14:29
hazmatkiranmurari, not at the moment re separate txzookeeper docs, its more of a library atm14:32
kiranmurarihazmat, the error is resolved. Time to move and ahead and start testing ensemble...14:41
hazmatkiranmurari, awesome14:41
_mup_ensemble/update-install-docs r240 committed by kapil.thangavelu@canonical.com15:09
_mup_update installation docs15:09
_mup_ensemble/update-install-docs r241 committed by kapil.thangavelu@canonical.com15:12
_mup_add python-yaml to source install package deps15:12
niemeyerI'll get some lunch.. biab16:53
=== deryck is now known as deryck[lunch]
jimbakerhazmat, just thinking about the review in https://code.launchpad.net/~jimbaker/ensemble/expose-watch-exposed-flag/+merge/63066. niemeyer refers to line 52 of the diff, in which exists_d is unpacked, but not used17:16
jimbakerhazmat, so the question i have is, is there a meaningful use of exists_d there, or should we simply unpack just the watch_d?17:17
jimbakerhazmat, this watcher nested function follows exactly the same pattern as in watch_resolved17:18
hazmatjimbaker, waiting on exists_d would work although its extraneous.. or discarding the value17:19
hazmatthe discard does entail lost bg activity.. but its not clear how the data associated is useful in this context17:20
jimbakerhazmat, yeah, i think the standard pattern of _, watch_d = self._client.exists_and_watch(...) would be appropriate in this case, as you mention it is not clear how it can be usefully worked with17:21
jimbakerthe point of the watcher is to be called upon a watch event after all17:22
hazmatjimbaker, indeed.. but all watches are associated to retrieving data17:24
hazmatit does make sense to go ahead and wait till that data is retrieved b4 proceeding with the watch17:25
hazmateven if its not used17:25
jimbakerhazmat, so just use it as an additional sync point, eg yield exists_d ?17:25
jimbakerhazmat, as expected, that would simply just work (and verified by tests - incidentally i started splitting test_service into separate test suite classes with this branch)17:32
jimbakerhazmat, so maybe something like this would be better - it reorders the watch setup with the callback such that any StopWatcher can be trapped before attempting to reestablish the watch - http://paste.ubuntu.com/620074/17:38
jimbakerand adds in the additional sync point of yield exists_d17:39
jimbakerhazmat, forget about that ordering change - it will occasionally fail on the slow callback tests when looped17:44
* hazmat catches up17:44
hazmatwas on the phone with verizon support.. my dsl has been going down like 8 times a day17:44
hazmatjimbaker, yes re additional sync point.. that's a little surprising re slow callback failure.. what's the failure out of the test with the ordering change?17:46
jimbakerhttp://paste.ubuntu.com/620083/ - i changed both watch_exposed_flag, watch_resolved for this experiment17:47
jimbakerhazmat, ^^^17:48
hazmatjimbaker, so the problem with the ordering change is that it introduces a gap while the callback is executing that changes may occur un-noticed.. 17:50
hazmatso the change isn't viable17:50
niemeyerhazmat: I believe it never makes sense to set up a watch without taking the data in consideration17:51
niemeyerSorry, that was17:51
niemeyerjimbaker, hazmat: I believe it never makes sense to set up a watch without taking the current state in consideration17:52
niemeyerWhat's the point of waiting for a change if you don't know what the current value is?17:52
jimbakerhazmat, yeah, not too surprising re callback ordering, just doesn't look obvious from the code17:52
hazmatniemeyer, in these cases, its the callback responsibility to fetch the current state, as the current state is unknown when the watch fires17:53
hazmatniemeyer, potentially we could/should restructure these,so the callback takes the current state17:53
jimbakerhazmat, that's certainly my understanding of how we've been using watches17:53
niemeyerhazmat: It still doesn't make sense..17:53
niemeyerhazmat: You're asking zookeeper to notify you when something changes from an arbitrary point in time..17:54
niemeyerhazmat: when you don't know what the value was before that17:54
niemeyerhazmat: Why is it important to know the state on moment X if you've lost the changes on X-1?17:54
niemeyerhazmat: The callback receives the current state..17:55
hazmatniemeyer, yes, effectively..its the callback responsibility to fetch current state and effect any behavior in response to the change17:55
niemeyerhazmat: It doesn't matter what the callback does17:55
niemeyerhazmat: It's bogus to ask zookeeper to tell you about a change on something you didn't know the previous value17:55
hazmatniemeyer, in these cases the callback recieves a change event, although the first time it recieves a node state 17:55
hazmatniemeyer, i think that's fair.. esp. towards constructing a more state based api.. instead of a notification api.. and removes state retrieval from the callback responsibility17:58
hazmati can incorporate that into the state protocol work17:59
niemeyerhazmat: That's not the point.. the state may still be retrieved by the callback17:59
niemeyerhazmat: The point is that if the logic is _detecting changes_ with a txzookeeper watch, and the current state is discarded, there's a bug.18:00
hazmatniemeyer, than what's the problem? if we know the callback operates against current state, and is responsible for fetching it, what's the functional problem with the current setup?18:00
hazmathmm18:00
niemeyerhazmat: The problem is what I described above.18:01
niemeyerhazmat: Every single time you set up a watch and you discard the current state there's a bug.18:01
hazmatthe bug being?18:01
niemeyerhazmat: Because you don't know what you're watching18:01
niemeyerhazmat: Are you waiting for the node to be changed?  What about the changes you've discarded by ignoring the current state?18:01
hazmatwe know exactly what we're watching.. that discard change handling.. is encompassed by invoking the callback which retrieves against current state.. ie. its not discarded18:02
niemeyerhazmat: Are you waiting for the node to be removed?  It already was!18:02
niemeyerhazmat: No, necessarily, you can't know what you're watching if you have _ignored_ the _current_ state. :-)18:03
=== deryck[lunch] is now known as deryck
hazmatniemeyer, its not ignored18:04
hazmatniemeyer, the callback is invoked for the change18:04
niemeyerhazmat: It is.. the exists_d parameter is not used.18:04
niemeyerhazmat: and it reflects the current state.18:04
niemeyerhazmat: You don't know if you're watching for it to be removed or added.18:05
hazmatniemeyer, yes the watch api get result is ignored, but the callback is invoked after the watch is set.. and it retrieves the current state18:05
niemeyerhazmat: Does that make sense?>18:05
niemeyerhazmat: It doesn't matter..18:05
niemeyerhazmat: It's a pretty basic issue.18:05
niemeyerhazmat: Imagine..18:06
niemeyercallback() => get data, the file exists, cool18:06
niemeyerfile gets removed18:06
niemeyerset watch in case it changes18:06
niemeyercallback() never called again18:06
hazmatthat's not the case18:07
hazmatthe callback is invoked after the removal18:07
hazmatwe set watch, invoke callback, attach callback to new watch18:07
niemeyerhazmat: How can you tell?18:07
niemeyerhazmat: You are _ignoring the current state_18:07
niemeyerhazmat: You are asking zookeeper to tell you when something changes, but 10000 revisions may have gone by18:08
hazmatthe watch setter is ignoring the callback, but all of the watch apis explictly state that its the responsibility of the callback to fetch current state18:08
niemeyerhazmat: Dude..18:08
niemeyerhazmat: Why do you need a watch?18:09
* hazmat sighs18:09
niemeyerhazmat: Yeah, I know..18:09
niemeyerhazmat: Why?18:09
hazmatniemeyer, to get notified of change18:09
niemeyerhazmat: Bingo..18:09
niemeyerhazmat: So, what happens if one clock cycle before the watch gets set in zookeeper, the node got removed?18:09
niemeyerhazmat: Does it matter what the callback looked at?18:10
hazmatniemeyer, the watch gets set before the callback is invoked.. so if the node was removed, the callback will see the removal18:12
niemeyerhazmat: The callback is invoked with the change event18:14
niemeyerhazmat: 18:14
niemeyer         callback_d = maybeDeferred(callback, bool(exists))18:14
hazmatniemeyer, the callback must fetch the current state, per its signature18:14
hazmatthe doc strings for all the watch apis state this explicitly18:14
niemeyerhazmat: What is that line above doing?18:14
hazmatniemeyer, that's the first invocation of the callback, executing with a boolean of existence18:15
niemeyerhazmat: What is that documentation saying:18:15
niemeyer15                change event. The watcher always recieve an initial18:15
niemeyer16                boolean value invocation denoting the existence of the18:15
niemeyer26+               exposed flag. Subsequent invocations will be with18:15
niemeyer27+               change events.18:15
niemeyer+                yield callback(change_event)18:15
niemeyerhazmat: I'll step out and get some coffee.. we can chat on Skype later if you still don't think there's a problem.18:16
jimbakerhazmat, niemeyer - definitely would like to be part of the skype call when it happens18:17
hazmatniemeyer, jimbaker lets18:18
jimbakerespecially since i have two branches pending on this :)18:19
jimbakerbut i'm glad that the expose-watch-exposed-flag branch is motivating what's a very important discussion18:20
hazmatniemeyer, if we're quoting.. we might as well finish the quote.. "Its important that clients do not rely on the event as reflective                                                                                                                                                                     18:21
hazmat        of the current state. It is only a reflection of some change                                                                                                                                                                          18:21
hazmat        happening, the callback should fetch the current value via                                                                                                                                                                            18:21
hazmat        the API, if needed."18:21
niemeyerhazmat: Yeah, sure.. "Look.. here is the change event, and the current state, but.. DON'T TRUST IT!  It's just to make sure you've read that paragraph!"18:22
hazmatniemeyer, the current state is never passed to the callback18:23
niemeyerhazmat: +                yield callback(change_event)18:23
hazmatniemeyer, a change event != current state18:23
niemeyerhazmat: The change event is useful for..?18:23
hazmatniemeyer,  to have notice that the current state needs processing18:24
niemeyerhazmat: That's what the callback is for. The change event tells what the change is, but it can't be trusted because the next change event won't reflect the period while the callback was running.18:25
niemeyerhazmat: This API is broken.  Let's fix it please.18:25
hazmatniemeyer, the next change event will reflect the period b4 the callback was invoked18:25
jimbakerit does seem to me that zk watches in general provide better guarantees with respect to ordering (and this is where niemeyer's point is especially relevant), and the current approach loses that18:25
hazmatniemeyer, as i said at the beginning a more state based api might reflect better18:26
jimbakerjust knowing that a change has happened is so much weaker18:26
niemeyerhazmat: No, because it is _ignoring the current state_!18:26
hazmatniemeyer, the watch is set before the callback is invoked.18:26
niemeyerWe're going in loops..18:27
hazmatso the current state is accounted for the next change18:27
niemeyerLet's hang on mumble please18:27
hazmatthe only issue i  see is the callback may recieve a more recent state (for which a watch notification/change event is pending)18:27
hazmatand will be reinvoked subsequently18:27
hazmatwhich would be resolved with a more state based callback api to the watch api18:28
niemeyerhttps://code.launchpad.net/~jimbaker/ensemble/expose-watch-exposed-flag/+merge/6306618:31
hazmatbcsaller, mumble standup?19:04
bcsallermumble pretty much died out for me19:24
niemeyerhazmat: Btw, I see your point and agree with you that if we guarantee that the exists_and_watch hits the server before the next exists, the watch from the first will enable the callback to be activated at least once.19:27
niemeyerhazmat: More clearly then, as a summary from our conversation, the main issues are parameters being not-trustable, and events being dispatched multiple times for the same zk state version.19:28
niemeyerhazmat: If the change_event is trusted, then state may effectively be lost.19:29
niemeyerhazmat: Is that a fair summary we can agree on?19:29
hazmatniemeyer, yes re non trustable parameters.. events being dispatched for the same state zk version.. is a little ambigious.. better to say that multiple callbacks invocations see the same zk state version19:54
hazmatand yes that19:55
hazmatthat's a good summary19:55
niemeyerhazmat: Cool, good to be on the same page19:56
niemeyerhazmat: One thing I pondered about during that discussion is whether we guarantee that two sequential calls to the txzk API will necessarily happen in the same order within zk if we don't yield from the first one20:05
niemeyerhazmat: It looks like so, but I couldn't tell for sure without looking at the internals of zk20:06
niemeyers/couldn't/can't20:06
hazmatniemeyer, the calls are submitted to the zk client, which has ack'd, so my understanding is it should be sequentially ordered20:06
hazmatah20:07
hazmatniemeyer, actually i take that back20:07
hazmatthe work is submitted in order, if the responses are returned in the same order is not guaranteed afaik.. say you did a sync, and a get20:08
hazmatif you don't wait on the sync, its not clear to me that the sync will always happen b4 the get20:09
niemeyerhazmat: We'll have to investigate that.. without this guarantee, we have more serious issues in the watch-before-callback pattern20:10
niemeyerhazmat: It feels like it should be guaranteed, though20:10
niemeyerhazmat: The issue goes like this:20:11
hazmatniemeyer, it does.. i'd have to ask the zk devs to verify though20:11
niemeyerhazmat: If we have two exists_and_watch(path) in sequence, if the former doesn't guarantee the watch being set before the following operation, we're in trouble20:12
hazmatniemeyer, its confirmed responses are returned in order20:14
niemeyerhazmat: Cool20:15
niemeyerhazmat: So we're safe20:15
_mup_ensemble/expose-watch-exposed-flag r243 committed by jim.baker@canonical.com22:45
_mup_watch_exposed_flag provides the callback the current state, simplifying its API22:45

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!