/srv/irclogs.ubuntu.com/2012/08/24/#juju-dev.txt

niemeyerBaking another mgo release01:13
davecheneylp is really giving me the shits today01:56
davecheneylucky(~/src/launchpad.net/juju-core) % lbox propose01:56
davecheneyerror: Failed to load data for member "dave-cheney": Get https://api.launchpad.net/devel/~dave-cheney: unexpected EOF01:56
niemeyerdavecheney: Aw01:57
niemeyerdavecheney: Hmm.. they might be doing a release01:57
niemeyerIt used to be thursday-evening/your morning01:57
davecheneynope, just needs persistence01:57
niemeyerOuch :)01:57
davecheneyniemeyer: i have a suspicion that these EOF problems we see, are possibly related to the high concurency failures that others are finding in the http package01:58
niemeyerdavecheney: Hmm.. perhaps01:59
niemeyerOkay, that's bed time for me02:00
niemeyerHopefully will go through the full night today02:00
niemeyerdavecheney: Have a good day man02:00
davecheneyyou too mate02:01
Aramheyheyhey07:32
TheMuemorning07:40
Aramyo07:41
AramTheMue: good news07:41
Aramwe have watchers07:41
Arammachine,service,unit, and relation watchers07:41
TheMueAram: cheers, great! +107:41
TheMueAram: integration of life and moving it into the own file also go on07:44
TheMueAram: did you see the list of missing tests?07:44
wrtpAram, TheMue: mornin'07:45
TheMuewrtp: morning, today as wrtp?07:46
=== wrtp is now known as rogpeppe
rogpeppe:-)07:46
TheMue:P07:49
* TheMue watches the creeps on his arm and once again things that starting the day with listening loud to Porcupine Tree is a good idea08:13
AramTheMue: yes, saw the list of missing tests, great.08:21
Aramrogpeppe: yo.08:21
Aramfwereade: hey08:21
fwereadehey Aram, hey everyone08:21
AramTheMue: there will be some pain merging our branches.08:22
AramTheMue: I want to do it today as monday I won't be here.08:22
Aramtaking a day off.08:22
TheMuefwereade: heya08:23
fwereadeTheMue, heyhey08:23
TheMueAram: ok, my next step is pushing the unit life extension in and then continue with moving life into an own file with own tests as you've seen. got reviews here.08:24
TheMueAram: will your txn stuff go in today?08:24
AramI hope.08:24
Arambut if it doesn't you can pull it and use it as -req08:25
TheMueAram: ok08:27
Aramdoez bzr have something like: git merge --strategy=ours?08:52
Aramthat makes the VCS acknowledge the merge, but doesn't do any change.08:52
Aram(git also has theirs instead of ours, btw).08:52
Arambzr resolve --take-this08:53
Aramworked :).08:53
Aramerror: Failed to update merge proposal log: EOF09:03
Aramdie09:04
TheMueAram: i pulled your branches, how can i set them as prerequisite of my already existing life branch?09:30
Aramyou need to create a new branch where you merge them.09:35
Aramwell09:35
Aramnow I'll push some approved branches to trunk09:36
TheMueAram: ic09:38
TheMueAram: hoped to have the txn stuff in for life.go09:38
AramTheMue: I think it would be very counterproductive to be working on anything lifecycle related until the txn stuff is not in. I'm already fighting merging wars ATM :).09:59
AramI'll do my best to have everything ready by the end of the day, so you can pick it up on monday. In fact it may be ready earlier in the day.09:59
AramPerhaps you could look over state/presence in the meantime? I only glanced over that.09:59
TheMueAram: right now i handle the lifecycle review (w/o txn), mostly improving the tests for readbility10:01
TheMueAram: i've already outlined txn in lifecycle depending on your branch and the first look has been easy10:02
AramTheMue: btw, with txn and watchers, tests already take 18 seconds :(.10:02
TheMueAram: but that'll be a second step after the merge w/o txn10:02
TheMueAram: hehe, as expected, but still fast10:02
TheMueAram: for presence we'll have to see how to do it, i'll take a look. which is your watcher branch?10:04
Aramlp:~aramh/juju-core/58-mstate-watchers-basic, but pull lp:~aramh/juju-core/59-mstate-bson-D-trivial because it's better10:05
Arambtw, I'm updating those as we speak so caveat emptor.10:05
TheMueAram: thx10:06
TheMueAram: interesting that you prefix them with a number, dave imho does so too while others are doing a go-mstate-… or go-worker-...10:07
Aramit's easier to see them and the relationship between them this way10:07
TheMueAram: watchPollFreq = 1000 * time.Millisecond, why not time.Second?10:14
AramI change it all the time, and usually make it much less10:14
TheMueAram: ok, and I've seen that you impl stuff like State.WatchMachines() in watcher.go. in state the watchers are in watcher.go but their usage is in their type file, here state.go10:17
AramI know, it was a conscious decision.10:18
Aramwe talked about it with rogpeppe at lisbon.10:18
TheMuei'm not happy with it, watcher.go reads very confusing due to the type jumping. every few lines a context change10:20
TheMuei had been so happy about williams work to order state regarding the tests10:21
AramI am not happy with the old way :).10:22
TheMueso that stuff that belongs to each other is close10:22
TheMuefor me due to maintenance reasos it's hard to have code for one type so distributed10:23
TheMuereasons10:23
TheMueit may be ok just in the moment of development, because the developer knows where the stuff is10:24
TheMuebut it's hard for anyone who is new to the code10:24
Aramit's the oposite to me. if I want to look at the watchers, I want to see the function that creates them close to the watchers.10:25
Aramit's very annoying to me every time I modify something not to find the function that creates the thing that I modified right away so I can modify that too.10:26
TheMueand if you want to look at the service you don't expect its code in 5 different files10:26
AramI need to grep since I have no idea what file it's in10:26
TheMueso you can turn it around depending from which directions you ome10:26
TheMueoderwise we could have a file where all naming stuff is handled, one for all txn stuff, one for all resolved stuff, one for all ports stuff10:27
TheMueand so on10:27
TheMuemy question is: are you interested in technological details or in the business object/entity10:28
Aramif I modify a thing, say a data model for a type, it's very likely that I need to also modify the thing that creates it. so I want the function that creates the watchers to be close with the watchers, the function that creates the service to be close with the service (e.g. in service.go, not state.go as it is now) etc.)10:28
TheMuei've often seen that later you're interested in the entities, because the biusiness needs are changing10:29
TheMueAram: why isn't Service.AddUnit() in unit.go?10:30
Aramit should be10:30
Aramit isn't because I just emulated state10:30
TheMueAram: ok, so today it's inconsistent, what makes it even more difficult. history in state is in the py implementation. i would ask you to talk to niemeyer for a clear direction10:31
TheMueAram: i can live with both, so that we can harmonize it10:32
Aramyes, it's bad that it's inconsistent.10:32
Aramit should be consistent.10:32
TheMue+110:32
TheMuelunchtime11:02
AramTheMue: you might want to pull again, significant changes, I merged your first branch that you pushed to trunk. I had to change ensureLife signature.11:24
Aramone new *State param plus another int return.11:25
TheMueok11:27
TheMueAram: what do you thing about a signature change to ensureLife(State, Collection, Id, Life, Descr) (rev, error)?11:32
TheMueAram: i think it would be more logical this way11:32
AramTheMue: I'll do it right away in this branch.11:33
TheMuecheers11:33
AramTheMue: done, pull lp:~aramh/juju-core/60-mstate-ensureLife-sigchange11:39
TheMueAram: done too, great, tyvm11:41
AramTheMue: I updated the test list document, as now we have all confignode tests and some watcher tests11:54
TheMueAram: great11:55
TheMueAram: how do i select something in mgo if i have the collection as string and the id?12:14
TheMuecollection name12:14
AramDB("").C(colname).FindId(id)12:15
Aramsession.DB("").C(colname).FindId(id)12:15
TheMuetyvm12:16
fwereade_Aram, TheMue, rogpeppe: anyone free for a potentially bikesheddy conversation?12:38
rogpeppefwereade_: sure12:38
TheMuefwereade_: go ahaed12:38
fwereade_rogpeppe, TheMue: ok, this is about state persistence for the uniter12:38
rogpeppefwereade_: by which you don't mean "State", presumably... :-)12:39
fwereade_rogpeppe, TheMue: sorry, local state; anyway for the purposes of this discussion, we care about hook state and charm state12:39
rogpeppefwereade_: ok12:39
fwereade_rogpeppe, charm state is Installing, Deployed, Upgrading, Conflicted12:39
TheMueic12:39
rogpeppefwereade_: ok12:39
fwereade_rogpeppe, hook state is Running, Commiting, Complete12:39
rogpeppecommitting :-)12:40
fwereade_rogpeppe, when we have installed the charm itself, we always want to run the install hook12:40
fwereade_rogpeppe, yes indeed :)12:40
rogpeppefwereade_: ok12:40
fwereade_rogpeppe, what I do at the moment is set the charm state to Installing, install the charm, and leave that state around until I've written Running for the followup hook12:41
TheMueso far reasonable :)12:41
fwereade_rogpeppe, TheMue: before running the actual hook, I set charm status to Deployed12:41
fwereade_rogpeppe, and so the states overlap neatly and I can always come back up to roughly where I was is the process goes down12:42
TheMuefwereade_: so 1st hook.Running, then charm.Deployed, then hook.Run()12:42
rogpeppefwereade_: ok12:42
fwereade_rogpeppe, TheMue: *but* it is a bit weird to be messing around setting charm states as part of the runHook method12:42
fwereade_TheMue, exactly12:42
fwereade_rogpeppe, TheMue: now, most of the time, the Mode funcs return the result of a func called hookStateMode12:43
rogpeppefwereade_: it kinda seems reasonable for the install hook to be doing that.12:43
fwereade_rogpeppe, well, indeed, it's not *bad* but it gave niemeyer pause12:43
rogpeppefwereade_: uh huh12:43
fwereade_rogpeppe, so anyway there is a conventional way we choose the next mode to go to12:44
fwereade_rogpeppe, I was wondering whether adding a Queued state to hook might be neater12:44
rogpeppefwereade_: what would Queued imply?12:44
fwereade_rogpeppe, "next time you call hookStateMode, it will run this hook for you"12:45
rogpeppefwereade_: ah, queued to run but not actually running?12:45
fwereade_rogpeppe, yeah12:45
fwereade_rogpeppe, TheMue: so charm.Installing -> hook.Queued -> charm.Deployed12:46
rogpeppefwereade_: so then it would be hook.Queued, charm.Deployed,, hook.Running12:46
fwereade_rogpeppe, yep12:46
rogpeppefwereade_: that seems reasonable to me.12:46
rogpeppefwereade_: would hooks *always* go through a Queued state?12:46
fwereade_rogpeppe, TheMue: the issue for me is that the transition to running hides away in hookStateMode, which is... well it is an obvious place to find it, I guess12:47
fwereade_rogpeppe, I don't think they have to -- but I can't offhand think of a reason they shouldn't12:47
rogpeppefwereade_: what's hookStateMode again? is it that func type?12:47
fwereade_rogpeppe, yeah, it does a few things12:47
fwereade_rogpeppe, it goes straight to ModeHookError if a hook is apparently Running12:48
fwereade_rogpeppe, if it's Committing, it recommits12:48
fwereade_rogpeppe, if it's Complete, the next mode is determined by what the hook was12:48
rogpeppefwereade_: isn't it better to think of it as an action that does whatever is appropriate and returns the next action?12:48
TheMuefwereade_: and the func is selected based on the state?12:49
fwereade_rogpeppe, yeah, I think I've convinced myself, and I think I probably need a better name then hookStateMode12:49
rogpeppefwereade_: so then it's evident that *of course* that's where to find the next mode, because that's how all mode transitions work.12:49
rogpeppes/the next mode/the transition to running/12:49
rogpeppefwereade_: i think hookStateMode is fine.12:50
fwereade_rogpeppe, if it's running hooks as well itself that doesn't feel quite right12:50
fwereade_TheMue, yes, the next mode func will be Starting if the last hook was Install, and Started in all other cases12:50
rogpeppefwereade_: perhaps "uniterMode" might be more appropriate12:51
fwereade_TheMue, (so far, anyway, unit lifecycle will change that a bit I think)12:51
rogpeppefwereade_: or just "mode" :-)12:51
fwereade_rogpeppe, ha, maybe12:51
rogpeppefwereade_: 'cos it actually represents the global state of the uniter, right?12:51
fwereade_rogpeppe, well, in a sense, yeah12:52
TheMuefwereade_: to me transit sounds more natural, coming from a state, going to a state (maybe the same)12:52
rogpeppefwereade_: i saw that top level loop... that's all it does :-)12:52
fwereade_TheMue, that's a wrinkle, if we're returning to the same state we're doing it wrong12:53
rogpeppeTheMue: i think "mode" represents the "mode of operation" between states quite well.12:53
fwereade_TheMue, no sense shutting down a bunch of watches only to restart them and handle the initial events all over again12:53
rogpeppefwereade_: we return to the same state when we crash :-)12:53
fwereade_TheMue, rogpeppe: and what this then means is that hookStateMode is not the *only* thing that causes a state transition -- it's just the usual thing to do so12:53
rogpeppefwereade_: sorry, i missed something. what else causes a state transition?12:54
fwereade_rogpeppe, if we're in ModeStarted, for example, we run the hook and directly return ModeHookError if it fails12:54
fwereade_rogpeppe, we don't want to leave ModeStarted12:54
rogpeppefwereade_: isn't it ModeStarted the thing that runs the hook?12:55
rogpeppes/it //12:55
fwereade_rogpeppe, in that case, yes12:55
rogpeppefwereade_: isn't ModeStarted a hookStateMode?12:56
fwereade_rogpeppe, sorry, no12:56
rogpeppefwereade_: ah, why not?12:56
fwereade_rogpeppe, hookStateMode is a single func that returns a mode func, based on hook state12:56
rogpeppefwereade_: seems odd that it's not, but i'm probably missing something12:56
rogpeppeah!12:56
rogpeppei thought that each mode returned the next mode to transition to.12:57
fwereade_rogpeppe, yes it does12:57
fwereade_rogpeppe, sorry, I am clearly communicating something really badly12:57
* rogpeppe goes to the source12:57
fwereade_rogpeppe, as it happens, though, hookStateMode itself *does* have the right signature to be itself a mode12:58
rogpeppefwereade_: where's hookStateMode defined and used?12:58
fwereade_rogpeppe, modes.go, 2nd func, used throughout12:59
fwereade_rogpeppe, sorry it's still called nextMode in that proposal12:59
rogpeppefwereade_: ah!12:59
* rogpeppe finds the if ... { return } elses distracting13:00
rogpeppefwereade_: i think nextMode is perhaps a better name. or hookNextMode.13:01
fwereade_rogpeppe, I'm thinking the signature is telling me it should be ModeSomething13:02
rogpeppefwereade_: perhaps "deduceNextMode"13:03
rogpeppe:-)13:03
fwereade_rogpeppe, I'm starting to actually feel fond of ModeTransition13:03
rogpeppefwereade_: another way of slicing it would be that if a mode returns nil, the main loop would call nextMode13:03
rogpeppefwereade_: 'cos it seems to me that the modes are only returning nextMode because they don't really know what's going to happen next.13:04
fwereade_rogpeppe, I experimented with that, felt a bit off in practice13:04
fwereade_rogpeppe, well, not really, they're returning it because while the logic is simple in the various individual places it makes it easier to think about if, where possible, we use the same logic whether we're recovering from a crash or just switching normally13:05
TheMueAram: see the "new" life_test.go at https://codereview.appspot.com/6481045/diff/9001/mstate/life_test.go, that's why i needed the generic selection13:05
rogpeppefwereade_: how is recovering from a crash different?13:06
Aramhey niemeyer.13:09
Aramniemeyer: we have watches.13:09
Arammachine, unit, service, and relation watches.13:10
niemeyerHeya!13:10
rogpeppeniemeyer: yo!13:10
niemeyerAram: Wow13:10
niemeyerrogpeppe: Heya13:11
TheMueniemeyer: hi13:11
niemeyerAram: I've been thinking about how to implement them, but I guess you've already moved forward with something13:11
niemeyerAram: What's the plan there?13:11
niemeyerTheMue: Heya13:11
Aramniemeyer: just the lisbon plan, but using transactions in a way to avoid races.13:12
niemeyerAram: What does that actually mean? :-)13:12
niemeyerTheMue: Do you have that list of watches we need?13:13
Aramdocuments have a rev field, watchers remember last rev and poll perdiodically, rev field is incremented in transactions along with a global rev field.13:13
TheMueniemeyer: you've got it in your mail, as well as the missing tests13:13
niemeyerAram: Okay, can we have a quick call to save ourselves time?13:14
niemeyerAram: I mean, just for more bandwidth13:14
Aramniemeyer: sure13:14
TheMueniemeyer: what we have to look for is the presence watcher13:14
niemeyerAram: So we can sync up13:14
niemeyerTheMue: Can you join us too?13:14
TheMueniemeyer: yep13:14
niemeyerTheMue: Yeah, that's an interesting case.. but let's nail down the others first13:14
niemeyer(since we're already on them)13:15
* Aram is ready anytime13:15
niemeyerStarting13:15
Aramniemeyer: how is that field called, txn_rev?13:30
niemeyerfwereade_: "Not really so keen on "pending", that implies to me that it hasn't started."13:31
niemeyerfwereade_: Funny enough, that's exactly the case.. :-)13:31
niemeyerfwereade_: When we save that hook state, the hook hasn't started13:31
fwereade_niemeyer, well, it is the case at the time we write ie13:31
fwereade_s/ie/it/13:32
niemeyerAram: txn-revno13:32
Aramthanks13:32
niemeyerAram: np13:32
fwereade_niemeyer, what do yu think of running/committing/complete?13:32
niemeyerfwereade_: "running" has the same issue of "started"13:32
fwereade_niemeyer, yeah, and I can convince myself if means completion-pending, as it were13:33
niemeyerfwereade_: It's awkward to find a hook in a running state to mean it's in an error state and in fact not running13:33
fwereade_niemeyer, agreed13:33
fwereade_niemeyer, now, about setting charm state in runHook -- I'm just adding a Queued hook state so that changeCharm can set that before marking the charm as Deployed before it returns13:34
fwereade_niemeyer, seems quite neat; sound sane?13:34
niemeyerfwereade_: Definitely, cheers13:35
fwereade_niemeyer, so: queued, pending, comitting, complete?13:35
* fwereade_ just cannot spell that word today :/13:35
niemeyerfwereade_: +1 :)13:36
fwereade_niemeyer, cheers13:36
fwereade_niemeyer, just reproposed https://codereview.appspot.com/648205313:53
niemeyerfwereade_: Super, thanks13:58
niemeyerAram: Hmmm.. I thought we had agreed to sort out the "path" issue before integrating the confignode stuff?14:02
Aramniemeyer: is renaming to key fine?14:03
niemeyerAram: LOL.. no :)14:03
niemeyerAram: I'm still happy to push these branches forward for the moment, but this is not correct.. we should fix it next week14:04
niemeyerAram:         environConfigKey = "environ"14:04
niemeyer        return readConfigNode(s, environConfigKey)14:04
niemeyerconfig, err = readConfigNode(s.st, s.Name())14:04
niemeyerAram: Guess what happens if we have a service named "environ"14:04
Aramyeah, that's not great.14:05
niemeyerAram: For the moment, I suggest namespacing stuff with slashes14:07
niemeyerAram: "unit/<name>"14:08
niemeyerAram: "service/<name>"14:08
niemeyerAram: Well, hmm14:08
niemeyerAram: That's not right14:08
niemeyerAram: We don't need config nodes for unit or service.. we already have their own nodes14:08
niemeyerAram: Where do we need config nodes?14:08
niemeyerAram: EnvironConfig.. Relation..14:08
Aramniemeyer: no idea, state has it: http://go.pkgdoc.org/launchpad.net/juju-core/state#Service.Config14:09
Aramso I did the same14:09
Aramditto for units14:09
niemeyerAram: Ah, service config, yes.. as in the config machinery14:09
niemeyerAram: Hmm.. units don't14:10
niemeyerAram: The Service.Config stuff is what we hook into for the "juju set" and "config-get" commands14:10
Aramthey don't seem to have now, they did when I implemeted them though.14:11
niemeyerAram: Which means it's indeed generic14:11
Aramsomebody deleted them in the meantime :).14:11
niemeyerAram: (as in, we have no control over which keys exist)14:11
niemeyerAram: I don't think that's true14:11
niemeyerAram: Units don't have a configuration of their own in that fashion14:11
niemeyerAram: The unit configuration is the determined by service configuration14:11
niemeyerAram: That's always been the case14:12
Aramniemeyer: ah, yes. but my branch doesn't have confignodes for units though either14:14
Aramonly for service and environment config14:14
niemeyerAram: I know.. I was exploring the field with you so we know what we're going to do, rather than blaming or anything14:14
Aramah, yes14:14
niemeyerAram: So, we need namespacing.. how do we call that collection again? /me looks14:15
Aramcfgnodes14:15
niemeyerAram: Hmmm.. we don't have nodes in Mongo.. we have documents.. Can we call the collection "settings"?  I think that's how we've been referring to the concept generically speaking14:17
Aramsettings it is14:17
niemeyerAram: So.. we need them for.. the service config.. for relations, both scoped and global, ...14:17
niemeyerAram: Anything else?14:18
Aramenvironment14:18
niemeyerAram: +114:18
niemeyerAram: We should also rename ConfigNode to Settings.. but let's wait until we delete the current state package so we don't have to worry about it14:18
Aramyes14:18
niemeyerAram: Awesome, looks like that's all14:19
niemeyerAram: So, we have a couple of choices.. the first one is splitting collections, the other is namespacing14:20
niemeyerAram: I think we have to namespace either way, because we can't determine the number of relation scopes ahead of time14:20
Aramnamespacing sounds better14:20
niemeyerAram: So that's probably the better choice for everything14:20
niemeyerAram: Cool, +114:20
* TheMue likes the Settings idea and namespaces, so +114:22
niemeyerAram: "e", "s/<name>", "r/<scope, etc>"14:23
Aramsounds fine14:23
niemeyerAram: No point in using a large prefix and forcing a huge number of comparisons on indexes and whatnot with common prefixes14:24
TheMueniemeyer: as our model is relative fixed it's ok. only the second s or r would break it.14:25
* TheMue so far finds nothing that doesn't fit into the rest of 22 letters14:27
niemeyerAram: Review sent14:36
Aramthanks14:37
niemeyerAram: LGTM with these in, actually14:37
Aramniemeyer: txn will never insert phantom documents in the "real" collection, right?14:40
niemeyerAram: That's rihgt14:48
niemeyerAram: The only way the real collection and documents is ever changed is in the "txn-revno" and "txn-queue" fields of real documents14:49
niemeyerAram: I very much didn't want to deal with crack in the real content14:49
niemeyerAram: The "There's one race" aspect mentioned in the post is a side effect of that14:50
* Aram tries to understand why DeepEquals fails since the debug print of what we got from the watcher and what we expect is the same.14:57
fwereade_niemeyer, http://paste.ubuntu.com/1164568/15:01
niemeyerAram: int vs. int64 is a common issue15:03
niemeyerfwereade_: wtf15:04
niemeyerfwereade_: "unrevisioned executability"!?15:04
fwereade_niemeyer, yeah, I know :/15:05
Aramniemeyer: I mistakenly assumed I could use a type newDoc struct { Doc; something } else in a query, and it would fill the fields of the embedded document, but I was wrong.15:12
niemeyerAram: You're half-wrong only, though15:13
niemeyerAram: ",inline"15:13
Aramhah, thanks!15:13
niemeyerAram: np15:13
Aramniemeyer: dumping the database, I see that these two documents have the same txn-revno: http://paste.ubuntu.com/1164608/15:22
Aramhow can that be?15:22
Aramthey were added in different Run() calls.15:22
niemeyerAram: revno is per document15:22
Aram:(15:23
niemeyerAram: What's the issue?15:24
niemeyerAram: The "txn-" prefix is there for namespacing since the package is injecting that into alien documents15:24
niemeyerAram: Rather than meaning "the revision number of the transaction executed"15:25
Aramwell, if it's per document I don't see how I can use it in watchers. perhaps I'm missing something.15:25
niemeyerAram: Why?15:25
niemeyerAram: Can you run me through the procedure you had in mind?15:25
Aramthe watcher remembers the last used revno, and when it polls it does a query to see documents with a revno greater then it remembered.15:26
Aramsince new documents start with a fresh revno, it won't find them this way.15:27
Aramdid you had in mind a different procedure?15:28
niemeyerAram: Hmm15:29
niemeyerAram: No, I just hadn't considered the possibility of doing that kind of grouping query15:29
niemeyerAram: The idea was the same, but individually per-docuemnt15:29
niemeyerAram: But, let me ponder for a moment. You may be onto something15:30
niemeyerAram: I think all the logic in the txn package would work equally well if it used max(revno)+1, which seems to solve the issue15:30
niemeyerAram: Let me go to the drawing board for a second15:31
niemeyerAram: Nope, doesn't work15:36
Aramindeed.15:37
niemeyerAram: Obviously, transactions that affect independent documents can't guarantee to have a monotonically increasing revno15:37
niemeyerAram: So, back to the question: what was the logic you were implementing?15:37
niemeyerAram: I'm still curious because I think I'm missing something15:38
niemeyerAram: If we have 100k documents, we're likely only interested in a selection of them.. why do we care about a global revno?15:38
Aramhow do we detect new documents?15:39
niemeyerAram: I guess it depends on the scenario..15:41
niemeyerAram: Let's pick one to evaluate15:41
Arammachines15:41
niemeyerAram: Cool15:41
niemeyerAram: Thinking about the best approach, just a sec15:42
niemeyerAram: Okay, so here are a few constraints:15:45
niemeyerAram: 1) We don't want to scan everything regularly15:46
niemeyerAram: 2) We don't want a gigantic document with all the ids15:47
niemeyerAram: I think we can solve both of them by having a control document that is touched every time the selection of machines changes15:49
Aramniemeyer: sorry, I have to go. I have to pack and I have been here for 12 hours already.15:49
Aramso this will have to wait for next week15:49
niemeyerAram: Of course, that's not a problem15:49
niemeyerAram: Have fun, and thanks for the hard work15:49
Aramthanks15:49
Aramcheer, and have a nice weekend15:49
niemeyerAram: Thanks15:50
niemeyerLunch here16:00
rogpeppefwereade_: ping16:02
fwereade_rogpeppe, pong16:02
rogpeppefwereade_: should there be an entry in the State for the bootstrap Machine?16:02
fwereade_rogpeppe, yes, I think so16:02
rogpeppefwereade_: currently i don't think there is, though i may be missing something16:02
fwereade_rogpeppe, hmm, I thought initzk was going to do that, maybe it doesn't yet16:03
rogpeppefwereade_: hmm, maybe it does, let me check16:03
fwereade_rogpeppe, that's what the --instance-id param is for16:03
rogpeppefwereade_: oh yes, so it does. thanks.16:05
fwereade_rogpeppe, cool16:05
fwereade_niemeyer, hmm, when you get back... if the charm dir's a repo, can you think offhand of any reason *not* to version everything and commit it at the end of each hook?16:34
fwereade_rogpeppe, TheMue, ^^16:35
rogpeppefwereade_: and do a revert when starting?16:36
fwereade_rogpeppe, offhand, that would maybe seem to make sense16:37
* fwereade_ thinks through16:37
rogpeppefwereade_: it seems to me there might be some advantage in using the same kind of mechanism for storing charm state as for storing hook state16:37
fwereade_rogpeppe, the mechanisms seem pretty similar to me16:37
rogpeppefwereade_: that way we're not reliant on the VCS except for upgrades16:37
fwereade_rogpeppe, ohhh right sorry misunderstood16:37
fwereade_rogpeppe, well if there's any doubt of the vcs's ability to handle it I can see your point16:38
rogpeppefwereade_: istm that by going that route we'd be conflating two different kinds of thing for a relatively small convenience.16:40
fwereade_rogpeppe, really? comprehensive logging of charm state feels like it would be a pretty big convenience to some people16:41
rogpeppefwereade_: i mean, if you *do* go that route, why not do it for all hook state too?16:41
fwereade_rogpeppe, well, the important stuff there comes for free, doesn't it?16:42
rogpeppefwereade_: ?16:42
fwereade_rogpeppe, if we did commit the charm dir at every significant point, with a message derived from the hook.Info, you get AFAICT a comprehensive history of the unit for a ridiculously small amount of effort16:43
rogpeppefwereade_: shouldn't we be logging all of that anyway?16:43
rogpeppefwereade_: (i'm presuming you're talking about committing the {Installing, Deployed, Upgrading, Conflicted} states)16:44
fwereade_rogpeppe, wouldn't we be?16:44
fwereade_rogpeppe, no, I'm talking about committing the *charm dir* itself16:45
rogpeppefwereade_: ah16:45
rogpeppefwereade_: sorry, i think that's a good idea, yeah16:45
fwereade_rogpeppe, sweet :)16:45
rogpeppefwereade_: two different kinds of charm state!16:45
fwereade_rogpeppe, and *way* too many kinds of state in general16:46
fwereade_rogpeppe, I just realized state is actually a bad name, way too generic :)16:46
rogpeppefwereade_: the only down side might be that storage space grows indefinitely, and if you accidentally upgrade to a charm with a big blob in it, you can never remove it.16:46
fwereade_rogpeppe, it only gets twice as bad; I'm storing the bundles locally too16:46
fwereade_;p16:46
rogpeppefwereade_: at least the bundles are easily GC'd if need be16:47
fwereade_rogpeppe, actually, anyway, that's a price we've already kinda agreed to pay by putting it under VC in the first place16:48
fwereade_rogpeppe, extra commits aren't going to hurt unless someone's storing frequently-changing big blobs16:49
rogpeppefwereade_: i guess. 'cos we're already committing?16:49
fwereade_rogpeppe, yeah, niemeyer thought of it the other night16:49
rogpeppefwereade_: it's a nice idea16:50
rogpeppefwereade_: what bzr primitive do you use?16:50
fwereade_rogpeppe, well... actually bzr has an embarrassing crash in the specific situation that prompted the idea16:50
fwereade_rogpeppe, http://paste.ubuntu.com/1164568/16:51
fwereade_rogpeppe, so I'm actually doing it in git atm :)16:51
rogpeppefwereade_: oops16:51
niemeyerfwereade_: The idea of committing seems sound17:00
fwereade_niemeyer, cool17:01
niemeyerfwereade_: git has a nice -A option to add that will be helpful, btw17:02
niemeyerfwereade_: It replaces the "import" command nicely17:03
niemeyerfwereade_: On the unfortunate side, we'll need to tweak ExpandTo so it puts a ".empty" file on empty dirs17:04
niemeyerfwereade_: To avoid loosing them17:04
fwereade_niemeyer, oh yes ofc17:04
fwereade_niemeyer, oh, yeah: ISTM that what we need to do is actually to write ExpandTo so that it overwrites everything with extreme prejudice17:05
fwereade_niemeyer, ...except hmm, it should probably actually delete the stuff that isn't there beforehand17:05
fwereade_niemeyer, *actually*, we could just always expand into a fresh dir and copy .git into it17:06
fwereade_niemeyer, that seems neatest actually17:06
niemeyerJust note that the .git you copy must be the one from the branch that has imports only17:19
niemeyerNot the one from the live charm dir17:19
niemeyer(that has changes from hooks, etc)17:19
fwereade_niemeyer, indeed so :)17:36
rogpeppeniemeyer, fwereade_: i'm off now.. it's a public holiday here on Mon, so i'll see y'all Tues...  have a great weekend!17:44
fwereade_rogpeppe, cool, have fun17:45
niemeyerrogpeppe: Have a great weekend17:47
niemeyerfwereade__: ping18:43
=== arosales1 is now known as arosales
fwereade__niemeyer, pong, if you're there23:55

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