Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow removal of store charms #7000

Merged
merged 1 commit into from Feb 17, 2017
Merged

Conversation

babbageclunk
Copy link
Contributor

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

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.
@babbageclunk
Copy link
Contributor Author

!!chittychitty!!

@howbazaar
Copy link
Contributor

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.

@babbageclunk
Copy link
Contributor Author

Oh, yes - I've tried that too.

@babbageclunk
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

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
@babbageclunk babbageclunk deleted the charm-cache branch February 17, 2017 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants