docs(localdb): refresh README, record 0.3.6 #46/#50 notes (LocalDb-007)
README: 0.3.6 version heading and changelog entries (0.3.5, 0.3.6), OtOpcUa Phases 1+2, Synchronous EXTRA, per-table baseline wording in Ops notes, test count 249. CLAUDE.md records LocalDb-005/006/007 and the #50 items, with the cross-repo LocalDbSyncAuthInterceptor decision left as a note. LocalDb findings now 0 open; code-reviews/README.md regenerated. (scadaproj#46) Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -10,7 +10,7 @@ Change capture uses SQLite triggers writing a single HLC-stamped oplog inside th
|
||||
consumer's own write transaction (crash-consistent, non-bypassable). Convergence is
|
||||
last-writer-wins over a hybrid logical clock. All timestamps are UTC.
|
||||
|
||||
## Packages (all `0.3.4`)
|
||||
## Packages (all `0.3.6`; the feed carries up to `0.3.4` — `0.3.5` and `0.3.6` are unpublished)
|
||||
|
||||
| Package | Contents |
|
||||
|---|---|
|
||||
@@ -18,8 +18,24 @@ last-writer-wins over a hybrid logical clock. All timestamps are UTC.
|
||||
| `ZB.MOM.WW.LocalDb.Contracts` | `localdb_sync.v1` proto + generated gRPC types (packable; a future peer could be non-.NET). |
|
||||
| `ZB.MOM.WW.LocalDb.Replication` | gRPC sync engine: passive `LocalDbSyncService`, initiating `SyncBackgroundService`, `MaintenanceBackgroundService`, LWW apply, watermark acks + pruning, snapshot resync, `ISyncStatus`, `LocalDbMetrics`, `AddZbLocalDbReplication()` / `MapZbLocalDbSync()`. |
|
||||
|
||||
> Status: **published to the Gitea feed; adopted by ScadaBridge (Phases 1+2) and OtOpcUa (Phase 1).**
|
||||
> Status: **published to the Gitea feed (through `0.3.4`); adopted by ScadaBridge (Phases 1+2) and
|
||||
> OtOpcUa (Phases 1+2), both pinned to `0.3.4`.**
|
||||
>
|
||||
> - `0.3.6` (unpublished) — code-review fixes (scadaproj#36–#39, #46, #50). Wire-compatible: no proto
|
||||
> change, no `lib_schema_version` bump, no on-disk schema change.
|
||||
> - The passive endpoint enforces `ApiKey` itself (Bearer, constant-time, before the handshake).
|
||||
> - Snapshots deliver FK-linked rows in any order (parents first; FK-failing rows deferred and
|
||||
> retried; true orphans dead-lettered at completion), with the held-back rows capped by the new
|
||||
> `MaxSnapshotDeferredRows`.
|
||||
> - Remote rows are upserted on the primary key (`ON CONFLICT(<pk>) DO UPDATE`), not
|
||||
> `INSERT OR REPLACE`, so a secondary-`UNIQUE` clash is a dead-letter, not a silent delete.
|
||||
> - `FailClosedOnDrift` covers snapshot rows.
|
||||
> - Snapshot-path dead-letters are counted in `localdb.sync.dead_lettered`.
|
||||
> - Column names containing `'` replicate (they broke the apply/snapshot SQL).
|
||||
> - **`RegisterReplicated` refuses an `AUTOINCREMENT` primary key** (see Limitations) — the one
|
||||
> change that can refuse a schema an earlier version accepted.
|
||||
> - `0.3.5` (unpublished) — `Microsoft.Data.Sqlite` 10.0.7 → 10.0.13 (efcore#39009 pool fault) and
|
||||
> the `SQLitePCLRaw.lib.e_sqlite3` transitive pin 2.1.12 → 2.1.13. No wire or schema change.
|
||||
> - `0.3.4` (2026-08-20) — **a converged pair no longer re-streams a full snapshot on every
|
||||
> reconnect once the sender's oplog has been ack-pruned to empty.** Found on the ScadaBridge
|
||||
> docker rig (its register row 106): a rebuilt node (watermark 0) was healed by a snapshot
|
||||
@@ -227,7 +243,7 @@ node still pushes its own deltas back. Only one side needs `PeerAddress`.
|
||||
|---|---|---|
|
||||
| `Path` | `""` (required) | Filesystem path to the SQLite database file. |
|
||||
| `BusyTimeoutMs` | `5000` | SQLite `busy_timeout` pragma, in milliseconds. |
|
||||
| `Synchronous` | `"NORMAL"` | SQLite `synchronous` pragma (`OFF` / `NORMAL` / `FULL`). |
|
||||
| `Synchronous` | `"NORMAL"` | SQLite `synchronous` pragma (`OFF` / `NORMAL` / `FULL` / `EXTRA`, case-insensitive). |
|
||||
|
||||
### `LocalDb:Replication` section (`ReplicationOptions`)
|
||||
|
||||
@@ -405,7 +421,8 @@ provider is wired or the poll threw, so a DB failure never reads as "0 backlog")
|
||||
replicates stops syncing with a schema-mismatch error. Deregister on both nodes, or on
|
||||
neither. Re-enabling later should pass `baselineExistingRows: true`, or the rows that
|
||||
accumulated while capture was off stay invisible to the peer — but trim high-volume
|
||||
tables first (see Limitations: baselining flags a full, all-tables snapshot). The HLC's
|
||||
that table first (see Limitations: baselining streams that one table in full, not every
|
||||
table — only an oplog cap prune or a pre-`0.3.0` peer streams everything). The HLC's
|
||||
durable anchor is flushed in the same transaction, so a crash after a deregister boot
|
||||
cannot bring the clock back below stamps peers already hold.
|
||||
- **On-disk schema upgrades** are applied in place when the file is opened, in one
|
||||
@@ -434,7 +451,7 @@ provider is wired or the poll threw, so a DB failure never reads as "0 backlog")
|
||||
|
||||
## Testing
|
||||
|
||||
199 tests, all offline / no live dependencies — unit (HLC ordering + restart
|
||||
249 tests, all offline / no live dependencies — unit (HLC ordering + restart
|
||||
persistence, deregistration's HLC anchor surviving an ungraceful reopen, trigger SQL
|
||||
generation, LWW decision table, watermark/pruning, digest computation, schema-version
|
||||
upgrade, deregistration idempotency, baseline-floor LWW safety, O(1) depth vs a seeded
|
||||
|
||||
Reference in New Issue
Block a user