Allow removal of store charms #7000

Merged
merged 1 commit into from Feb 17, 2017

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Feb 17, 2017

Description of change

Charm-store charms should be removed when they're no longer needed in
the same way as local charms. Otherwise the associated storage records in
the blobstore never get removed, which means that the DB will contain every
charm ever deployed on the controller, regardless of whether it's currently used.

It's not clear why this was prevented - the comments don't really
explain. Experimentation shows that we can reinstate removed charms if
they're subsequently deployed again. This seems like a better trade-off

  • they're cached locally if there's anything using them (so adding units
    doesn't require getting the charm again) but they're not kept around
    forever, taking up space that isn't ever returned. (See the bug comments
    for more discussion.)

QA steps

  • Bootstrap a controller with two models.
  • Deploy a charm from the store (eg ubuntu) in both models.
  • Remove one model.
  • Check that you can still add units to the application using the charm in the other model.
  • In the mongo DB you can see that there's only one record for the charm in the managedStoredResources collection: db.managedStoredResources.find({"path": {"$regex": "charm"}})

Bug reference

Part of fixing https://bugs.launchpad.net/juju/+bug/1579976

Allow removal of store charms
Otherwise the associated storage records in the blobstore never get
removed, which means that the DB will contain every charm ever deployed
on the controller, regardless of whether it's currently used.

It's not clear why this was prevented - the comments don't really
explain. Experimentation shows that we can reinstate removed charms if
they're subsequently deployed again. This seems like a better trade-off
- they're cached locally if there's anything using them (so adding units
doesn't require getting the charm again) but they're not kept around
forever, taking up space that isn't ever returned.
Member

babbageclunk commented Feb 17, 2017

!!chittychitty!!

Owner

howbazaar commented Feb 17, 2017

Have you tried redeploying the same charm into the same model once it has been removed? Because that is what the comment seems to indicate.

Member

babbageclunk commented Feb 17, 2017

Oh, yes - I've tried that too.

Member

babbageclunk commented Feb 17, 2017

$$merge$$

Contributor

jujubot commented Feb 17, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 77d1b18 into juju:develop Feb 17, 2017

1 check passed

github-check-merge-juju Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details

@babbageclunk babbageclunk deleted the babbageclunk:charm-cache branch Feb 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment