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

Issue 6503072: implement charm upgrades

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 3 months ago by fwereade
Modified:
13 years, 3 months ago
Reviewers:
mp+122846
Visibility:
Public.

Description

implement charm upgrades https://code.launchpad.net/~fwereade/juju-core/uniter-deploy-upgrades/+merge/122846 Requires: https://code.launchpad.net/~fwereade/juju-core/uniter-use-deployer/+merge/122838 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 30

Patch Set 2 : implement charm upgrades #

Unified diffs Side-by-side diffs Delta from patch set Stats (+473 lines, -33 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M worker/uniter/charm/deployer.go View 1 4 chunks +4 lines, -4 lines 0 comments Download
M worker/uniter/charm/deployer_test.go View 1 3 chunks +4 lines, -4 lines 0 comments Download
M worker/uniter/modes.go View 1 6 chunks +110 lines, -6 lines 0 comments Download
M worker/uniter/uniter.go View 1 5 chunks +31 lines, -8 lines 0 comments Download
M worker/uniter/uniter_test.go View 1 6 chunks +322 lines, -11 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
13 years, 3 months ago (2012-09-05 11:01:59 UTC) #1
niemeyer
https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go File worker/uniter/modes.go (right): https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode83 worker/uniter/modes.go:83: log.Printf("resuming charm upgrade") I suggest preserving the logic of ...
13 years, 3 months ago (2012-09-11 13:12:34 UTC) #2
fwereade
Thanks, excellent comments, I'll get onto fixing them now. https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go File worker/uniter/modes.go (right): https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode83 worker/uniter/modes.go:83: ...
13 years, 3 months ago (2012-09-11 13:22:11 UTC) #3
niemeyer
LGTM https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go File worker/uniter/modes.go (right): https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode245 worker/uniter/modes.go:245: // upgrade-charm hook if no other hook is ...
13 years, 3 months ago (2012-09-11 13:40:17 UTC) #4
niemeyer
LGTM https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go File worker/uniter/modes.go (right): https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode245 worker/uniter/modes.go:245: // upgrade-charm hook if no other hook is ...
13 years, 3 months ago (2012-09-11 13:40:17 UTC) #5
fwereade
13 years, 3 months ago (2012-09-13 09:35:53 UTC) #6
*** Submitted:

implement charm upgrades

R=niemeyer
CC=
https://codereview.appspot.com/6503072

https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go
File worker/uniter/modes.go (right):

https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode83
worker/uniter/modes.go:83: log.Printf("resuming charm upgrade")
On 2012/09/11 13:22:11, fwereade wrote:
> On 2012/09/11 13:12:34, niemeyer wrote:
> > I suggest preserving the logic of checking for op.Op, and panicking when
> > unknown.
> 
> Fair enough, I'm constantly torn between the noise and the certainty of these
> sorts of check, and have half-evolved a heuristic that says "if it's checked
in
> *this* package, don't go overboard". But then I'm usually happier when I get
> paranoid, so...

Done.

https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode245
worker/uniter/modes.go:245: // upgrade-charm hook if no other hook is in an
error state.
On 2012/09/11 13:40:17, niemeyer wrote:
> On 2012/09/11 13:22:11, fwereade wrote:
> > On 2012/09/11 13:12:34, niemeyer wrote:
> > > Doesn't look like this mode checks the error state.
> > 
> > I don't think it should -- is there a state in which an upgrade is
> unreasonable?
> 
> The comment just sounds a bit misleading. Perhaps:
> 
> // ModeUpgrading is responsible for upgrading the charm and for running
> // the upgrade-charm hook. This mode must not be transitioned to while
> // the unit is in an error state.

Dropped all mention of errors, as discussed on IRC.

https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode260
worker/uniter/modes.go:260: // upgrading a charm: either by manually resolving
errors and then setting
On 2012/09/11 13:22:11, fwereade wrote:
> On 2012/09/11 13:12:34, niemeyer wrote:
> > s/: /. This may be done/
> 
> Better, thanks.

Done.

https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode260
worker/uniter/modes.go:260: // upgrading a charm: either by manually resolving
errors and then setting
On 2012/09/11 13:22:11, fwereade wrote:
> On 2012/09/11 13:12:34, niemeyer wrote:
> > s/: /. This may be done/
> 
> Better, thanks.

Done.

https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode292
worker/uniter/modes.go:292: err := u.charm.Snapshotf("user resolved upgrade
conflict")
On 2012/09/11 13:22:11, fwereade wrote:
> On 2012/09/11 13:12:34, niemeyer wrote:
> > "Upgrade conflict resolved."
> Thanks, better.

Done; also made the other Snapshotfs use full sentences :).

https://codereview.appspot.com/6503072/diff/1/worker/uniter/modes.go#newcode294
worker/uniter/modes.go:294: if err == nil {
On 2012/09/11 13:22:11, fwereade wrote:
> On 2012/09/11 13:12:34, niemeyer wrote:
> > ; e != nil && err == nil {
> 
> Good idea

Done.

https://codereview.appspot.com/6503072/diff/1/worker/uniter/uniter.go
File worker/uniter/uniter.go (right):

https://codereview.appspot.com/6503072/diff/1/worker/uniter/uniter.go#newcode115
worker/uniter/uniter.go:115: // These operations can be interrupted to perform
an upgrade; if hook
On 2012/09/11 13:40:17, niemeyer wrote:
> On 2012/09/11 13:22:11, fwereade wrote:
> > On 2012/09/11 13:12:34, niemeyer wrote:
> > > This is a bit confusing. op.Op == Upgrade *is* an upgrade, how can we
> > interrupt
> > > an upgrade to perform an upgrade and then restore the previous upgrade?
> > 
> > I should expand on that -- the idea is that we could be resuming, or
> > force-replacing, an upgrade operation, but that in either case we also need
to
> > preserve any previously-preserved hook error. I'll try to reword it.
> 
> Appreciated, thanks!

Done.

https://codereview.appspot.com/6503072/diff/1/worker/uniter/uniter.go#newcode155
worker/uniter/uniter.go:155: }[reason],
On 2012/09/11 13:40:17, niemeyer wrote:
> Btw, that's very pythonic. :-) It took me a moment to figure what was going
on.
> This would do the same in about the same space, and be more readable and
> surprisingly efficient (despite it not mattering here):
> 
> hi := &hook.Info{}
> switch reason {
> case Install:
>     hi.Kind = hook.Install
> case Upgrade:
>     hi.Kind = hook.Upgrade
> }

Haha, I used to think that word was entirely complimentary ;p. Done.
Sign in to reply to this message.

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