Bläddra i källkod

release(v1.10.0): yyjson hot-path swap (phase A)

Phase A of the v2.0 storage engine rewrite. Replaces nlohmann::json::parse
with smartbotic::db::parse_to_nlohmann (yyjson-backed) at 17 hot-path
callsites across WAL replay, snapshot deserialize, history reads,
replication apply, and the 10 gRPC handler bodies.

In-memory representation stays nlohmann::json — Phase B (v1.11.0) is
where in-memory binary doc storage lands. Wire and on-disk JSON bytes
unchanged in v1.10.

Measured speedup on 10k Zoe-shape docs: 2.80x (136ms → 49ms).
New runtime dep: libyyjson0.

Verified:
  ./packaging/build.sh --local produces
    smartbotic-database_1.10.0-1_amd64.deb
    libsmartbotic-db-client_1.10.0-1_amd64.deb
    libsmartbotic-db-client-dev_1.10.0-1_amd64.deb
    smartbotic-db-cli_1.10.0-1_amd64.deb
  dpkg-deb -I shows libyyjson0 in Depends.
  ldd on the unpacked binary shows libyyjson.so.0 linked.
  All unit tests pass (snapshot_durability, eviction, vector_storage,
  timestamp_precision, views, config_dropins, json_parse).
fszontagh 2 månader sedan
förälder
incheckning
c56eebad05
2 ändrade filer med 2 tillägg och 1 borttagningar
  1. 1 0
      CLAUDE.md
  2. 1 1
      VERSION

+ 1 - 0
CLAUDE.md

@@ -39,6 +39,7 @@ cmake --build build -j$(nproc) && ./build/tests/test_vector_storage
 - **Chunked pressure-aware eviction** — Eviction spreads work over multiple ticks with a default `eviction_chunk_size=1000`, `eviction_chunk_pause_ms=50`, `hot_write_floor_ms=30000`. Four pressure levels (normal/soft/hard/emergency) gate behavior: soft = trickle, hard = aggressive + `MEMORY_PRESSURE_HIGH` event, emergency = admission control rejects writes with `RESOURCE_EXHAUSTED`. Per-collection `memory_priority` (low/normal/high) biases selection. Quiesce skips docs with in-flight writes. WAL-fallback no longer holds per-collection mutex during disk I/O.
 - **GetMemoryStats RPC + client retry** — `Client::getMemoryStats()` returns per-collection stats + pressure level. Client library auto-retries write RPCs on `DEADLINE_EXCEEDED`/`RESOURCE_EXHAUSTED`/`UNAVAILABLE` with exponential backoff + jitter (`writeRetries=3`, `writeRetryBackoffMs=100`). Reads are not auto-retried.
 - **Auto-backup before deb upgrade** — `apt upgrade smartbotic-database` runs a `preinst` hook that snapshots `/var/lib/smartbotic-database/` to `/var/backups/smartbotic-database/pre-upgrade-<ts>-from-<version>/` via `cp -a` after the old `prerm` stops the service. Retention `3`, 1.2× free-space precheck on the backup volume (aborts the upgrade if short). Opt out with `SMARTBOTIC_DB_SKIP_BACKUP=1 apt upgrade`. Tunables: `SMARTBOTIC_DB_BACKUP_RETENTION`, `SMARTBOTIC_DB_BACKUP_ROOT`.
+- **yyjson hot-path parsing (v1.10.0+)** — every JSON parse on WAL replay, snapshot deserialize, history reads, gRPC request bodies, and replication apply goes through `smartbotic::db::parse_to_nlohmann` (yyjson-backed) instead of `nlohmann::json::parse`. Measured 2.80× speedup on Zoe-shape corpora (136ms→49ms on 10k docs). In-memory representation stays `nlohmann::json` until Phase B. Wire and on-disk JSON bytes unchanged. New runtime dep: `libyyjson0`. Bench: `./build/tests/bench_json_parse <corpus.jsonl>`.
 
 ## Packaging
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.9.5
+1.10.0