Wave 2: per-service changes for the clustered mcl-martha release (own org, one data root, ollama env, bundled switch, per-node store) #31
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
DECIDED 2026-12-02 "Run the whole path (Recommended)" (Raf: the crew runs the whole path to one clustered mcl-martha release, in order, without coming back to him)
DECIDED 2026-12-02 "trust on sight. mcl-martha services should auto-cluster over LAN, no mcl-station required. Distributed Erlang offers us all we need." (Raf, LAN-first direction)
Purpose (feature): mcl-rag becomes bundle-correct for the clustered mcl-martha release — a "bundled" switch, one data root, ollama's URL as an env var, a per-node store setting, and a readiness that does not hold up the bundle — while its standalone release keeps working unchanged.
Refs martha-ai/mcl-martha#1, macula-services/mcl-om#8
Done-when
mcl_rag_app:start/2reads abundledapp-env switch and skipsmcl_om:boot/1when set; standalone (default) still boots as today.rag_store(rag_store.erl:766),corpus_repos_config(corpus_repos_config.erl:178) andrag_reverse_export(rag_reverse_export.erl:69) read the data dir from one place — app envmcl_rag.data_dir— with one fallback (/var/lib/mcl-rag), not three different literals.embed_urland the topic-classifierendpointin config/sys.config.src become${...}vars, with ENV defaults in the Containerfile (soevery_templated_variable_is_suppliedholds). No ollama URL literal stays in sys.config.src.holds_storeapp-env setting (default true) decides whetherrag_supstartsrag_store. A node that does not hold the store does not start it, and its /health reports{down, store_not_running}honestly.mcl_rag_service:info/0carriesorgfrom mcl_rag's own app env (mcl_rag.org), andjoin_federationreadsmcl_rag_service:org()instead ofmcl_om.org. The mcl_om block org stays as mcl_om's own fallback.refresh_corpus_schedulerandjoin_federationrun only wheremcl_rag.holds_storeis true — NOT as cluster-wide mcl_om singletons (see the ruling below).rag_app:start/2returns at once and the shared health socket is up and answering while the vector-index rebuild runs; /health is{degraded, store_opening}throughout, neverdown, and never blocks. The bundle's readiness probe must tolerate the per-servicedegradedverdict (that is mcl-martha's release work, not mcl-rag's).The last commit, and why the singleton wrap was dropped
mcl_om 1.9.0 is live on hex (mcl-om#8:
service_org/1andmcl_om_singleton). The C6 org read and the~> 1.9pin land in the last commit.Ruling (Mars, 2026-12-02, found on stations and graph): a process that feeds the local store or read model a node answers from must NOT be a cluster-wide mcl_om singleton, because the node holding the singleton may not hold the store, and the others go empty or deaf. Only outbound side effects get the singleton wrap. rag.sqlite lives on ONE node, the one holding its volume (A3 package 6), so:
refresh_corpus_schedulerwrites documents and vectors into the store — it feeds the store, so it runs only wheremcl_rag.holds_storeis true.join_federationanswers the org's federated queries from the store — it exposes the store, so it runs only wheremcl_rag.holds_storeis true.mcl_om_singleton. This mirrors mcl-graph'sstore_holder()→learn_truths_from_meshruns beside the store.Not in scope
modechange: mcl-rag has no reckon-db store (its store is themcl_rag_store_nifSQLite NIF), and noevoq.store_idenv read (C2 does not apply).