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 variable revisions in kv_revisions table, and as a part of that all of the environment variables serialized into JSON and pushed into the table if current set of environment variables differ from the previous ones. But the code considers environment variable list as a whole and even if a single environment variable changes, whole list gets pushed as a revision. 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. This has become a problem in deployments with very large (e.g. ~70 KiB) environment variable lists. Given that update-status is running periodically (every 5 mins by default) and many charms running in the same environment, the disk space of the host running the charms runs out over time, raising a need of manual intervention to clear up the kv_revisions table. This fix aims to avoid that by keeping only the delta of environment variable list as a revision. As a result, only the changed environment variables will be logged into the kv_revisions table. 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