Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Issue 6814108: state, machiner: new style principal units watcher

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by aram
Modified:
11 years, 5 months ago
Reviewers:
mp+133504, gustavo.niemeyer, niemeyer, fwereade, rog
Visibility:
Public.

Description

state, machiner: new style principal units watcher Convert the machine principal units watcher to the new, id only model and refactor the machiner to make use of it. https://code.launchpad.net/~aramh/juju-core/121-state-machiner-watchers-machine-principals7/+merge/133504 Requires: https://code.launchpad.net/~aramh/juju-core/120-firewaller-new-watcher-units7/+merge/133269 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state, machiner: new style principal units watcher #

Total comments: 31

Patch Set 3 : state, machiner: new style principal units watcher #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+280 lines, -256 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/machine.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/machine_test.go View 1 2 9 chunks +92 lines, -100 lines 1 comment Download
M state/unit.go View 1 2 1 chunk +1 line, -1 line 1 comment Download
M state/watcher.go View 3 chunks +132 lines, -140 lines 2 comments Download
M worker/machiner/export_test.go View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M worker/machiner/machiner.go View 1 2 4 chunks +31 lines, -10 lines 4 comments Download
M worker/machiner/machiner_test.go View 1 2 5 chunks +19 lines, -2 lines 0 comments Download

Messages

Total messages: 9
aram
Please take a look.
11 years, 5 months ago (2012-11-08 15:59:46 UTC) #1
rog
mostly looks good. all superficial comments, other than the logic and tests in worker/machiner. https://codereview.appspot.com/6814108/diff/2001/cmd/jujud/machine.go ...
11 years, 5 months ago (2012-11-09 09:08:08 UTC) #2
aram
Please take a look. https://codereview.appspot.com/6814108/diff/2001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/6814108/diff/2001/cmd/jujud/machine.go#newcode107 cmd/jujud/machine.go:107: t = machiner.NewMachiner(m, st, &a.Conf.StateInfo, ...
11 years, 5 months ago (2012-11-09 16:50:06 UTC) #3
aram
https://codereview.appspot.com/6814108/diff/2001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/6814108/diff/2001/cmd/jujud/machine.go#newcode107 cmd/jujud/machine.go:107: t = machiner.NewMachiner(m, st, &a.Conf.StateInfo, a.Conf.DataDir) > i think ...
11 years, 5 months ago (2012-11-09 16:50:07 UTC) #4
niemeyer
That's great. LGTM assuming the following: https://codereview.appspot.com/6814108/diff/8001/state/machine_test.go File state/machine_test.go (right): https://codereview.appspot.com/6814108/diff/8001/state/machine_test.go#newcode325 state/machine_test.go:325: "check initial empty ...
11 years, 5 months ago (2012-11-14 23:34:08 UTC) #5
niemeyer
There are open points and the last review is from mid-last-week. Can you please see ...
11 years, 5 months ago (2012-11-19 12:27:36 UTC) #6
aram
I'm on vacation for two weeks.
11 years, 5 months ago (2012-11-19 12:34:00 UTC) #7
gustavo.niemeyer
On Mon, Nov 19, 2012 at 10:34 AM, <aram@mgk.ro> wrote: > I'm on vacation for ...
11 years, 5 months ago (2012-11-19 13:52:49 UTC) #8
fwereade
11 years, 5 months ago (2012-11-20 06:55:10 UTC) #9
I have serious reservations about the Machiner, but I don't think it's any less
good than it was before. FWIW the watcher essentially LGTM; since Aram's on
holiday, I'll be branching from here and trying to make sure all other comments
have been addressed, and will worry about the machiner in a future CL.

https://codereview.appspot.com/6814108/diff/8001/state/watcher.go
File state/watcher.go (right):

https://codereview.appspot.com/6814108/diff/8001/state/watcher.go#newcode1316
state/watcher.go:1316: if err == mgo.ErrNotFound || doc.Principal == "" &&
(doc.MachineId == nil || *doc.MachineId != w.machine.doc.Id) {
I think the principal check is redundant; I see no way for a subordinate to get
in here (and if it does, it's a bug, not just a thing-to-ignore).

https://codereview.appspot.com/6814108/diff/8001/state/watcher.go#newcode1339
state/watcher.go:1339: for _, unit := range w.known {
s/_, //

(surely..?)

https://codereview.appspot.com/6814108/diff/8001/worker/machiner/machiner.go
File worker/machiner/machiner.go (left):

https://codereview.appspot.com/6814108/diff/8001/worker/machiner/machiner.go#...
worker/machiner/machiner.go:52: // and restart them if not. Also track units so
Yeah, this is extremely important. If we're now tracking units to figure out
what to do, we should *surely* be doing so persistently.

https://codereview.appspot.com/6814108/diff/8001/worker/machiner/machiner.go#...
worker/machiner/machiner.go:72: if err := m.localContainer.Deploy(u,
m.stateInfo, m.tools); err != nil {
Isn't this actually a serious problem that should cause us to return an error?
If the agent is doing its job, we'll get retried anyway...

https://codereview.appspot.com/6814108/diff/8001/worker/machiner/machiner.go
File worker/machiner/machiner.go (right):

https://codereview.appspot.com/6814108/diff/8001/worker/machiner/machiner.go#...
worker/machiner/machiner.go:92: } else if !assigned && known {
I can accept handling reassignments that never happen in practice, but we don't
seem to be destroying dead units; surely that's necessary?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b