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

Issue 9820043: Add dirty flag to machine state (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by wallyworld
Modified:
12 years, 1 month ago
Reviewers:
mp+165954, fwereade, thumper
Visibility:
Public.

Description

Add dirty flag to machine state When choosing an unused machine to assign a unit to, a check was being made to see if there were any principal units for the machine. If machines had units assigned and then unassigned, the machine would appear clean since number of principal unit goes to 0 but the machine should still be considered dirty. The machine state has a "clean" flag (boolean). Machines are created with the clean flag set to true. It is set false when a machine has a unit assigned, and not reset when units are unassigned. The assign to unused machine logic is updated to look at the clean flag. https://code.launchpad.net/~wallyworld/juju-core/add-machine-dirty-flag/+merge/165954 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 13

Patch Set 2 : Add dirty flag to machine state #

Total comments: 1

Patch Set 3 : Add dirty flag to machine state #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -24 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M state/assign_test.go View 1 2 5 chunks +22 lines, -18 lines 0 comments Download
M state/machine.go View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M state/machine_test.go View 1 2 1 chunk +37 lines, -0 lines 0 comments Download
M state/state.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M state/unit.go View 1 2 4 chunks +9 lines, -6 lines 0 comments Download

Messages

Total messages: 10
wallyworld
Please take a look.
12 years, 1 month ago (2013-05-28 02:52:33 UTC) #1
fwereade
NOT LGTM as it is; we need to talk about advanceLifecycle. https://codereview.appspot.com/9820043/diff/1/state/machine.go File state/machine.go (right): ...
12 years, 1 month ago (2013-05-28 11:59:40 UTC) #2
wallyworld
https://codereview.appspot.com/9820043/diff/1/state/machine.go File state/machine.go (right): https://codereview.appspot.com/9820043/diff/1/state/machine.go#newcode224 state/machine.go:224: // changed from underneath us by another process. On ...
12 years, 1 month ago (2013-05-29 04:19:37 UTC) #3
fwereade
A few responses: https://codereview.appspot.com/9820043/diff/1/state/machine.go File state/machine.go (right): https://codereview.appspot.com/9820043/diff/1/state/machine.go#newcode224 state/machine.go:224: // changed from underneath us by ...
12 years, 1 month ago (2013-05-30 15:01:06 UTC) #4
wallyworld
Please take a look. https://codereview.appspot.com/9820043/diff/1/state/machine.go File state/machine.go (right): https://codereview.appspot.com/9820043/diff/1/state/machine.go#newcode224 state/machine.go:224: // changed from underneath us ...
12 years, 1 month ago (2013-05-31 04:13:53 UTC) #5
fwereade
LGTM as far as it goes; I would also support a rename from "unused" to ...
12 years, 1 month ago (2013-06-04 11:29:48 UTC) #6
thumper
Just a query about running this with existing state that doesn't have the Clean flag. ...
12 years, 1 month ago (2013-06-04 22:38:42 UTC) #7
wallyworld
On 2013/06/04 22:38:42, thumper wrote: > Just a query about running this with existing state ...
12 years, 1 month ago (2013-06-05 00:19:43 UTC) #8
thumper
On 2013/06/05 00:19:43, wallyworld wrote: > On 2013/06/04 22:38:42, thumper wrote: > > Just a ...
12 years, 1 month ago (2013-06-07 00:54:45 UTC) #9
wallyworld
12 years, 1 month ago (2013-06-10 10:35:15 UTC) #10
*** Submitted:

Add dirty flag to machine state

When choosing an unused machine to assign a unit to, a check was being made
to see if there were any principal units for the machine. If machines had units
assigned and then unassigned, the machine would appear clean since number of
principal unit goes to 0 but the machine should still be considered dirty.

The machine state has a "clean" flag (boolean). Machines are created with the 
clean flag set to true. It is set false when a machine has a unit assigned, 
and not reset when units are unassigned. The assign to unused machine logic 
is updated to look at the clean flag.

R=fwereade, thumper
CC=
https://codereview.appspot.com/9820043
Sign in to reply to this message.

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