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

Issue 83150043: state/api/agent: added IsMaster to the API

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 6 months ago by wwitzel
Modified:
6 years, 6 months ago
Reviewers:
mp+213635, wwitzel3, hduran, rog
Visibility:
Public.

Description

state/api/agent: added IsMaster to the API IsMaster provides a way to let an API worker know that it is on the same machine as the API server that has a mongo peer address that is the primary mongo server for a given replicaset. https://code.launchpad.net/~wwitzel3/juju-core/003-ha-mongo-master-api/+merge/213635 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 6

Patch Set 2 : state/api/agent: added IsMaster to the API #

Total comments: 17

Patch Set 3 : state/api/agent: added IsMaster to the API #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -1 line) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M agent/mongo/mongo.go View 1 2 2 chunks +26 lines, -1 line 2 comments Download
M state/api/agent/machine_test.go View 1 2 2 chunks +26 lines, -0 lines 0 comments Download
M state/api/agent/state.go View 1 2 1 chunk +8 lines, -0 lines 2 comments Download
M state/api/params/params.go View 1 1 chunk +7 lines, -0 lines 2 comments Download
M state/apiserver/agent/agent.go View 1 2 2 chunks +18 lines, -0 lines 0 comments Download

Messages

Total messages: 11
wwitzel
Please take a look.
6 years, 6 months ago (2014-04-01 11:32:28 UTC) #1
wwitzel3
https://codereview.appspot.com/83150043/diff/1/state/api/agent/machine_test.go File state/api/agent/machine_test.go (right): https://codereview.appspot.com/83150043/diff/1/state/api/agent/machine_test.go#newcode36 state/api/agent/machine_test.go:36: func fakeMasterHostPort(session *mgo.Session) (string, error) { This is never ...
6 years, 6 months ago (2014-04-01 11:38:18 UTC) #2
hduran
https://codereview.appspot.com/83150043/diff/1/agent/mongo/mongo.go File agent/mongo/mongo.go (right): https://codereview.appspot.com/83150043/diff/1/agent/mongo/mongo.go#newcode66 agent/mongo/mongo.go:66: var SelectPeerAddress = selectPeerAddress I find this to be ...
6 years, 6 months ago (2014-04-01 11:56:13 UTC) #3
rog
Looks great in general, thanks. Some suggestions below. https://codereview.appspot.com/83150043/diff/1/agent/mongo/mongo.go File agent/mongo/mongo.go (right): https://codereview.appspot.com/83150043/diff/1/agent/mongo/mongo.go#newcode66 agent/mongo/mongo.go:66: var ...
6 years, 6 months ago (2014-04-01 12:00:14 UTC) #4
wwitzel
Please take a look.
6 years, 6 months ago (2014-04-01 13:58:47 UTC) #5
wwitzel3
https://codereview.appspot.com/83150043/diff/2/agent/mongo/mongo.go File agent/mongo/mongo.go (right): https://codereview.appspot.com/83150043/diff/2/agent/mongo/mongo.go#newcode35 agent/mongo/mongo.go:35: type ImplementsAddresses interface { I wasn't sure what to ...
6 years, 6 months ago (2014-04-01 14:02:03 UTC) #6
rog
LGTM with the following points addressed. Thanks! https://codereview.appspot.com/83150043/diff/2/agent/mongo/mongo.go File agent/mongo/mongo.go (right): https://codereview.appspot.com/83150043/diff/2/agent/mongo/mongo.go#newcode40 agent/mongo/mongo.go:40: // machines ...
6 years, 6 months ago (2014-04-01 17:44:18 UTC) #7
wwitzel3
https://codereview.appspot.com/83150043/diff/2/agent/mongo/mongo.go File agent/mongo/mongo.go (right): https://codereview.appspot.com/83150043/diff/2/agent/mongo/mongo.go#newcode35 agent/mongo/mongo.go:35: type ImplementsAddresses interface { On 2014/04/01 14:02:03, wwitzel3 wrote: ...
6 years, 6 months ago (2014-04-01 18:34:45 UTC) #8
wwitzel
Please take a look.
6 years, 6 months ago (2014-04-01 18:36:32 UTC) #9
rog
LGTM still, with a few doc comment suggestions. https://codereview.appspot.com/83150043/diff/20001/agent/mongo/mongo.go File agent/mongo/mongo.go (right): https://codereview.appspot.com/83150043/diff/20001/agent/mongo/mongo.go#newcode35 agent/mongo/mongo.go:35: type ...
6 years, 6 months ago (2014-04-02 15:38:51 UTC) #10
wwitzel3
6 years, 6 months ago (2014-04-02 15:45:18 UTC) #11
https://codereview.appspot.com/83150043/diff/20001/agent/mongo/mongo.go
File agent/mongo/mongo.go (right):

https://codereview.appspot.com/83150043/diff/20001/agent/mongo/mongo.go#newco...
agent/mongo/mongo.go:35: type WithAddresses interface {
On 2014/04/02 15:38:51, rog wrote:
> // WithAddresses represents an entity that has a set of
> // addresses, usually a state Machine object.
> 
> ?

Done.

https://codereview.appspot.com/83150043/diff/20001/state/api/agent/state.go
File state/api/agent/state.go (right):

https://codereview.appspot.com/83150043/diff/20001/state/api/agent/state.go#n...
state/api/agent/state.go:49: // IsMaster returns a boolean which represents if
the current mongo peer
On 2014/04/02 15:38:51, rog wrote:
> // IsMaster reports whether the connected machine
> // agent lives at the same network address as the primary
> // mongo server for the replica set.
> // This call will return an error if the connected
> // agent is not a machine agent with environment-manager
> // privileges.
> 
> ?

Done.

https://codereview.appspot.com/83150043/diff/20001/state/api/params/params.go
File state/api/params/params.go (right):

https://codereview.appspot.com/83150043/diff/20001/state/api/params/params.go...
state/api/params/params.go:474: // pointing to the mongo primary of the replica
set.
On 2014/04/02 15:38:51, rog wrote:
> // Master reports whether the connected agent
> // lives on the same instance as the mongo replica
> // set master.
> 
> ?

Done.
Sign in to reply to this message.

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