Repository navigation
fix(nostreamd): serve from the store the settings name instead of an unwired bundle - #1281
Conversation
…unwired bundle nostreamd built both doors over unavailable::stores(): the relay answered every EVENT "unable to process event" and the MCP tools answered NotImplemented, so the daemon served the wire and stored nothing (#1206). - nostream-storage: Repositories, the nine repository handles of one opened backend (Repositories::over), so no caller matches on the backend per accessor. The CLI's Opened now wraps it. - nostream-relay / nostream-services: Stores and ServiceStores are built From<&Repositories>. - nostreamd: --data-dir <DIR> (the CLI's D8 layout, <DIR>/lmdb) and stores::open, used by serve and by --mcp-stdio alike. LMDB without the flag, or a Postgres that cannot be reached, refuses to start (exit 1) instead of serving an empty store. The daemon does not run migrations. - LMDB: --mcp-stdio beside a running relay is the second process ADR 0012 D9 said would overturn its one-process contract, so open also takes a flock on <root>/lmdb/search-index.lock across the marker check and rebuild; the record is amended. - payments: confirmInvoice's three writes are not one transaction on either backend; the limitation is written on the function. Tests: store_wiring starts the binary twice and reads back the event the first process accepted, on LMDB and (ignored, PARITY_ADMIN_URL) Postgres; CI runs the Postgres arm as "Daemon store against Postgres". The two refusals are covered, the MCP tests now prove the tools read and write the opened store (a user admitted by one process is read by a second), and the binary tests that relied on the unwired default run on a scratch LMDB root. Closes #1206 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit bb0b2d9)
🦋 Changeset detectedLatest commit: d567b12 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
|
[High impact] The PR appears safe to merge; the previous finding is fixed and no new blocking issue was found.
|
…in one change The ADR's D7 paragraph states the daemon still composes unavailable::stores() and that wiring the store means wiring both sites in one change. #1206 does that, so the record carries the amendment rather than a stale present tense.
…e absence of the stub reports_action, invoices_list, invoices_get and reports_list were only checked for the unwired bundle's message, so any other error — including tool not found — passed. Each now asserts isError and its exact empty-store payload. Raised by Greptile on #1281.
Coverage Report for CI Build 46272270719Coverage remained the same at 77.622%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Description
Cherry-picks AgrimTawani's commit from
AgrimTawani:fix/1206-daemon-real-stores(bb0b2d9), picked with-x, authorship kept, ontorewrite/mainat090136c.The defect.
nostreamdcomposed both doors overunavailable::stores(): the relay answered every EVENTunable to process eventand the MCP tools answeredNotImplemented, so the daemon served the wire and stored nothing. Accepted throughput was 0 at this commit, which is why#868's benchmark gate and 72 h soak rows cannot measure anything until this lands.The change.
nostreamdopens the store its settings name and hands the same nine repository handles to both doors.nostream-storage:Repositories(nine handles over one opened backend,Repositories::over), so no caller matches on the backend per accessor. The CLI'sOpenednow wraps it.nostream-relay/nostream-services:StoresandServiceStoresareFrom<&Repositories>.nostreamd:--data-dir <DIR>(the CLI's D8 layout,<DIR>/lmdb) andstores::open, used byserveand by--mcp-stdioalike. LMDB without the flag, or a Postgres that cannot be dialled, refuses to start (exit 1) instead of serving an empty store. The daemon does not run migrations.--mcp-stdiobeside a running relay is the second process ADR 0012 D9 said would overturn its one-process contract, soopenalso takes an exclusiveflockon<root>/lmdb/search-index.lockacross the marker check and rebuild; the ADR is amended with what the lock does and does not cover.confirm_invoice's three writes are not one transaction on either backend; the limitation is written on the function rather than implied.Related Issue
Closes #1206
How Has This Been Tested?
On the cherry-picked branch at
1983e17,cargo test --workspace --all-features: 117 test binaries, 1829 passed, 0 failed. The tests that matter here all run and pass:store_wiring::an_event_survives_a_restart_on_lmdb— publishes to one daemon process, stops it, reads the event and its content back from a second.store_wiring::the_lmdb_backend_without_a_data_dir_refuses_to_startandan_unreachable_postgres_refuses_to_start— exit 1, the message names the flag, nothing is served.lmdb::tests::an_open_waits_while_another_holder_has_the_rebuild_lock— a second descriptor contends as another process would.the_store_backed_tools_read_the_opened_store,the_write_tools_reach_the_opened_store,the_store_family_tools_write_through_to_the_opened_store,the_maintenance_tools_run_against_the_opened_store.cargo fmt --all -- --checkclean;cargo clippy --workspace --all-features --all-targets -- -D warningsclean.The Postgres arm of
store_wiringis#[ignore]d and needsPARITY_ADMIN_URL; this PR adds it to the existing Postgres CI job as Daemon store against Postgres, so that arm is proved in CI, not here — the sandbox cannot reach a Docker-published port.Note for review
The flock serialises the search-index check and rebuild only, not writes; the ADR now states that explicitly, including the one deployment it does not cover (a
--mcp-stdioof a newer index version against a running relay of an older one). Reviewing that paragraph is the highest-value thing a second reader can do here.