3.2. General¶
3.2.1. Storage Access¶
The Storage Access API provides an abstraction layer for storage access, allowing the CDA to interact with different types of storage systems (e.g., local file system, databases) without being tightly coupled to a specific implementation. To achieve atomicity and consistent behavior across different storage implementations, the API defines the following semantics:
A transaction context shall be created through a If all operations succeed, the transaction will be committed, and the result will be a success. Should an unexpected interruption event (power-off, reset) occur during a transaction, the transaction must be rolled back on the next startup, to ensure consistency of the storage state. For reading data, random access to the data must be supported, to allow for efficient reading of arbitrary chunks without needing to load it entirely into memory. This might be required for memory efficient handling of the diagnostic database. The |
3.2.2. Persistence¶
The Persistence API provides a durable key-value storage abstraction. Data is organized into Buckets, each representing a named, logically separated set of key-value pairs. The API is accessed through an exchangeable provider, enabling different storage backends without affecting consuming code.
The The Providers are exchangeable at compile time, allowing the use of alternative backends (e.g., an in-memory provider for testing purposes) without modifying consuming code. |
Software Architecture: Default redb Persistence Provider arch~system-default-redb-persistence-provider
|
The default persistence provider uses redb as its storage backend. It implements the
|
3.2.3. Systemd Watchdog Integration¶
The systemd watchdog integration is implemented as an optional background task that bridges the CDA health system with the systemd service manager notification protocol. Startup Detection At initialization, the component checks whether the process was launched by systemd and whether the watchdog is enabled. If either condition is not met, no task is spawned and the CDA operates without watchdog integration. Notification Interval The notification interval is derived from the systemd-configured watchdog timeout, reduced by a safety margin to ensure notifications arrive before systemd considers the service unresponsive. Health Aggregation On each tick, the task queries all registered health providers and folds their individual statuses into a single aggregated status. The folding semantics are:
State Machine The notification sent to systemd is determined by the transition between the previous and current aggregated status:
Shutdown The task terminates gracefully when the application shutdown signal is received. |