/srv/irclogs.ubuntu.com/2011/04/28/#ubuntu-ensemble.txt

* niemeyer => bed.. night all!03:13
_mup_ensemble/resolved-state-api r198 committed by kapil.thangavelu@canonical.com12:15
_mup_refactor resolved state api to have a more 'friendly' api feel, via relation-set-resolved taking relation-name instead of internal id.12:15
hazmatniemeyer, on the resolved state refactor.. the relation resolved set now takes unit names, but the inverse, get still returns internal ids, but its primary consumer is the unit agent.12:16
niemeyerhazmat: Hmm.. that feels a bit icky12:17
hazmatniemeyer, on the icky front, it also means pulling in some ensemble.unit imports into state.service12:18
niemeyerhazmat: Ouch12:18
niemeyerhazmat: That's a big ickiness :)12:18
hazmatniemeyer, we need to dereference to properly validate12:18
niemeyerhazmat: How do you mean?12:18
hazmatniemeyer, well given a rel name by itself, doesn't tell us the workflow state of the  relation, which we need to verify if we want to provide feedback to the user12:19
hazmati've got the feedback aspects of the set worked out, and added some additional unit relation accessor to the unit state.12:20
hazmatbut the notion that set/get are not inverses is slightly odd12:20
niemeyerhazmat: That seems to indicate a more serious problem in our abstractions 12:21
niemeyerhazmat: ensemble.unit should be using ensemble.state12:21
niemeyerhazmat: Not the other way around12:21
hazmatniemeyer, oddly enough no circular imports at the moment, unit.workflow is self contained atm12:21
hazmati had to pull in lifecycle for the unit tests though12:21
hazmatin general i agree state should be foundational layer12:22
niemeyerhazmat: Maybe it should be moved into the state then..12:22
hazmatniemeyer, it has no state manipulations.12:22
niemeyerhazmat: There's stuff in ensemble.hooks which is fiddling with nodes directly too12:22
niemeyerhazmat: That's another one we have to fix12:23
niemeyerhazmat: Hmmm12:23
hazmatniemeyer, the only stuff in hooks that manipulates state is via relationcontext atm12:23
niemeyerhazmat: Yes12:24
hazmatniemeyer, i don't see anything wrong with ensemble.hooks consuming a state api12:24
niemeyerhazmat: Sorry, I'm on crack12:25
niemeyerhazmat: I was thinking of ensemble/state/hooks.py, which is already in state12:25
hazmatah.. right12:26
niemeyerAnyway, workflow.. hmmm12:26
* hazmat pushes his branch12:26
niemeyer        yield retry_change(self._client, self.zk_state_path, update_state)12:26
hazmatniemeyer its at lp:~hazmat/ensemble/resolved-state-api if your curious12:26
niemeyer            data, stat = yield self._client.get(self.zk_state_path)12:27
niemeyerIndeed workflow should be better integrated in the state12:28
niemeyerhazmat: Checking it out12:28
niemeyerhazmat: Yeah, I think we should talk about some cleaning up there indeed12:43
niemeyerhazmat: The issues we're seeing in this branch are not a problem in the branch itself12:43
hazmatniemeyer, i'm concerned as well about meeting the deadlines for the features entailed by the branch12:43
niemeyerhazmat: It's just a side effect of some pending polishing after some organic growth which took place12:44
hazmatgiven some refactoring work to fix things up12:44
hazmatniemeyer, yeah.. the testing situation in test_service is also need a fix up12:44
niemeyerhazmat: Yeah, maybe we should just merge your previous version with this specific aspect uncovered, to get the feature itself in, and then polish a bit the organization12:45
hazmatthe relation endpoint stuff never cleaned up some of the tests, so there are like half-dozen ways to set thigns up12:45
niemeyerhazmat: For instance, it's bizarre that is_relation_running is a method12:45
hazmata function you mean and not a method?12:45
niemeyerhazmat: We have a RelationStateManager, and a RelationState12:45
niemeyerhazmat: Sorry, yeah12:45
hazmatniemeyer, so we should have time at uds then to discuss some of these issues12:47
niemeyerhazmat: I'm not sure there's a lot to debate there.. we just have to integrate that aspect better into the state12:48
niemeyerhazmat: A UnitState should be aware of its workflow state.. a RelationState should be aware of its workflow state12:48
niemeyerhazmat: The workflow stuff itself seems nice on itself.. it's just too isolated from the rest12:49
niemeyerhazmat: The question is: how to merge these concepts nicely?12:49
hazmatniemeyer,  the workflow just needs a get/set api on the state to push the workflow for zk persistence. There is an analogous api for unit relation settings data (get/set on the unit relation) although in practice that's only used by tests12:52
niemeyerhazmat: I think it needs a bit more than that.. e.g. "is running" is something we should be able to inquire in a UnitState12:53
niemeyerhazmat: Otherwise it becomes txzookeeper212:54
hazmatniemeyer, in that case we need to fold workflow aspects into state12:54
hazmatniemeyer, so i need a path forward, i can revert back and tackle the rest review minus this comment or i can push it forward (the set change is largely done).13:32
hazmatif revert, i'll file an issue regarding this for future13:32
niemeyerhazmat: The former sounds like a better plan13:33
hazmatniemeyer, okay.. sounds good13:33
niemeyerhazmat: If we're compromising somewhere, the id issue sounds relatively minor compared to the other inconsistencies being introduced13:33
niemeyerhazmat: It'd be good to sort the overall problem soonish, though13:34
niemeyerhazmat: This will only get worse13:34
hazmatniemeyer, agreed re id minor to the others13:35
hazmatniemeyer, service.py/test_service.py are also getting a bit large.. i think the notion of encapsulating the get/set/clear/watch api into some of staterequestprotocol will help clean that up13:36
niemeyerhazmat: I think we already have a good part of it encapsulated into YAMLState13:36
niemeyerhazmat: This is effectively read/write/delete/watch13:37
niemeyerhazmat: read/write are ready13:37
_mup_Bug #772331 was filed: Incorporate workflow more closely into state <Ensemble:New> < https://launchpad.net/bugs/772331 >13:37
_mup_Bug #772332 was filed: Use a StateRequestProtocol utilizing yamlstate encapsulate get/set/del/watch apis in unit state <Ensemble:New> < https://launchpad.net/bugs/772332 >13:39
hazmatniemeyer, agreed, i just want to take a next step that will allow us to move the state based request/response protocols into their own classes. and expose via composition on the unit13:40
niemeyerhazmat: YAMLState is already its own class13:41
hazmatniemeyer, yamlstate is a good start and would be used by a protocol impl, but the usage scenarios are different, yaml state represents a concurrent r/w with dict merge, the  protocol implementations are geared more towards request/response.. internally i'm sure they could utilize a yamlstate, but they have additional notions of the api/validation/transformation they want to expose13:43
niemeyerhazmat: Indeed, and that's what the methods in the respective state classes do13:44
niemeyerhazmat: Note that the purpose of the state layer is precisely to give semantic meaning to what otherwise is just storage13:44
hazmatniemeyer, sure, and the protocols implemenation would be in the state package,  part of my reasoning a  concern with some of the practical parts of how big the unit state class and its tests are getting.13:45
niemeyerhazmat: Yeah, I understand, and I agree there are improvements to be made.. just trying to provide some feedback on them13:45
niemeyerhazmat: We shouldn't end up with UnitState.resolved.set(data), UnitState.resolved.get() => data13:46
_mup_ensemble/resolved-state-api r199 committed by kapil.thangavelu@canonical.com14:43
_mup_revert the last commit, removing relation name args to set relation resolved14:43
_mup_ensemble/resolved-state-api r200 committed by kapil.thangavelu@canonical.com14:55
_mup_remove extraneous assertidentical, simplify dict merge, use equality state matching for is_x_running methods.14:55
=== niemeyer is now known as niemeyer_lunch
=== niemeyer_lunch is now known as niemeyer
_mup_ensemble/resolved-state-api r201 committed by kapil.thangavelu@canonical.com17:43
_mup_use constant instead of boolean to make the usage clearer for retry_hooks param to unit/relation resolved.17:43
_mup_ensemble/ensemble-resolved r253 committed by kapil.thangavelu@canonical.com17:54
_mup_use new retry hook constants17:54
_mup_ensemble/expose-provisioning r215 committed by jim.baker@canonical.com17:56
_mup_Collect together requested opened ports by machine for eventual provisioning changes17:56
_mup_ensemble/ensemble-resolved r254 committed by kapil.thangavelu@canonical.com18:09
_mup_address syntatic review comments18:09
_mup_ensemble/refactor-to-yamlstate r199 committed by bcsaller@gmail.com18:52
_mup_Changes per review18:52
_mup_Dict copy returned again rather than YAMLState18:52
_mup_Re-enabled tests of dict copies.18:52
_mup_Fix remaining set_data as string calls (converted18:52
_mup_ to dict)18:52
_mup_ensemble/refactor-to-yamlstate r200 committed by bcsaller@gmail.com18:55
_mup_merge trunk18:55
niemeyerbcsaller: re.18:58
niemeyer"""18:58
niemeyerI allow YAMLState.read(required=True) which will throw an18:58
niemeyerStateNotFound exception which the higher level API can then translate18:58
niemeyer"""18:58
niemeyerbcsaller: The point was specifically about the way in which the code is organized18:58
niemeyerbcsaller: Not about the outside interface18:59
niemeyerbcsaller: test + get leaves a race condition at the +18:59
niemeyerbcsaller: The suggestion was to just do try: get except: do whatever18:59
bcsallergustavo: YAMLState needed to use the product of that get though and didn't currently take its state via __init__19:00
niemeyerbcsaller: I don't understand.. just do it, and catch an error in case it fails?19:00
niemeyerbcsaller: Every try/except involves using the product of the get19:00
bcsallerI understood it as "check existence or throw an error" to "get state and use it if possible or throw an error". I made it so yamlstate can get the state and use it19:01
bcsallerthe get outside of yamlstate didn't avoid the race if I didn't use that data19:02
bcsallerand yamlstate was set up to use the data after read19:02
niemeyerbcsaller:19:03
niemeyertry:19:03
niemeyer    state = YAMLState(client, path)19:03
niemeyerexcept zookeeper.NoNodeException:19:03
niemeyer    # not found19:03
niemeyerbcsaller: ?19:03
bcsallerYAMLState.__init__ isn't async and doesn't check the node19:03
bcsallernor does read normally require it, but there were cases where the existing apis sometimes expect it or check for a specific exception19:04
bcsallerin those cases this lets read raise an error if the node didn't exist19:04
niemeyerbcsaller: Ok, sorry..19:04
bcsallerwhich for YAMLState isn't normally an issue as it will try to create it on write19:04
niemeyerstate = YAMLState()19:04
niemeyertry:19:04
niemeyer    state.read()19:04
niemeyer    yield state.read() # actually19:05
niemeyerexcept zookeeper.NoNodeException: ...19:05
niemeyer?19:05
bcsallerexcept read didn't throw the error19:05
bcsallerI made that behavior optional 19:05
bcsallerwrite would just try to create/merge to the path when it was done 19:05
niemeyerbcsaller: Ok, but the equivalent..19:05
bcsallerso the exception was eaten19:05
niemeyerbcsaller: Hmmm19:06
niemeyerbcsaller: I see what you mean, sorry19:06
niemeyerbcsaller: I misunderstood the comment19:06
niemeyerbcsaller: Sounds fine19:07
bcsallerthere is a question if that type of test is needed at all now though, if the behavior is to create the node in write 19:07
bcsallergustavo: maybe I can make the docstring clearer? if you have a suggestion19:07
niemeyerbcsaller: Maybe it's not.. the problem was just the race19:07
niemeyerbcsaller: I haven't seen the code, which is perhaps the issue19:07
niemeyerbcsaller: (changes were not pushed)19:08
bcsallergustavo: pushed19:08
bcsallerincludes a trunk merge, I was rechecking it for any errors19:09
niemeyerbcsaller: pulling19:09
niemeyerbcsaller: Yeah, it's fine as it is, sorry for jumping to conclusions19:10
bcsallernp19:10
bcsallerkeeping me honest ;)19:11
niemeyerbcsaller: You've mentioned changes in YAMLState and it felt like the actual race wasn't addressed, which clearly is not the case19:11
niemeyerbcsaller: So, removing the test.. hmmm19:11
niemeyerbcsaller: Do you recall where the relation data is first initialized?19:11
bcsalleryou mean hook._setup_relation_data or state.relation._add_relation_state?19:12
bcsaller(I didn't specify that dotpath very well there, left out the class, but I think you know what I mean)19:14
* bcsaller fetches coffee19:14
niemeyerbcsaller: No, I mean the relation state itself19:14
niemeyerbcsaller: We're assuming it exists19:14
niemeyerbcsaller: So someone else must have created it19:14
niemeyerbcsaller: We can't change that logic without understanding that19:15
niemeyerbcsaller: Btw, it looks like none of the changes in protocol.py are required19:15
niemeyerbcsaller: It's probably just left over from the previous version19:16
niemeyerbcsaller: and the changes to YAMLState are also pending tests19:17
bcsallerI did add one test for the required flag raising an exception19:17
* bcsaller checks it over again 19:18
niemeyerbcsaller: Heh, yeah I'm on crack again19:20
_mup_ensemble/expose-provisioning r216 committed by jim.baker@canonical.com19:21
_mup_Remove requested opened ports upon a service no longer being exposed19:21
niemeyerIs it just me or the mouse can't click in Natty every once in a while?19:22
jimbaker niemeyer, i have seen something like this - just gets briefly frozen up19:23
jimbakerin terms of user input19:23
niemeyerYeah19:23
jimbakertimely event loop processing, it's an art ;)19:24
niemeyerNot just briefly actually19:24
niemeyerCan barely use the trackpad19:24
jimbakerfor me i have seen pauses up to maybe 15s, especially when i have initially started. pretty rare however. everything else iirc seems to work in terms of normal refreshing19:26
jimbakerjust the input processing19:26
niemeyerIs there a reset-mouse? :)19:28
_mup_ensemble/unit-agent-resolved r256 committed by kapil.thangavelu@canonical.com19:28
_mup_pass transition variables to action.19:28
niemeyerSwitching to the terminal usually works, but not this time19:28
hazmat`niemeyer, restarting unity from a vterm didn't help?19:29
niemeyerNo, generally kills the whole thing19:30
hazmat`niemeyer,  its worked for me pretty consistently (vterm, kill compiz & gnome-screensaver, unity --replace, back to desktop) 19:30
jimbakerhazmat`, that definitely helped with the true freezes. need to attach that on a sticky note to my laptop ;)19:31
niemeyerhazmat`: Yeah, that seems to have worked19:31
hazmat`multi az/multi region mongodb replica set http://blog.mongodb.org/post/4982676520/mongodb-on-ec2-best-practices19:51
hazmat`trunk has surpassed 1k tests, jimbaker you get a prize ;-)19:58
=== andreas__ is now known as ahasenack
hazmat`bcsaller, fwiw, i didn't get any errors on current trunk20:11
jimbakerbcsaller, thanks for fixing refactor-to-yamlstate, that's working for me now20:24
bcsallerjimbaker: woot20:24
_mup_ensemble/unit-agent-resolved r257 committed by kapil.thangavelu@canonical.com21:19
_mup_fold fire_hooks into transition-variables21:19
_mup_ensemble/unit-agent-resolved r258 committed by kapil.thangavelu@canonical.com21:23
_mup_unit workflow retry actions take an optional flag for fire hooks, workflow definition specifies alias for retry transitions.21:23
_mup_ensemble/unit-agent-resolved r259 committed by kapil.thangavelu@canonical.com21:34
_mup_lifecycle methods sans hook tests21:34
_mup_ensemble/refactor-to-yamlstate r201 committed by bcsaller@gmail.com21:35
_mup_revert minor changes and unused import21:35
hazmat`niemeyer, got a moment?21:51
_mup_ensemble/unit-agent-resolved r260 committed by kapil.thangavelu@canonical.com22:08
_mup_allow unit resolved watch to stop watching.22:08
_mup_ensemble/unit-agent-resolved r261 committed by kapil.thangavelu@canonical.com22:09
_mup_allow unit resolved watch to stop watching.22:09
_mup_ensemble/unit-agent-resolved r261 committed by kapil.thangavelu@canonical.com22:16
_mup_allow unit relation resolved watch to stop watching.22:16
_mup_ensemble/trunk r214 committed by bcsaller@gmail.com22:18
_mup_Merge refactor to YAMLState. [r=niemeyer] [f=770448]22:18
_mup_This branch refactors relation settings to use YAMLState internally. 22:18
_mup_Changes relation_set commands to take a dict rather than a YAML serialized dict .22:18
niemeyerhazmat`: Sorry, missed your question, and about to step out for a break with Ale22:20
niemeyerhazmat`: I'll be back in 1h or so, though22:20
niemeyerhazmat`: Can we talk then?22:21
=== niemeyer is now known as niemeyer_bbl
_mup_ensemble/expose-provisioning r217 committed by jim.baker@canonical.com22:59
_mup_Minimal support for eventual consistency in provider firewalls22:59
hazmat`niemeyer_bbl, tomorrow23:00
hazmat`i'm out to a hadoop meetup23:00
jimbakerhazmat`, have fun23:03
hazmat`jimbaker, thanks23:03
jimbakerreminds me, i promised to give a talk on ensemble + zk for our local hadoop/big data meetup in june23:04
niemeyer_bblhazmat`: Sounds good, enjoy!23:21

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