Descriptionstate: aggressive removal of pending units
In response to lp:1190715, we make the following changes:
* service destruction now adds a cleanup doc that churns through all a
service's units destroying or removing them where possible.
* unit destruction short-circuiting is now attempted when the unit agent
has not yet set a status.
...and make the following opportunistic changes for sanity's and clarity's
sakes:
* clarify and make consistent the similar transaction-building loops
in service.go and unit.go (in particular, Unit.Remove was noticeably
simplified).
* resolve races around unit destruction in which charm changes and
machine assignment changes are not properly taken into account.
...supported by testing changes as follows:
* added SetRetryHooks for verifying a commonly-interesting-to-test
scenario (set up txn; break txn; verify effect of retried txn)
* SetBeforeHook became SetBeforeHooks, because that happened while I
was figuring out SetRetryHooks, and I decided it was a nice change.
* preventUnitDestroyRemove is much simpler and no longer needs the
state argument; this is annoyingly noisy.
* assertUnitLife and assertUnitRemoved were taken off UnitSuite and used
elsewhere.
The macroscopic effect of this is currently limited. Units that are manually
removed will be removed more quickly more often, which is nice; but the big
problem in lp:1190715 is related to service destruction, and that's not
directly helped by this branch.
When TheMue merges the cleanup worker integration branch, though, this bug
will be fixed pretty nicely for all environments running this code.
If we were also to explicitly call Cleanup in the CLI after destroying a
service, we could make clients with this code work correctly against
environments back to 1.10 as well. Is this important enough to justify the
ickiness? Or will we just recommend that everybody upgrade everything as
soon as possible, rendering the issue somewhat moot? Discuss.
https://code.launchpad.net/~fwereade/juju-core/state-quick-remove-units/+merge/170723
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 14
Patch Set 2 : state: aggressive removal of pending units #
MessagesTotal messages: 4
|