Repository navigation
feat(storage): LMDB event store backend behind the rewrite seam (#864) - #1073
Conversation
🦋 Changeset detectedLatest commit: f31011f The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
[Medium impact] The reviewed changes appear safe to merge; no blocking findings remain.
|
|
Sizing the integration, measured rather than guessed, because the branch predates this base by 29 commits.
So it is four small edits and the oracle, not a rewrite of the job. It is still parked at The oracle to re-run at the reconciled head: |
…executor and add the lmdb arm
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Part of #864 — the LMDB store slice. Base
rewrite/main.A second
EventStorebackend behind the merged seam, incrates/nostream-storage/src/lmdb/, implementing all nine repository traits over heed 0.20.5: 7 event databases, 22 tail databases and onemeta, versioned row values, one write transaction per call, every heed call onspawn_blocking, 256-row batches on both stream and reconciliation polls.What was built
nostream-storage'slmdbfeature: events, users, invoices, metadata (NIP-05, invite, DVM, reports), notifications (delivery log + outbox), readings and the block store.nostream_storage::Backenddeleted in favour ofnostream_core::EventStoreBackend;data_dir(root, backend) -> Option<PathBuf>.tests/common/around aRepos<'a>of nine&dyntraits, so both arms replay the same 51 method arms: newtests/parity_lmdb.rsbeside the existing Postgres target.docs/rewrite/decisions/0010-lmdb-backend.md, one empty changeset, andscripts/storage-parity.shgaining the LMDB step.Verification
cargo test -p nostream-storage --test parity_lmdbLMDB_PARITY_COMPLETE replayed=113 excluded=21,48,50,112,115cargo test --workspace --all-features--lib -- lmdb/--test storagegit merge-tree rewrite/main factory/024-lmdb-storeThe five exclusions are structural: entries 112 and 115 roll back (a transaction type this backend deliberately has none of), and 111/117 replay sequentially because 116 depends on 111's outbox row. No fixture entry was edited — every coverage gap was closed with a direct test instead.
Read-path defects the review rounds found and fixed
Limited
ids/authors/tagspages returning wrong rows; a reconciliation cursor losing one row per 256-row batch; an empty tag value matching; an outbox prune walking the whole delivery log; a prefix compared against another field's bytes; a duplicated criterion counting twice; an even-length id prefix selecting nothing;map_usageblocking on the caller's thread; the quadratic 1 000 × 1 000 authors × kinds composition (1 000 000 ranges, 565 MiB → 0 ranges, +192 kB);stream_planreading a whole range for a boundedidsrequest; a 235-byte quote-onlydvalue refused by JSON escaping;text_partnot enforcing its own NUL rule; a limited page over a multi-range plan returning one row per range.The page accumulator is a bounded heap: 2 820 637 entries sorted became 500 at 5 000 ranges and limit 500, and the worst legal case 37 515 000 became 5 000 (3.53 GB → 5.28 MB).
Known, deliberately left
src/repositories/held 9 at the capture commit, the tenth arriving later. The same wording is inspec.md, so this is a spec amendment rather than a builder's choice.crates/nostream-storage/src/postgres/sql.rsand heed'ssrc/txn.rscarry two citations no tree can resolve; both pre-date this branch.Reviewed by the factory's lenses over six rounds (code ×4, architecture ×3, performance ×3, security ×2) and approved round 9. Merging is a person's call.