On this page
Boot Partitioning
§3.5.1 Boot ID
Every record stored by eventd -- events, logs, and metrics -- carries a boot_id: a 16-byte GUID that uniquely identifies the boot during which the record was produced. The boot ID is assigned by peinit at each boot and communicated to eventd at startup.
The boot ID serves two purposes:
- Partitioning. Records from different boots are never interleaved in a meaningful sequence. KMES per-CPU sequence numbers reset to zero on each boot. Without a boot ID, sequence number 42 from boot A would be indistinguishable from sequence number 42 from boot B.
- Lifecycle. Retention can use boot ID to efficiently delete all data from old boots as a single operation, rather than scanning by timestamp.
§3.5.2 Scope
Boot ID is written to the boot_id column in all three stores:
- Event store: every row in the
eventstable. - Log store: every row in the
logstable. - Metric store: metrics do not carry boot_id per sample. The boot boundary is less meaningful for metrics because time series are continuous across restarts -- a gauge value is valid regardless of which boot produced it.
§3.5.3 Sequence uniqueness (events only)
Within a single boot, an event is uniquely identified by the tuple (boot_id, cpu_id, sequence). Across boots, boot_id provides the disambiguating dimension. The combination of all three fields is globally unique.
§3.5.4 Boot boundary detection
When eventd starts, it reads the current boot ID from peinit. If the boot ID differs from the boot ID of the most recently stored events (read from the shard databases), eventd has started in a new boot.
On a new boot, eventd MUST:
- Reset all per-CPU sequence trackers to 0.
- Record the new boot ID for all subsequent writes to the event and log stores.
- Emit a synthetic
synthetic.startupevent with the new boot ID.
On a restart within the same boot (eventd crashed and was restarted by peinit), the boot ID matches and eventd MUST:
- Restore per-CPU sequence trackers from the last persisted sequence numbers.
- Continue writing with the existing boot ID.
- Emit a synthetic
synthetic.startupevent noting the restart.