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

Issue 6247066: state: store units inside their respective services

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

Description

state: store units inside their respective services Making this change simplifies a lot of code - not need to keep a separate sequence numbering system for units, for example. https://code.launchpad.net/~rogpeppe/juju/go-state-units-under-service/+merge/108341 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: store units inside their respective services #

Patch Set 3 : state: store units inside their respective services #

Patch Set 4 : state: store units inside their respective services #

Total comments: 21

Patch Set 5 : state: store units inside their respective services #

Unified diffs Side-by-side diffs Delta from patch set Stats (+981 lines, -839 lines) Patch
M .lbox View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M charm/bundle_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M charm/charm_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M charm/config.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M charm/config_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M charm/dir_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M charm/export_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M charm/meta.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M charm/meta_test.go View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M charm/repo.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M charm/repo_test.go View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M charm/url_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cloudinit/cloudinit_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/cmd.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/cmd_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/bootstrap.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/juju/cmd_test.go View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M cmd/juju/deploy.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/destroy.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/juju/main.go View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M cmd/jujuc/main.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/main_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/config-get.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/config-get_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/context.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/context_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/juju-log.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/juju-log_test.go View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M cmd/jujuc/server/output.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/ports.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/ports_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/server.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/server_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/unit-get.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujuc/server/unit-get_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
cmd/jujuc/server/util_test.go View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download
M cmd/jujud/agent.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujud/initzk.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujud/initzk_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/machine.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/machine_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
cmd/jujud/main.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/main_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/provisioning.go View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M cmd/jujud/provisioning_test.go View 1 2 3 4 4 chunks +10 lines, -10 lines 0 comments Download
M cmd/jujud/unit.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/jujud/unit_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/util_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/logging.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/logging_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/supercommand_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/util_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/config_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M environs/dummy/environs.go View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M environs/dummy/environs_test.go View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M environs/dummy/storage.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/auth_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/cloudinit.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M environs/ec2/cloudinit_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/config.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M environs/ec2/config_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/ec2.go View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M environs/ec2/export_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/image.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/live_test.go View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M environs/ec2/local_test.go View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M environs/ec2/state.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/storage.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/suite_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/interface.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M environs/jujutest/livetests.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
environs/jujutest/test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
environs/jujutest/tests.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
environs/open_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
environs/tools.go View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
environs/tools_test.go View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
juju/conn.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M juju/conn_test.go View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
log/log_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
schema/schema_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
state/charm.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
state/export_test.go View 1 2 3 4 2 chunks +13 lines, -3 lines 0 comments Download
M state/internal_test.go View 1 2 3 4 9 chunks +352 lines, -377 lines 0 comments Download
state/machine.go View 1 2 3 4 4 chunks +11 lines, -15 lines 0 comments Download
state/open.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
state/presence/presence_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
state/relation.go View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M state/service.go View 1 2 3 4 10 chunks +62 lines, -58 lines 0 comments Download
state/ssh.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
state/ssh_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
state/state.go View 1 2 3 4 5 chunks +25 lines, -6 lines 0 comments Download
state/state_test.go View 1 2 3 4 7 chunks +95 lines, -13 lines 0 comments Download
M state/topology.go View 1 2 3 4 16 chunks +154 lines, -142 lines 0 comments Download
state/unit.go View 1 2 3 4 9 chunks +68 lines, -31 lines 0 comments Download
M state/watcher.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M state/watcher/watcher_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
state/watcher_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
store/branch.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
store/branch_test.go View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
store/charmd/main.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
store/charmload/main.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
store/lpad.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
store/lpad_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
store/server.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
store/server_test.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
store/store.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
store/store_test.go View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
testing/charm.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
testing/log.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
testing/zk_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
upstart/upstart_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7
rog
Please take a look.
11 years, 11 months ago (2012-06-01 13:47:32 UTC) #1
rog
Please take a look.
11 years, 11 months ago (2012-06-01 18:39:59 UTC) #2
fwereade
LGTM modulo below. https://codereview.appspot.com/6247066/diff/7001/state/service.go File state/service.go (right): https://codereview.appspot.com/6247066/diff/7001/state/service.go#newcode120 state/service.go:120: return zkRemoveTree(s.st.zk, unit.zkPath()) Not relevant to ...
11 years, 10 months ago (2012-06-04 07:29:19 UTC) #3
niemeyer
Very nice change. LGTM, assuming you're happy with the adaptations below. Otherwise, please reply accordingly ...
11 years, 10 months ago (2012-06-06 20:15:09 UTC) #4
niemeyer
I have marked the branch in Launchpad as Rejected, but only because of the move ...
11 years, 10 months ago (2012-06-06 20:16:16 UTC) #5
rog
submitted in branch from juju-core https://codereview.appspot.com/6247066/diff/7001/state/machine.go File state/machine.go (right): https://codereview.appspot.com/6247066/diff/7001/state/machine.go#newcode88 state/machine.go:88: // keyId returns the ...
11 years, 10 months ago (2012-06-07 12:07:29 UTC) #6
fwereade
11 years, 10 months ago (2012-06-07 15:20:57 UTC) #7
On 2012/06/07 12:07:29, rog wrote:
> On 2012/06/04 07:29:19, fwereade wrote:
> > Not relevant to this CL... but do we actually want to do this? The unit
agent
> > will surely still be running; I'm not sure it'll handle this all that
well...
> 
> that's an interesting point (although, as you say, not relevant to this CL).
> what *should* we do here? wait until the unit agent has gone away? leave the
> directory around and GC it later? or perhaps the best approach *is* to delete
> the directory and let the unit agent detect that.

Offhand, I think I'd favour a dying/dead approach... eg this sets "dying", which
is handled by the UA (which cleans itself up, and sets "dead"); MA can watch for
"dead" on assigned units, tidy them up, and finally delete the state once we're
sure it's unused. Not sure though.
Sign in to reply to this message.

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