Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Clean up presence tables on model destruction. #7260
Conversation
jameinel
added some commits
Apr 20, 2017
|
Looks OK to me. |
|
$$merge$$
John
=:->
…
|
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit a201b3e
into
juju:develop
Apr 21, 2017
| + | ||
| +// RemovePresenceForModel removes all of the records of entities for a given model | ||
| +// across all of the collections. | ||
| +func RemovePresenceForModel(base *mgo.Collection, modelTag names.ModelTag) error { |
mjs
Apr 21, 2017
Contributor
Why does this take a tag and not a model UUID? Tags are primarily for the API right? That tag is only being used to extract the model UUID.
jameinel
Apr 21, 2017
Owner
Other parts of Presence also take names.ModelTag (NewPinger and NewWatcher)
At one point "tags" were certainly just for the API. From reading the code I think the idea is to have "typed strings" so that you don't pass a machine Id vs a unit vs a model. Otherwise they are all just strings.
jameinel
deleted the
jameinel:2.2-prune-presence-model-destruction
branch
Apr 22, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jameinel commentedApr 20, 2017
•
Edited 1 time
-
jameinel
Apr 20, 2017
Description of change
It seems we were destroying Logs but not Presence.
This just adds a helper to the presence package for
removing everything for a given model UUID and then
updates the state destruction code to call it.
QA steps
At this point, the presence collection should not be very big, it should only have records for the controller model. It should not have any beings, seqs, or pings for any of the units that were created in the middle.
Documentation changes
No, this is an internal cleanup.
Bug reference
It was realized as part of bug #1454661 though it is not directly that bug.