Log and status history pruner workers react to pruning config changes #7251

Merged
merged 1 commit into from Apr 19, 2017

Conversation

Projects
None yet
4 participants
Owner

wallyworld commented Apr 19, 2017

Description of change

This PR follows up on the work to allow the log pruner and status history pruner workers to be configured with respect to max record age and size of history collections. It adds the ability for the pruning parameters to be changed and the workers pick up the new parameters.

The log pruning parameters are controller settings and currently we don't support changing those. However, a watcher is added for when such changes are possible.

For the status history pruning parameters, these are changed via the juju model-config CLI.

QA steps

configure small values for log pruning in clouds.yaml
bootstrap, check debug-log to see that expected pruning values are picked up
deploy a unit
run juju model-config to set small values for status history pruning
check that history pruning occurs via juju show-status-log
check that log pruning occurs using juju debug-log

Bug reference

http://pad.lv/1681352

Looks great to me!

+ maxLogAge = newMaxAge
+ maxCollectionMB = newMaxCollectionMB
+ }
+ continue
@babbageclunk

babbageclunk Apr 19, 2017

Member

This seems a bit redundant, although I guess it does guard against someone adding code after the select.

@wallyworld

wallyworld Apr 19, 2017

Owner

it also forces the check for a new update prior to doing the pruning in case one comes in at the same time

@@ -54,8 +87,8 @@ func (s *suite) StartWorker(c *gc.C, maxLogAge time.Duration, maxCollectionMB in
func (s *suite) TestPrunesOldLogs(c *gc.C) {
maxLogAge := 24 * time.Hour
- noPruneMB := int(1e9)
- s.StartWorker(c, maxLogAge, noPruneMB)
+ s.setupState(c, "24h", "1000P")
@babbageclunk

babbageclunk Apr 19, 2017

Member

Nice that our config format parsing goes up to petabytes.

@axw

axw Apr 19, 2017

Member

It actually goes up to yottabytes. You never know how much status history you'll need ;)

Owner

wallyworld commented Apr 19, 2017

$$merge$$

Contributor

jujubot commented Apr 19, 2017

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

Contributor

jujubot commented Apr 19, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10691

Owner

wallyworld commented Apr 19, 2017

$$merge$$

Contributor

jujubot commented Apr 19, 2017

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

@jujubot jujubot merged commit 3b1eb58 into juju:develop Apr 19, 2017

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