Skip to main content
Version: 0.4.0

Retention

The cleaner is the one thing in Yoke that deletes what nobody asked it to delete. It bounds the log store per unit, by three limits.

The three limits​

LimitDefaultBounds
retention.age7dhow old an entry may be
retention.bytes50MBhow much a group may hold: each entry's message plus its detail
retention.entries100000how many entries a group may hold
  • Each limit is independent, and a limit of zero constrains nothing. Absent takes the default; zero keeps everything.
  • Applied in the order age, bytes, count, each pass seeing what the one before it left, oldest first.
  • The byte figure undercounts the file: the limit is proportional, not exact.
  • The defaults are inherited figures, not measured ones.

The group is the unit​

The limits apply per group, and the group is the unit. A deployment of ten units has ten budgets: its nominal ceiling is ten times each limit, not the limit.

  • Four copies of one Plugin have four budgets; the copy that prints most spends only its own.
  • What belongs to no unit is the group /core, which takes the deployment's policy and has no override.
  • Severity is never read. A budget is spent oldest first, whatever each entry was graded.

A group's policy​

SourceReadApplies to
the description's policy blockonce, when it is readevery group, by default
a unit's own policy blockonce, with itthat unit's group
an override set with unit.retention.setat every cyclethat unit's group, replacing both — a limit it leaves out is unconstrained
policy:
retention: { age: 3d, bytes: 20MB }
units:
acquire-1:
kind: plugin
plugin: com.example.acquire
policy: { retention: { entries: 500000 } }

acquire-1 keeps three days, twenty megabytes and five hundred thousand entries; every other group, and /core, three days, twenty megabytes and a hundred thousand.

When the cleaner runs​

the intervalone hour
the first cycleone interval after startup, plus an offset derived from the instance's name
VACUUMonce ten thousand deletions have accumulated since the last
  • The offset is the same at every start of an instance and different between instances, so instances started together do not clean together.
  • A Core restarted more often than the interval never cleans.

The worst case​

The worst case is computed, and never enforced. It is the sum, over one group per declared unit and /core, of each group's bytes limit, and the Core says it at the start. Where any group's bytes limit is zero it is unbounded, said as such and with no figure; an unbounded deployment is not refused.