On this page
Database Lifecycle
§5.2.1 Log store path
The log store database resides at a path configured via the LogStorePath registry key under Machine\System\eventd\. The value MUST be a file path (not a directory, unlike the event store which uses a directory of shards). There is no compiled-in default -- if the key does not exist or is invalid, eventd MUST fail to start.
eventd MUST create the database file and its parent directories if they do not exist.
§5.2.2 Database creation
When the log store database does not exist at startup, eventd MUST create it with:
- WAL mode enabled (
PRAGMA journal_mode=WAL). - Synchronous mode set to NORMAL (
PRAGMA synchronous=NORMAL). - The
logsandmetadatatables created as defined in §5.1. - The
idx_logs_timestampandidx_logs_originindexes created. - The
schema_versionandcreated_atmetadata entries populated.
§5.2.3 Database opening
When the log store database exists at startup, eventd MUST:
- Open the database in WAL mode.
- Set synchronous mode to NORMAL.
- Verify the schema version. If unrecognised, eventd MUST log an error and MUST NOT write to the database.
- Verify structural integrity (required tables and indexes exist).
§5.2.4 Concurrency
The log store has one read-write connection (owned by the log writer thread) and zero or more read-only connections (owned by query handlers). WAL mode permits concurrent reads alongside the single writer.
§5.2.5 WAL checkpointing
The log writer thread MUST trigger WAL checkpoints when the WAL exceeds a size threshold, using SQLITE_CHECKPOINT_PASSIVE mode. The threshold is implementation-defined.