forked from juju/charm-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unitdata: Only keep delta of env variable changes as revision (juju#736)
The unitdata code keeps environment variable revisions in kv_revisions table, and all of the environment variables serialized into JSON and pushed into the table on each hook invocation. There is a check to see if current env variable set is same with the previous one, but some of the environment variables (e.g. JUJU_CONTEXT_ID) is always changing, which means whole env variable list is serialized and pushed to the DB on every single hook invocation. That has become a problem in deployments that has very large (e.g. ~70 KiB) environment variable lists. Given that update-status is running periodically (every 5 mins by default) and having many charms in the same environment, the disk space of the host running the charms runs out over time and needs manual intervention to clear up kv_revisions table. This fix aims to avoid that by keeping only the delta of environment variable list as a revision. Note that this is a breaking change and will break any charms that are relying on `env` value's layout on returned from `gethistory()` function. Closes-Bug: LP#1930173
- Loading branch information
Showing
2 changed files
with
183 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters