Repository navigation
Eventing grew from key-value only to cover every model, but the documentation and the tests did not follow, and a year of new features shipped emitting nothing. This release makes what ZephyrDB reports match what it does, puts the whole surface under CI, and reports the state changes that were happening silently.
README.md still described eventing as key-value only — and it is the Doxygen mainpage, so that text was the published API site's definition of the feature.
Added
- Instance events. A fourth listener category,
zdb_core_event_listener_t/zdb_core_event_t, registered throughzdb_cfg_t.core_event_listeners. ReportsZDB_CORE_EVENT_INIT,ZDB_CORE_EVENT_DEINITandZDB_CORE_EVENT_HEALTH, the last carryingprev_healthandhealth. Health was previously observable only by pollingzdb_health(). ZDB_TS_EVENT_ROLLOVER— a bounded stream discarding its oldest segments, with the bytes dropped intruncated_bytes. This is the only place ZephyrDB destroys data on purpose, and it used to do so silently.ZDB_TS_EVENT_WATERMARK— a consumed watermark set or cleared.ZDB_EVENT_KV_INDEX_FULL— a key that stored successfully but did not fitCONFIG_ZDB_KV_INDEX_MAX_ENTRIES. The value stays readable by name; only enumeration is lost.zdb_core_event_chanandzdb_eventing_zbus_publish_core().- Test suites
unit/core_events,unit/doc_eventsandunit/eventing_zbus— the zbus adapter had no automated coverage of any kind before this.
Fixed
- Health could never degrade with
CONFIG_ZDB_STATS=n.zdb_health_check()decided from durability counters that compile away when statistics are off, so such builds reportedZDB_HEALTH_OKno matter how much corruption they met. - Document events never reported failures.
zdb_doc_save(),zdb_doc_delete()andzdb_doc_create()passed a hardcodedZDB_OKand returned before the emit on every error path. - Time-series recovery never reported failures. Ten early returns in
zdb_ts_recover_stream()emitted nothing. - Flush events undercounted. Only the periodic work-queue drain emitted, so flushes caused by
zdb_ts_close()or by a full ingest buffer during append were invisible andflushed_bytesdid not reflect what reached storage. zdb_deinit()could crash after an append. The time-series context was freed without settling a queued flush, leaving the work queue to run a handler in memory that had since been reused.samples/eventing_zbushad nosample.yaml, so Twister never built it — the reason this drift went unnoticed. It now builds in CI, mounts LittleFS so its time-series and document paths actually run, and fails rather than silently skipping them.- The documented arm64 test workflow was broken. Zephyr matches
boards/<board-target>.overlay, andnative_sim.overlayonly matches an unqualified target, sonative_sim/native/64built without the LittleFS partition and every filesystem-backed suite failed. Each suite now ships the qualified name alongside it.
Changed
CONFIG_ZDB_EVENTINGnow depends onZDB_CORErather than requiring a data model, since instance events are model-independent.- Event callbacks are documented as never running while an internal lock is held, so a listener may call back into the same instance. Flush, rollover and health events detected inside locked sections are published on release.
- Health is documented as one-way and derived from time-series integrity checks.
- README,
docs/api.mdanddocs/configuration.mdrewritten around the four categories.
Upgrading
Existing listeners will observe behaviour changes: document events and time-series recovery now deliver failure statuses they previously never sent, and flush events fire from more paths. A listener that assumed status was always ZDB_OK should be reviewed.
Requires Zephyr v4.4.1. 0.x: the API may change between minor releases; on-disk formats are versioned and readers accept older ones.
Full changelog: https://github.com/beriberikix/zephyrdb/blob/v0.7.0/CHANGELOG.md