/srv/irclogs.ubuntu.com/2012/06/11/#juju-dev.txt

twobottuxaujuju: How do I add and call a helper script in a Juju charm? <http://askubuntu.com/questions/149240/how-do-i-add-and-call-a-helper-script-in-a-juju-charm>03:04
rogpeppedavecheney, fwereade_, hazmat: mornin' all06:20
TheMueMorning.06:22
davecheneymornig!06:23
rogpeppeTheMue: hiya06:27
TheMuerogpeppe: Are you an early bird? Or do you have your notebook beside your breakfast? ;)06:28
rogpeppeTheMue: i'm not historically an early bird, but these days i do seem to be waking up earlier.06:28
rogpeppeTheMue: keen to get on with all the stuff that's been rumbling round my head all weekend without access to a computer...06:30
TheMuerogpeppe: No access? You've been on tour? Or did Carmen shut it away?06:30
rogpeppeTheMue: it's boring for Carmen if i spend the weekend hacking :-)06:31
TheMuerogpeppe: Understandable.06:31
davecheneycrap, how did I suddenly get signed up for the intel team spam06:36
davecheneyOOPS: 19 passed, 1 FAILED, sooo close06:42
davecheneyrogpeppe: if I call dummy.StopInstances(nil), should it emit OpStopInstances ?06:43
rogpeppedavecheney: i guess so06:43
davecheneybut passing 0 instances to stop, stops nothing06:44
rogpeppedavecheney: is it not doing so?06:44
rogpeppedavecheney: but the emit is about the StopInstances action; it's not OpStopInstance.06:44
rogpeppedavecheney: i can see an argument for changing that, but that's how it is currently06:44
davecheneyso it's saying I used that method, not that it did anything06:44
rogpeppedavecheney: yeah06:45
rogpeppedavecheney: i think.06:45
rogpeppedavecheney: let me have a looki.06:45
davecheneyrogpeppe: i already knwo the answer :)06:45
rogpeppedavecheney: yes, the idea is that you want to know if the method has been called, even if it, for instance, returns an error.06:46
davecheneyhow could it return an error if you pass no instances to stop06:46
davecheneyarguably that is a NOOP06:46
rogpeppedavecheney: dummy is recording method calls, not actions.06:47
davecheneyrogpeppe: nm I stuck a comment in to explain, we can haggle about it in the review06:48
rogpeppedavecheney: sure06:48
davecheneyFAIL: provisioning_test.go:288: ProvisioningSuite.TestProvisioningRemovesUnknownMachineAfterRestart06:48
davecheneyclose now06:48
davecheneyman, that multiple PA's running inside the test process had me going spare this morniing06:49
davecheneyalso, i'm not sure that defer c.Assert(p.Stop, IsNil) is safe06:49
davecheneyTheMue: does gocheck have a way of running a single test ?06:52
rogpeppedavecheney: go test -gocheck.f regexp06:55
rogpeppe(f for "filter")06:55
davecheneynice06:55
rogpeppeTheMue: a review for you: https://codereview.appspot.com/630707206:55
TheMuerogpeppe: Thx06:56
rogpeppedavecheney: and one for you: https://codereview.appspot.com/630506306:59
davecheneyrogpeppe: why thank you good sir06:59
TheMuerogpeppe: And a LGTM back.07:00
rogpeppeTheMue: thanks07:00
fwereade_morning all07:02
TheMuefwereade_: Moin.07:03
rogpeppefwereade_: yo!07:26
rogpeppedavecheney: there's no point in doing defer c.Assert(p.Stop, IsNil)07:30
davecheneyrogpeppe: not a lot07:30
rogpeppedavecheney: the result will always be the same as not deferring it07:30
davecheneyrogpeppe: won't the Assert failure be recorded somewhere ?07:30
rogpeppedavecheney: because p.Stop is evaluated when you make the defer, not when the defer runs07:30
rogpeppedavecheney: so why bother delaying the inevitable?07:31
davecheneyo_o!07:31
rogpeppedavecheney: you might wanna do defer func() {c.Assert(p.Stop, IsNil}() though :-)07:32
davecheneyof course!07:32
davecheneyanyway, that is enough for me, i'm going downstairs to finish off the last tallboy in the fridge07:35
fwereade_TheMue, did you have any comments on my review of https://codereview.appspot.com/6305067/ -- I suspect I may be missing something08:03
TheMuefwereade_: The idea behind the issue has just been that in the first draft some checks are made after (!) the first node is created. Now all tests are made before so that we have no inconsistent state in ZK.08:05
TheMuefwereade_: https://bugs.launchpad.net/juju-core/+bug/100737308:10
fwereade_TheMue, understood: my contention is that the inputs to that function can only sanely come from service/charm state, and that we should be able to assume that if they don't contain real values we would have errored out already08:11
fwereade_TheMue, it may be that this slapdash cowboyish thinking of the worst sort08:11
TheMuefwereade_: We allways should be able that a caller only uses valid values as arguments of a function. But practice show's we can't. So in case of creating node through atomic functions (sadly no transaction for the whole change) we should check.08:15
fwereade_TheMue, rogpeppe: the stuff of yours that I know of LGTM08:23
TheMuefwereade_: Cheers.08:23
rogpeppefwereade_: thanks08:23
rogpeppefwereade_: am just working on tests for the upgrade stuff, and hoping that gustavo thinks it's ok...08:24
fwereade_rogpeppe, I know the feeling :)08:24
TheMuefwereade_: Btw, most of my little change is already covered in Rogers proposal.08:24
rogpeppeTheMue: which proposal?08:24
rogpeppeTheMue: which change?08:25
TheMuerogpeppe: My verification of endpoints in AddRelation() before doing any change in ZK.08:25
rogpeppeTheMue: oh, i didn't think i had any CL about relation endpoints08:26
TheMuerogpeppe: No, but regarding relations in https://codereview.appspot.com/6303060/08:26
rogpeppeTheMue: that's fwereade_'s proposal08:27
TheMuerogpeppe: Ooops, yep, just seen. :)08:28
rogpeppeTheMue: np!08:28
Arammorning.10:04
TheMueAram: Moin.10:08
rogpeppeAram: yo!10:23
rogpeppefwereade_: just having a look at https://codereview.appspot.com/630507010:27
rogpeppefwereade_: i can't quite see what VersionWatcher gives us that ContentWatcher doesn't already have10:27
rogpeppefwereade_: doesn't a ContentWatcher10:30
rogpeppedelivers a notification10:30
rogpeppe  95 // whenever the note is created, written to, or deleted.10:30
rogpeppe?10:30
rogpeppeoops, intended to edit before pasting :-)10:30
fwereade_rogpeppe, it's more what it doesn't do10:35
rogpeppefwereade_: ah, what doesn't it do?10:36
fwereade_rogpeppe, I don't think there's any need to read and parse the settings node when the actual data is going to be packed up and dumped in a queue somewhere10:36
fwereade_rogpeppe, sorry, "actual data" == "only thing we care about, being the fact of a change"10:37
* fwereade_ suddenly changes his mind, maybe10:37
fwereade_rogpeppe, ok, the issue is this10:37
rogpeppefwereade_: ah, i see.10:37
Arameh, I see that I can't do a plain 'bzr pull' in bzr, do I have to specify branch name all time?10:38
fwereade_Aram, --remember10:38
fwereade_rogpeppe, I think there is a case to be made that we *do* care about the exact settings of a node, and want to persist them, so that when we execute foo-relation-changed we already have access to the remote unit's settings data *at the tinme of the change event*, rather than some time after10:39
fwereade_rogpeppe, ie when the hook happens to execute10:39
rogpeppefwereade_: aren't we *always* seeing data from some time after?10:40
rogpeppefwereade_: due to the inherent nature of networking10:40
fwereade_rogpeppe, yeah, but we're not waiting anarbitrary amount of time and then casually getting settings, just assuming the node is still there10:41
Aramfwereade_: thanks10:41
fwereade_rogpeppe, which is what we do in python10:41
fwereade_rogpeppe, and which bugs me somewhat10:41
rogpeppefwereade_: this seems to me like an argument *for* using ContentWatcher10:42
fwereade_rogpeppe, hence the * fwereade_ suddenly changes his mind, maybe10:42
rogpeppefwereade_: but the problem is that we throw away the content we just read10:42
rogpeppefwereade_: because all the State methods go back to the db rather than using the data we just read10:42
rogpeppefwereade_: (that's probably not true of settings nodes though)10:43
fwereade_rogpeppe, just keeping the content around as a string is all we need10:43
fwereade_rogpeppe, we can load it and use it when we come to actually execute a hook10:44
rogpeppefwereade_: doesn't a ConfigNode keep the original data around? or are you interested in other kinds of node?10:45
fwereade_rogpeppe, I'm interested specifically in presenting to a hook an environment that reflects the state that caused the hook to be triggered, rather than an arbitrary unrelated state10:46
fwereade_rogpeppe, but then I may be on crack here10:46
rogpeppefwereade_: no, that sounds very reasonable to me.10:46
rogpeppefwereade_: and i've been wittering on about something similar10:47
rogpeppefwereade_: (last time i think you said you found the old model ok to work with)10:47
fwereade_rogpeppe, we do already keep track of the "current" members of the relation; I presume we'd actually really also want to keep track of the "current" settings for all members10:48
fwereade_rogpeppe, well, it was ok to work with, but only by coincidence, because we never cleaned up after ourselves and never had nodes disappear on us10:49
rogpeppefwereade_: could you briefly explain to me how relation members are stored in zk?10:49
fwereade_rogpeppe, ok, peer example feels easiest10:49
fwereade_rogpeppe, /relations/relation-XXXXX has 2 children10:50
fwereade_rogpeppe,  "settings" and "peer"10:50
rogpeppefwereade_: oh, i thought that "peer" was an attribute rather than a key10:51
fwereade_rogpeppe, each of those contain config nodes and presence nodes respectively, each keyed on the unit id responsible for maintaining those noes10:51
fwereade_rogpeppe, in a pro/req case, it'd have 3 children: "provides", "requires", "settings"10:51
fwereade_rogpeppe, containing the same data, but with the presence nodes distributed amongs provides and requires depending on which end of the relation they were on10:52
fwereade_rogpeppe, but in general the /path/to/<role> and /path/to/settings structure is the important one10:53
rogpeppefwereade_: ok10:54
fwereade_rogpeppe, there is variation in the /path/to container-scoped relations -- this structure is duplicated for every affected primary unit in the relation10:54
fwereade_rogpeppe, so in practice sometimes /path/to is /relations/relation-XXXX and sometimes it's /relations/relation-XXXX/unit-YYY-ZZZ10:55
rogpeppefwereade_: what does the "settings" node contain?10:55
fwereade_rogpeppe, the unit's private address, at least; but in general anything that is meant to be communicated over that relation, AIUI10:56
fwereade_rogpeppe, the settings nodes are the conduits by which information flows across a relation10:56
rogpeppefwereade_: oh, i'm not sure i understand the distinction between "settings" and "<role>"10:56
fwereade_rogpeppe, the children of the <role> node are presence nodes10:57
fwereade_rogpeppe, when a unit agent joins a relation, it should set its own role node in that relation to alive10:57
fwereade_rogpeppe, when the role node is alive, we watch for settings changes, and stop when the role node is no longer alive10:58
rogpeppefwereade_: all this is as it is in the python?10:58
fwereade_rogpeppe, the actual code is very different but I think I have translated what actually happens with reasonable fidelity10:58
rogpeppefwereade_: the zk structure, i meant10:59
fwereade_rogpeppe, yes10:59
rogpeppefwereade_: so for relationship between two services each with one unit, the structure might look like this: http://paste.ubuntu.com/1035291/11:02
rogpeppe?11:02
fwereade_rogpeppe, yep11:02
rogpeppefwereade_: ok, cool, that's useful thanks.11:03
fwereade_rogpeppe, ok, so, I shall dump version-watcher; unpropose unit-relation-watcher, and rework it to send settings content rather than version; and repropose without reqs11:03
fwereade_rogpeppe, sound good?11:03
rogpeppefwereade_: it's perhaps interesting that presence *could* be conveyed through the config node too, presumably.11:03
fwereade_rogpeppe, it probably could but I'm not entirely sure it should ;)11:04
fwereade_rogpeppe, another question11:04
fwereade_rogpeppe, ChildrenWatcher errors out when the watched node doesn't exist11:04
* rogpeppe goes to look at unit-relation-watcher again11:04
fwereade_rogpeppe, this feels to me inconsistent with other watchers11:05
rogpeppefwereade_: are you actually using ChildrenWatcher?11:05
fwereade_rogpeppe, in an as-yet-unprposed branch, yes11:05
rogpeppefwereade_: to watch what?11:06
fwereade_rogpeppe, related units11:06
rogpeppefwereade_: that info isn't held in the topology?11:06
fwereade_rogpeppe, not the current set of connected units, which updates as agents respond to topology changes, no11:06
fwereade_rogpeppe, the topology is saying "this unit should be in this relation; come on, unit agent, get involved"11:07
rogpeppefwereade_: ah, and then the unit agent creates the nodes under /relations/relation-xxxx ?11:08
fwereade_rogpeppe, the presence node is saying "I, the unit agent, am actively participating in this relation"11:08
fwereade_rogpeppe, and the units on the other side need t know what agents are actually around, not what units we'd like to be around11:08
rogpeppefwereade_: so... in this case, you are guaranteed that the parent node does exist, right?11:09
fwereade_rogpeppe, the way I've written it I'm not11:09
rogpeppefwereade_: because /relations/relation-0000/{provides,requires,settings} is created when the relation is created, no?11:09
fwereade_rogpeppe, it could be but I don;t see a good reason to do so11:10
rogpeppefwereade_: why *wouldn't* you create those node immediately?11:10
rogpeppes/node/nodes/11:10
fwereade_rogpeppe, in container-scoped relations, we create the role node as the unit joins because that's the only point at which we know we need a container-scoped role node under that key11:10
fwereade_rogpeppe, it seems neater to me to *always* create the role node just as the unit joins11:11
fwereade_rogpeppe, just because it doesn't involve smearing the responsibility for it into two rather separate places11:11
fwereade_rogpeppe, so, then, *if* ChildrenWatcher were to treat "node doesn't exist" as "no children, it's cool, I'll wait" rather "OMGBBQWTF", I could use it very nicely11:12
rogpeppefwereade_: BTW why do we care about the presence of the unit at the other end of a relation, rather than just its relation settings?11:12
fwereade_rogpeppe, because a bunch of settings set 3 hours ago on a machine that is now molten slag are of limited value in determining active participation (ie the ability to respond to changes)11:13
rogpeppefwereade_: sorry, what does "responding to changes" mean in this context?11:14
fwereade_rogpeppe, seeing that there's a new unit on the other end of the relation and updating its own settings to match11:14
rogpeppefwereade_: still at sea. "updating its own settings to match" ?11:15
rogpeppefwereade_: apologies for my lack of knowledge in this area!11:15
fwereade_rogpeppe, I am hadoop-master and I just saw a hadoop-slave come online; I consequently perform whatever hadoopy magic is necessary to start me distributing jobs to that slave in addition to all the others11:16
fwereade_rogpeppe, alternatively, I am hadoop-slave and I just saw a hadoop-master appear; I'll set some stuff in my settings so he knows about me and starts sending me jobs11:17
rogpeppefwereade_: ah, so if the presence node isn't active, we assume that the unit has left?11:17
fwereade_rogpeppe, exactly11:17
rogpeppefwereade_: but its settings remain around?11:18
fwereade_rogpeppe, the way I see it, the validity of a settings node is contingent on an active presence node11:18
fwereade_rogpeppe, it should be the UA's responsibility to create its settings node before becoming active11:19
rogpeppefwereade_: but if the unit comes back online, its settings will be as before?11:19
fwereade_rogpeppe, ^^ or update its settings node -- whatever11:19
rogpeppefwereade_: for instance, if there was a network outage and then the node gets reconnected11:19
fwereade_rogpeppe, it's the UA's resposibility to provide sane settings if it's going to declare itself active11:20
rogpeppefwereade_: ok11:20
rogpeppefwereade_: another question: why store the presence nodes under <role> ?11:20
fwereade_rogpeppe, so in that case for example, the UA should surely always update the settings node's private-address when it comes online11:20
rogpeppefwereade_: why not just have a single "presence" directory containing presence nodes for all units participating in that relation?11:21
fwereade_rogpeppe, so that provider units can watch the children of the requirer node, and requirer units can watch the chidren of the provider node, without settings on the same side of the relation causing confusion11:21
fwereade_rogpeppe, with peer relations it works how you describe, but it filters out just its own changes11:21
rogpeppefwereade_: ah, i understand11:22
fwereade_rogpeppe, it's really quite neat once you appreciate the details :)11:22
fwereade_rogpeppe, although honestly I had a couple of aha! moments only just this weekend11:23
fwereade_rogpeppe, seeing what was really going on through the thick fog of twisted was somewhat challenging ;)11:23
rogpeppefwereade_: for subordinate relations what name is used for the presence node directory?11:23
fwereade_rogpeppe, subordinate relations use the unit key of the principal to store the unit relations that exist within that principal unit11:24
rogpeppefwereade_: hazmat suggested that we should copy some of the internal docs to juju-core, and i think i agree.11:24
fwereade_rogpeppe, yeah, that makes a lot of sense11:24
rogpeppefwereade_: example full directory name?11:25
rogpeppefwereade_: is it stored under /units?11:25
fwereade_rogpeppe, /relations/relation-X/unit-A-B/settings/unit-A-B11:26
fwereade_rogpeppe, /relations/relation-X/unit-A-B/settings/unit-C-D11:26
rogpeppefwereade_: ah, so the unit key takes the place of <role?>11:26
rogpeppes/\?//11:26
fwereade_rogpeppe, in which unit-A-B is a unit of the principal service, which has its own container11:26
fwereade_rogpeppe, no11:26
fwereade_rogpeppe, /relations/relation-X/unit-A-B/provider/unit-A-B11:27
rogpeppeoh i see11:27
rogpeppegotcha11:27
fwereade_rogpeppe, /relations/relation-X/unit-A-B/requirer/unit-C-D11:27
fwereade_rogpeppe, ...and unit-C-D is the unit of the subordinate service which shares unit-A-B's container11:27
rogpeppefwereade_: this has been *really* useful BTW. i only had a very very handwavy idea of what was going on before.11:27
fwereade_rogpeppe, it's firmed up my own confidence a lot, there's nothing like someone asking questions to test whether you really know something ;)11:28
fwereade_rogpeppe, so... how would you feel about me making that change to ChildrenWatcher? IMO it's consistent with stuff like ContentWatcher returning {false, ""} for a node that doesn't exist11:29
rogpeppefwereade_: i'm just thinking about it...11:29
fwereade_rogpeppe, and it makes it a lot more useful to me11:29
rogpeppefwereade_: given that this is the first genuine use case for ChildrenWatcher, i'd tend towards +111:32
fwereade_rogpeppe, the other use case is /machines, I think11:33
fwereade_rogpeppe, but it doesn't affect that case11:33
rogpeppefwereade_: i don't *think* so. i think that the provisioning agent watches the topology, not /machines11:34
fwereade_rogpeppe, goodness me, you're absolutely right11:34
rogpeppefwereade_: but as you say, it doesn't affect that case even so11:34
fwereade_rogpeppe, cool, thanks11:35
rogpeppenp11:35
Aramhi niemeyer12:47
niemeyerHello there!12:47
niemeyerAram: Hey man12:47
rogpeppeniemeyer: yo!12:48
rogpeppeniemeyer: welcome back.12:48
niemeyerrogpeppe: Heya12:48
niemeyerThanks12:48
niemeyerIt was a great break indeed12:48
niemeyerHow're you guys doing?12:48
* Aram is drinking his tea.12:49
rogpeppeniemeyer: all good here. in particular i'm eagerly awaiting your reaction to my upgrade proposal12:49
niemeyerAram: Me too, kin dof12:49
niemeyerAram: ChimarrĂ£o, which is a tea, but we don't call it as such :)12:49
Aramheh.12:49
niemeyerrogpeppe: How did it change?12:50
rogpeppeniemeyer: did you see my post on juju-dev?12:50
niemeyerrogpeppe: I haven't read it yet12:50
niemeyerrogpeppe: But I was expecting to see it close to what we talked12:50
rogpeppeniemeyer: well, yeah, it's changed, but in a good way, i think. i decided that what we'd arrived at wasn't sufficient.12:50
niemeyer(s/was/am/)12:50
niemeyerrogpeppe: Ok, will read it12:51
rogpeppeniemeyer: it's not good to just exit and let upstart deal with that.12:51
niemeyerBut first let me warm up the chair :)12:51
rogpeppeniemeyer: :-)12:51
niemeyerrogpeppe: How so?12:51
niemeyerWell, you probably explained it in the mail12:51
rogpeppeniemeyer: yeah, hopefully sufficiently...12:51
Aramniemeyer: a simple branch for you to review: https://codereview.appspot.com/6298062/ I have some more in the pipe, but everything depends on this.12:55
niemeyerAram: Looking12:55
hazmatniemeyer, g'morning12:57
niemeyerhazmat: Heya12:59
niemeyerAram: Going through the description12:59
niemeyerAram: Can we talk a bit about which issues you've found that required the several attempts to be done13:00
Aramwell yes, sure, I did 1, 2, and 3, 4 was out of the question because preserving Path uniqueness was too important.13:02
Aramusually the most direct way of doing these things is 3, make each node remember its children.13:02
Arambut this is not too great.13:02
niemeyerAram: Where's the dot int hat sentence? :13:03
niemeyer:)13:03
niemeyerAram: I guess you did (1, 2, and 3)?13:03
Aramyes13:03
niemeyerOk13:03
niemeyerAram: So what were the issues you've found with 3?13:04
AramYou need to update parent when you create/delete a child, this is not optimal.13:04
niemeyerAram: What were the issues you've found with that?13:06
Aramit can be unreliable and makes the code significantly more complex. in my experience with namespace-like things, it is usually a design error for a high level call to generate multiple independent exported operations. having a 1:1 API-atomic operation model is useful and easier to debug and understand.13:07
niemeyerAram: Okay, but I'd appreciate understanding more about the decision. You're saying it's unreliable and complex, and breaks a property that you like, but why?13:08
niemeyerWhy is it unreliable and complex, and why do we need such a property13:08
Aramit has more points of failure, e.g. it can create the node but fail to update its parent and the code to deal with such failures is complex.13:09
niemeyerAram: Ok, agreed13:10
niemeyerAram: Why do we need a parent node within a child?13:10
niemeyerErm.. s/node/field/13:10
Aramso we can query a node for its children efficiently. if we have a node 'path' and we want its children we query the DB for nodes with parent 'path'. it's very fast.13:14
Aramif we don't have a parent field it's more complex, in /a/b/c a query for ^/a yields both b and b/c, and we want only b, so we need to filter direct descendants client side.13:14
Aramwe could construct a more complex regexp, but it would not use the index, so it would be slow to use.13:15
Aramthis slight bit of redundancy was the only way I could come with so that we could use the index at all times.13:15
niemeyerAram: We'd use the index at all times anyway. What you're avoiding is the cost of excluding entries at either side13:17
Aramyes.13:17
niemeyerAram: Probably not worth it13:17
rogpeppepresumably for getting children of /, the query would return all entries in the tree13:17
Aramyes13:18
niemeyerHmm13:19
rogpeppebut for our use case, perhaps we don't care too much, as we only do GetChildren on shallow nodes.13:19
niemeyerFair enough.. it'd suck to have to walk through the entire tree for these cases..13:20
niemeyerA bit sad that we'll need an extra index, though13:20
niemeyerAram: Did you put some thinking onto what we briefly talked about at London?13:21
Aramthe watchers thing? yes, working on it.13:21
niemeyerAram: Regarding the fact a parent doesn't have a well-defined number of children for a given version13:22
Aramah, that one, sure. it's in the pipe.13:22
AramI decided to Create to behave like mkdir -p13:22
niemeyerAram: Well, I don't know if we care yet.. I just would like to understand whether we do or not, and what we're ignoring13:22
niemeyerAram: in which sense?13:23
Aramto create all necessary nodes. e.g create /a/b/c creates /a and /a/b if required.\13:23
AramI'm not sure if we care that much, but ATM we always return a stat of the parent when querying for children.13:24
Aramso it's easy if the parent really exists.13:24
niemeyerAram: It's a bit more involved than that13:25
niemeyerAram: In the design we're leaning towards, the same parent version may have a different number of children13:25
niemeyerAram: Which I don't think can happen on real zk13:25
niemeyerAram: Maybe we don't care about that, but that should be a conscious decision if nothing else13:26
rogpeppei think having Create work like mkdir -p is quite a big semantic change13:26
Aramwell, if we decide that old parents are immutable in the sense that only new versions may aquire new children, it would be a simple thing to arrange for. I'm not sure if we care about that, but I could look at how we use ZK today.13:28
Aramrogpeppe: yes, it's quite a big semantic change, but I think it's for the better, it should make things easier, not harder.13:29
niemeyerAram: Thanks, the key is really to understand which path we're going down towards.. not suggesting we should implement the exact semantics at this point13:30
rogpeppei'm trying to remember the awkward case i came up with before that meant that it wasn't great to make directories implicitly13:31
* rogpeppe fails13:35
niemeyerAram: Review in13:37
Aramthanks13:39
Aramreading13:39
Aramniemeyer: what race? (probably I have a wrong assumption about mongodb).13:43
niemeyerAram: Duh, sorry, the comment went into the wrong location13:46
niemeyerAram: The race I was alluding to is the creation of nodes without parents13:46
Aramniemeyer: I am aware of that race, don't have a good idea on how to solve it yet, have a few ideas though. at the moment you can create nodes without parents, but you can't query the non-existent parents for children.13:57
Aramthat means you don't get stale data, but an error, which is probably better.13:57
niemeyerAram: Both sound bad13:58
niemeyerAram: and they're both related to how we store children information.. we shouldn't dive in onto a path before we understand how we're handling this13:58
hazmatrogpeppe, adding ml to our upgrade discussion, forgot to add it on the initial reply14:14
rogpeppehazmat: oh good catch, i hadn't noticed that14:15
hazmatrogpeppe, apparently i fubar'd the second time two. third times the charm14:20
TheMueHmm, could it bee that proposals for juju-core don't lead to a notification in IRC?14:21
niemeyerAram: Any ideas around that?14:23
Aramniemeyer: yes, thinking, will email, probably better than IRC for explaining :).14:23
niemeyerAram: Sounds good, although in some cases IRC works better14:23
Aramsure14:23
mrammSo, I'd like to bring up something for the team to discuss15:02
* fwereade_ listens15:03
* TheMue listens too15:03
mrammcurrently we are making good progress15:03
mrammbut it's hard to explain what that progress is or how far along we are to folks outside of the team15:03
mrammand I would say a little bit hard for the team itself to know what exactly needs to be done before 12.1015:04
mrammI don't want to create any kind of heavyweight process, but I think it would be helpful to have a bit more status information15:05
mrammit was suggested to me that we use blueprints and a list of work items for each blueprint to track what needs doing15:05
mrammI think that if we keep it at that kind of high level, we should not have to spend much time on it15:05
rogpeppeniemeyer: ^15:06
niemeyermramm: This sounds like a nice topic for the mailing list15:06
niemeyermramm: We have members of the team that are not here, and people are not necessarily listening right now15:06
mrammhttps://blueprints.launchpad.net/ubuntu/+spec/servercloud-q-arm-deployment would be an example (look at the work items)15:06
mrammniemeyer: yea15:07
niemeyermramm: For example, aren't you supposing to be listening to that bad music waiting for a conference call with mark right now? :-)15:07
niemeyerrobbiew: Is that meeting happening?15:07
robbiewniemeyer: man...I suspect not15:08
robbiewit is 11:08pm in Taipei15:08
robbiewthis music is SO awesome though :/15:08
niemeyerrobbiew: I don't understand why we don't have just a short beep every once in a while or some such to notify about the fact the call is still up15:09
niemeyerrobbiew: It's so obviously counter productive to make people wait with bad music with absurd audio quality15:09
robbiew10min rule...I'm dropping15:10
niemeyerDitto15:10
robbiewmramm: fyi ^^15:12
robbiewwe dropped15:12
mrammI got in in time to drop ;)15:12
mrammSo, my plan is not to decide what to do here on IRC15:12
mrammbut just to raise the issue so that you all have time to think about it15:12
hazmatthe music is getting better ;-)15:13
mrammIf we use work items on blueprints we can get in on the burn-down chart action here: http://status.ubuntu.com/ubuntu-quantal/group/topic-quantal-servercloud-arm.html15:13
mrammand have it rolled up to this: http://status.ubuntu.com/ubuntu-quantal/canonical-server.html15:14
mrammSo, anyway, food for thought.   I'll raise this on the list for wider discussion15:15
TheMuemramm:  Success, thoughts are already running. ;)15:20
niemeyerLunch time.. back later folks15:47
TheMueniemeyer:  Enjoy.15:47
* rogpeppe is off for the evening. see y'all tomorrow.18:04
mrammhave a good evening!18:04
rogpeppemramm: will do, thanks!18:04
niemeyerrogpeppe: Cheers man18:13
twobottuxaujuju: How do I gracefully shutdown a Juju Charm? <http://askubuntu.com/questions/149550/how-do-i-gracefully-shutdown-a-juju-charm>18:57
twobottuxaujuju: How do I make a Juju Charm's revision match the Bazaar revision of its repo? <http://askubuntu.com/questions/149553/how-do-i-make-a-juju-charms-revision-match-the-bazaar-revision-of-its-repo>19:09
robbiewmramm: ping19:20
mrammrobbiew: pong19:22
robbiewmramm:  1:1 time? (actually about 23min ago, but I assume my private msg was missed)19:23
mrammrobbiew:  sure19:24
niemeyerfwereade_: ping19:33
fwereade_niemeyer, pong19:34
niemeyerfwereade_: Heya19:34
niemeyerfwereade_: Looking over the unit relation watching stuff19:34
niemeyerfwereade_: Was just pondering about the choice of merging both watchers onto one19:34
fwereade_niemeyer, cool, hopefully not too crackful...19:34
niemeyerfwereade_: I don't have much of a feeling, but mostly wanted to learn from you why you felt this was a good direction19:34
niemeyerfwereade_: It's not19:35
fwereade_niemeyer, it seemed natural, I think, because the validity of the settings node is contingent on the presence node; and so synchronising th ewatching by putting them together seemed sensible19:36
fwereade_niemeyer, we get a single stream of events representing everything we care about for a single relation19:36
fwereade_niemeyer, single *unit* relation19:37
niemeyerfwereade_: Well, kind of.. there are apparently a disjoint set of methods?19:38
niemeyerfwereade_: E.g. settingsChange19:38
niemeyerfwereade_: Ah, I see.. but it's routed into a single chan19:38
fwereade_niemeyer, are you on https://codereview.appspot.com/6305082/ ?19:39
niemeyerfwereade_: Is your idea to expose this watcher as part of the API?19:39
fwereade_niemeyer, I thought I deleted the earlier proposals, I'm pretty sure settingsChange is gone19:39
fwereade_niemeyer, not this one, no; there will be a RelatedUnitsWatcher returned from UnitRelation.WatchRelated19:39
niemeyerfwereade_: There is a single patch set in that CL19:39
niemeyerfwereade_: (with settingsChange in)19:40
fwereade_niemeyer, it originally depended on a prereq we decided to drop19:40
niemeyerfwereade_: Am I reviewing the wrong thing?19:40
fwereade_niemeyer, I think you might be... are you sure you're on the one I linked?19:41
fwereade_niemeyer, (did I paste the wrong one in themail..?)19:41
niemeyerfwereade_: Have you opened the link you pasted? :-)19:41
fwereade_niemeyer, yes; it seems to me to have:19:42
fwereade_+// unitRelationChange describes the state of a unit relation.19:42
fwereade_+type unitRelationChange struct {19:42
fwereade_+ Present bool19:42
fwereade_+ Settings string19:42
fwereade_+}19:42
niemeyerfwereade_:  501 func (w *unitRelationWatcher) settingsChanges() <-chan watcher.ContentChange {19:42
fwereade_niemeyer, ah sorry, that errant "s" had me barking up completely the wrong tree19:43
fwereade_niemeyer, an earlier version had a settingsChange type19:43
fwereade_sorry :)19:43
niemeyerfwereade_: Ah, phew, ok19:43
niemeyerfwereade_: So this watcher is the underlying implementation of an aggregated channel that will dispatch on all units?19:47
fwereade_niemeyer, yeah, there will be a RelatedUnitsWatcher that starts one of these for each candidate related unit19:48
niemeyerfwereade_: Fun19:48
fwereade_niemeyer, it was a fun w/e actually, I have half a dozen unpushed branches labelled things like another-abortive-ruw-attempt19:49
niemeyerfwereade_: LOL19:49
fwereade_niemeyer, but it's definitely an awful lot simpler than the first attempts19:50
niemeyerfwereade_: Yeah, looks quite reasonable19:50
niemeyerfwereade_: Missing some docs here and there, but nothing major19:50
fwereade_niemeyer, cool, the followup is a little more complex, but I hope it won't be too bad -- I'm pretty sure it's an improvement on the twisted stuff which frankly made my brain hurt19:52
niemeyerfwereade_: I'm having a feeling that the watcher infra on the mongo+zk will have to be optimized pretty soon19:52
* niemeyer looks at Aram19:52
fwereade_niemeyer, I'm vaguely hoping one of you will take one look and shear off another layer of complexity ;)19:52
niemeyerfwereade_: Oh, I had the feeling that the follow up would actually be simpler19:52
fwereade_niemeyer, if it were just children changes I had to worry about it probably would be19:53
niemeyerfwereade_: Isn't that a sign that the joint watching may not be helping after all?19:53
fwereade_niemeyer, a lot of the hassle in in accommodating the fact that a presence node can exist but not actually indicate presence19:53
niemeyerfwereade_: Why is that so?19:54
fwereade_niemeyer, because that's how presence nodes are designed19:54
niemeyerfwereade_: Sure, but that's why we have the abstraction on top of them19:55
niemeyerfwereade_: We have a nice on/off answer from it, right?19:55
fwereade_niemeyer, yes, and the unitRelationWatcher makes it nicer still19:56
fwereade_niemeyer, but19:56
fwereade_niemeyer, the RelatedUnitsWatcher also needs to deal with tedious stuff like keeping the key:name mapping going, plus a bit of bookkeeping for the watchers, then some way of tracking state...19:56
fwereade_niemeyer, in terms of goroutines and channels it's pretty simple really19:57
fwereade_niemeyer, the devil is as always in the details19:57
niemeyerfwereade_: Yeah19:57
niemeyerfwereade_: It's quite readable to be honest20:03
fwereade_niemeyer, cool :)20:03
niemeyerAram: Seriously, let's talk briefly about watches when you have a moment20:04
niemeyerAram: We should have a single watching goroutine per process20:04
niemeyerOr we'll explode the server with a ridiculous number of threads20:04
Aramniemeyer: hmm... one goroutine per process, hmm. this complicates things a bit.20:09
Aramnow is a good time as every to discuss this20:09
Aramever20:09
Aramwell20:11
Aramhmm20:11
niemeyerAram: I thought it was late for you20:17
niemeyerAram: We can discuss now if you still have the energy20:18
Aramit's late but I think it's fine :).20:18
niemeyerAram: While reviewing fwereade_'s branch, it's apparent we'll have quite a few watches per process20:20
niemeyerAram: If we have a model where each watch we attempt yields a new session with a new watch, we'll end up with a massive number of threads20:20
niemeyerAram: All locked down waiting20:21
Aramniemeyer: in doozer you can do watch(path, ver), but from what I can see in zk you can only do watch(path), if that is the case, it's easy to use a single goroutine and zk session to read the oplog. if we also care about versions, it's more complex, still doable.20:21
niemeyerAram: With zk we have watch(path) => ver, in a way20:22
niemeyerAram: The watch will be a delta against ver20:23
niemeyerAram: Or rather, a note stating that ver has changed20:23
Aramniemeyer: that is fine, the design seems simple. a single goroutine always loops reading from the oplog, at each step it checks to see if that operation has a path someone is interested in, if so, makes the notification.20:26
niemeyerAram: Yeah.. I don't have real world experience with this, but I suspect it should be cheap, since it's a naturally ordered collection (no index, queries, or anything else really)20:26
Aramyes.20:27
niemeyerAram: interestingly, I suspect this will make the design a lot simpler in some ways, since we can start the watch upfront, before any watch requests arrive20:28
Aramyes, that's the way it should be done.20:28
Aramniemeyer: btw, I know that it's this way because this is the way zk works, but is there a real reason why we care that create and set are different? (have to do create before set).20:30
niemeyerHmmm20:31
niemeyerAram: If one tries to Create a node, and there's one previously existent, a race was lost.. this is a pretty relevant fact for the distributed nature of the system20:32
niemeyerAram: Without distinction, the algorithm would go on pretending all was good20:32
Aramnot really, set should be set(path, data, ver), in effect compare-and-swap. you could specify a version for set, if there were already a node, you'd know.20:33
niemeyerAram: Sure.. we can easily call Create as Set(version=-1).. then of course there's no distinction :)20:35
niemeyerActually, not entirely.. Set(version=-1) exists.. it means change whatever the version20:36
niemeyerCreate means change with non-existing-version20:36
niemeyerSo, yeah, doesn't work20:36
Aramniemeyer: I know that Set(version=-1) changes whatever the version, this idea doesn't exist in doozer, you can't change without caring for the version, and there's no create, only set.20:38
niemeyerAram: Cool, so the primitives are similar..20:39
davecheneyniemeyer: i was going to extract shortattempt so I can reuse it in the PA today22:12
davecheneyso it will need a package, do you have any preferences ?22:12
niemeyerdavecheney: It's a good question22:13
niemeyerdavecheney: Good morning, btw22:13
davecheneyand to you :P22:13
davecheneyniemeyer: some suggestions are lp/juju-core/juju/util22:15
davecheneyor even at the top level22:15
davecheneylp/juju-core/juju22:15
davecheneyor in go style22:15
davecheneylp/juju-core/juju/jujuutil22:16
davecheneynone are particularly good22:16
niemeyerdavecheney: Indeed22:16
niemeyerdavecheney: I'm always afraid of that kind of package because they end up as a bag of undefined things22:16
davecheneyniemeyer: oh yeah, com/atlassian/confluence/bucket22:16
davecheneywhich was so named so people would feel ashamed of importing or using it22:17
niemeyerdavecheney: :)22:17
davecheneywhich didn't work22:17
davecheneycom/atlassian/confluence/bucket222:17
davecheneyno kidding22:17
niemeyerdavecheney: I suggest environs, for the moment22:17
davecheneyniemeyer: as good as any22:17
niemeyerdavecheney: It's not a great fit either, but we can look at it as a utility to be used in the implementation of environments, with aspirations of promotion onto a better home22:18
davecheneyor I could just copy the bits I need into cmd/jujud and we defer the discussion until we have a better example ?22:18
niemeyerdavecheney: Nah, the bad taste of a misplaced type is easy to fix.. code duplications tends to grow much uglier legs22:19
davecheneyniemeyer: understood, i'll make it so22:20

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