"juju destroy-controller" can leak hosted models
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Andrew Wilkins |
Bug Description
juju destroy-controller requires you to first destroy hosted models. So I ran this after a fresh bootstrap:
juju add-machine
(wait for machine to be provisioned)
juju destroy-model -y default && juju destroy-controller -y ctrl
And the hosted model machine is still there.
The code in state that decrements hosted-model refcounts is broken. When you create a hosted model, a refcount is added to the controller. As long as this refcount is non-zero, you cannot destroy the controller. When you "juju destroy-model", it marks the model as dying, enqueues cleanups (destroy services, machines, etc.), and decrements the refcount. It's then possible to destroy the controller before all of the hosted model resources are cleaned up.
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
affects: | juju-core → juju |
Changed in juju: | |
milestone: | 2.0-beta4 → none |
milestone: | none → 2.0-beta4 |
I'm tempted to target for 2.0, but I don't think it'll get fixed in time. This is complicated, due to how we keep models hanging around even after they're dead. Normally we would decrement refcounts when removing entities from state. I suspect we'll just have to do it when setting it to Dead, rather than Dying.