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

Issue 68650044: worker/peergrouper: implement worker

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by rog
Modified:
11 years, 7 months ago
Reviewers:
mp+208204, dimitern, natefinch, fwereade
Visibility:
Public.

Description

worker/peergrouper: implement worker It still lacks integration tests to actually check that the functionality works against mongo for real, but I think this is a reasonable stepping stone towards that. https://code.launchpad.net/~rogpeppe/juju-core/482-peergrouper-worker/+merge/208204 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : worker/peergrouper: implement worker #

Total comments: 54

Patch Set 3 : worker/peergrouper: implement worker #

Patch Set 4 : worker/peergrouper: implement worker #

Total comments: 41

Patch Set 5 : worker/peergrouper: implement worker #

Patch Set 6 : worker/peergrouper: implement worker #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1311 lines, -44 lines) Patch
A [revision details] View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M testing/mgo.go View 2 chunks +5 lines, -1 line 0 comments Download
M utils/voyeur/value.go View 1 1 chunk +12 lines, -9 lines 0 comments Download
M utils/voyeur/value_test.go View 2 chunks +9 lines, -8 lines 0 comments Download
M worker/peergrouper/desired.go View 1 2 3 4 7 chunks +27 lines, -20 lines 0 comments Download
M worker/peergrouper/desired_test.go View 1 2 7 chunks +39 lines, -6 lines 0 comments Download
A worker/peergrouper/mock_test.go View 1 2 1 chunk +450 lines, -0 lines 0 comments Download
A worker/peergrouper/shim.go View 1 2 1 chunk +68 lines, -0 lines 0 comments Download
A worker/peergrouper/worker.go View 1 2 3 4 5 1 chunk +458 lines, -0 lines 0 comments Download
A worker/peergrouper/worker_test.go View 1 2 3 4 5 1 chunk +241 lines, -0 lines 0 comments Download

Messages

Total messages: 10
rog
Please take a look.
11 years, 8 months ago (2014-02-25 18:46:24 UTC) #1
dimitern
Looks good so far, but I haven't managed to go through the bulk of it ...
11 years, 8 months ago (2014-02-25 19:19:04 UTC) #2
rog
Please take a look. https://codereview.appspot.com/68650044/diff/20001/worker/peergrouper/desired_test.go File worker/peergrouper/desired_test.go (right): https://codereview.appspot.com/68650044/diff/20001/worker/peergrouper/desired_test.go#newcode12 worker/peergrouper/desired_test.go:12: // coretesting "launchpad.net/juju-core/testing" On 2014/02/25 ...
11 years, 7 months ago (2014-02-26 13:58:08 UTC) #3
rog
Please take a look.
11 years, 7 months ago (2014-02-26 14:12:02 UTC) #4
dimitern
The rest of the review. I like this and it LGTM, except for a few ...
11 years, 7 months ago (2014-02-26 15:50:00 UTC) #5
fwereade
I'm not 100% sure about the mocking strategy -- it feels like a simpler and ...
11 years, 7 months ago (2014-02-26 16:51:02 UTC) #6
rog
Please take a look. https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/mock_test.go File worker/peergrouper/mock_test.go (right): https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/mock_test.go#newcode236 worker/peergrouper/mock_test.go:236: func (m *fakeMachine) Refresh() error ...
11 years, 7 months ago (2014-02-26 16:58:09 UTC) #7
rog
Please take a look. https://codereview.appspot.com/68650044/diff/20001/worker/peergrouper/worker.go File worker/peergrouper/worker.go (right): https://codereview.appspot.com/68650044/diff/20001/worker/peergrouper/worker.go#newcode48 worker/peergrouper/worker.go:48: // If we fail to ...
11 years, 7 months ago (2014-02-26 17:13:03 UTC) #8
natefinch
I think some of my comments are out of date, like the commented out coretesting ...
11 years, 7 months ago (2014-02-26 21:10:29 UTC) #9
rog
11 years, 7 months ago (2014-02-27 09:17:14 UTC) #10
Comments addressed in a later branch. https://codereview.appspot.com/68650044/diff/20001/worker/peergrouper/desired.go File worker/peergrouper/desired.go (right): https://codereview.appspot.com/68650044/diff/20001/worker/peergrouper/desired... worker/peergrouper/desired.go:260: mid, ok := member.Tags["juju-machine-id"] On 2014/02/26 21:10:29, nate.finch wrote: > not a big deal, but mid is perhaps a poorly chosen abbreviation. I was trying > to figure out how the variable represented the midpoint of anything.... only > realizing after a little bit that it just means machine-id. Why not just use id, > since there's no other variables of that name? I avoided "id" because there are two kinds of ids around here, member ids and machine ids. But you're right, "mid" doesn't even help there. Renamed to machineId in a subsequent branch. https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/worker.go File worker/peergrouper/worker.go (right): https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/worker.... worker/peergrouper/worker.go:47: type notifyFunc func() (bool, error) On 2014/02/26 21:10:29, nate.finch wrote: > Can you name the returns? (changed bool, err error) I think that would make it > a lot clearer without having to read the whole doc string. Done. https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/worker.... worker/peergrouper/worker.go:78: // purposes only. On 2014/02/26 21:10:29, nate.finch wrote: > "It is an interface so we can swap out the implementation during testing." Done. https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/worker.... worker/peergrouper/worker.go:81: // When something changes that might might affect On 2014/02/26 21:10:29, nate.finch wrote: > one too many mights Done. https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/worker.... worker/peergrouper/worker.go:165: if _, isReplicaSetError := err.(*replicaSetError); !isReplicaSetError { On 2014/02/26 21:10:29, nate.finch wrote: > I'd prefer this check to be in its own function even if it's not called anywhere > else. I think we should be allowed to write inline type assertions. A extra function doesn't add much here AFAICS. https://codereview.appspot.com/68650044/diff/60001/worker/peergrouper/worker.... worker/peergrouper/worker.go:194: // getPeerGroupInfo collates current session information about the On 2014/02/26 21:10:29, nate.finch wrote: > comment/function mismatch (get)PeerGroupInfo Done.
Sign in to reply to this message.

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