juju model-config max-history-time has no effect on juju.statuseshistory retention

Bug #1653181 reported by Frode Nordahl
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

Juju 2.0.2 juju.statuseshistory collection appears to be growing without bound. We have attempted to tweak the max-history-{mb,time} model-config options. After setting to a reasonable value (in nanoseconds), the API server's log showed:

WARNING juju.environs.config config.go:1036 unknown config field "max-history-time"

Is this setting not yet available? Does it have a different name? Warning appears on Juju 2.2 (devel) release also.

Perhaps a related symptom is "juju status" shows that many agents are lost. Restarting the API server appears to have remedied this particular problem.

Tags: sts
Frode Nordahl (fnordahl)
tags: added: sts
description: updated
Revision history for this message
Doug Parrish (dparrish) wrote :

It appears pruning is going on. A count of docs in the statuseshistory that are older than a particular time did drop.

switched to db juju
juju:PRIMARY> db.statuseshistory.count({'updated': {$lt: 1482428042000000000}})
1213881
juju:PRIMARY> db.statuseshistory.count({'updated': {$lt: 1482428042000000000}})
1213870

To further confirm, the oldest entry (minimum "updated" value) was displayed about five minutes apart, the prune interval.

juju:PRIMARY> db.statuseshistory.aggregate([{:{_id:null,oldest:{:''}}}])
{ "_id" : null, "oldest" : NumberLong("1481916408813157991") }
$ date -d@1481916408
Fri Dec 16 12:26:48 MST 2016

juju:PRIMARY> db.statuseshistory.aggregate([{:{_id:null,oldest:{:''}}}])
{ "_id" : null, "oldest" : NumberLong("1481916712307487461") }
$ date -d@1481916712
Fri Dec 16 12:31:52 MST 2016

So, it appears retention is set at two weeks (or rather 14*24*60*60*10**9; 'updated' field is in nanoseconds

Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.2.0
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.2-beta1 → 2.2-beta2
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.2-beta2 → 2.2-beta3
Changed in juju:
milestone: 2.2-beta3 → 2.2-beta4
Changed in juju:
milestone: 2.2-beta4 → 2.2-rc1
Revision history for this message
Ian Booth (wallyworld) wrote :

I'm not aware of any model-config attribute called max-history-time.
But in 2.2 beta3, we added model config parameters to tune the status history retention.

// MaxStatusHistoryAge is the maximum age of status history values
// to keep when pruning, ef "72h"
"max-status-history-age"

// MaxStatusHistorySize is the maximum size the status history
// collection can grow to before it is pruned, eg "5M"
"max-status-history-size"

Set these in each model or as model defaults so they are used by all models.

Changed in juju:
status: Triaged → Fix Committed
assignee: nobody → Ian Booth (wallyworld)
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.