LAN cluster: federation only on the bridge node, on mcl_core (mcl-lan P5) #35

Closed
opened 2026-12-02 13:06:07 +00:00 by uranus · 2 comments
Member

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)
DECIDED 2026-12-02 "I have created and cloned macula-services/mcl-core. Let's build this properly. In the end I hope we keep a single repo: mcl-core that will replace both mcl-om and mcl-lan" (Raf)

Purpose (feature): in a LAN cluster, mcl-rag joins its org's federation only on the bridge node, the one with a mesh pool, and runs on mcl_core instead of mcl_om.

Refs macula-services/mcl-lan#1 (docs/DESIGN.md §5 and §7 P5), macula-services/mcl-core#7 (the bridge), #31

What changes

  • The library: the mcl_om dependency becomes mcl_core. Until 1.0.0 is on hex it is built against mcl-core main 914650ae; the last commit pins ~> 1.0. The {mcl_om, "~> 1.6"} dep (rebar.config:32) and the app list (apps/mcl_rag/src/mcl_rag.app.src:16) change, and every mcl_om* call in the 34 files that name it moves to its mcl_core* name.
  • Federation: join_federation:join/0 (apps/mcl_rag/src/serve_federated_query/join_federation.erl:78-82) waits for mcl_om:macula_client(). On a cluster member there is never a pool, so it retries every second forever and /health stays degraded on every member. On a member it does not join, and says so: its status is a fact, not a wait, and health counts it as ok. On the bridge and on a standalone node it joins as today.

Open question, before code (Mars)

#31 (open) rules that join_federation runs only where mcl_rag.holds_store is true, because it answers from the store (rag.sqlite on ONE node). This package says it runs only on the bridge. Both hold only when the bridge node is the node that holds the rag store. Is that the placement rule, or should the bridge forward federated queries to the store holder over the LAN?

Done-when

  • mcl_core replaces mcl_om; no mcl_om name is left outside CHANGELOG history.
  • On a member node, join_federation does not wait for a pool, and /health is not degraded by the federation; a test asserts both.
  • On a bridge node and on a standalone node (LAN off), it joins as today: the existing serve_federated_query_tests pass unchanged.
  • The open question's answer is in the code and the README.
  • The last commit pins mcl_core ~> 1.0 once 1.0.0 is on hex.

Not in scope

  • #34 (evoq ~> 1.32, Pallas): no commit here until it lands.
  • #31's other items.
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) DECIDED 2026-12-02 "I have created and cloned macula-services/mcl-core. Let's build this properly. In the end I hope we keep a single repo: mcl-core that will replace both mcl-om and mcl-lan" (Raf) Purpose (feature): in a LAN cluster, mcl-rag joins its org's federation only on the bridge node, the one with a mesh pool, and runs on mcl_core instead of mcl_om. Refs macula-services/mcl-lan#1 (docs/DESIGN.md §5 and §7 P5), macula-services/mcl-core#7 (the bridge), #31 ## What changes - **The library:** the mcl_om dependency becomes mcl_core. Until 1.0.0 is on hex it is built against mcl-core main 914650ae; the last commit pins `~> 1.0`. The `{mcl_om, "~> 1.6"}` dep (`rebar.config:32`) and the app list (`apps/mcl_rag/src/mcl_rag.app.src:16`) change, and every `mcl_om*` call in the 34 files that name it moves to its `mcl_core*` name. - **Federation:** `join_federation:join/0` (`apps/mcl_rag/src/serve_federated_query/join_federation.erl:78-82`) waits for `mcl_om:macula_client()`. On a cluster member there is never a pool, so it retries every second forever and `/health` stays `degraded` on every member. On a member it does not join, and says so: its status is a fact, not a wait, and health counts it as ok. On the bridge and on a standalone node it joins as today. ## Open question, before code (Mars) #31 (open) rules that `join_federation` runs only where `mcl_rag.holds_store` is true, because it answers from the store (rag.sqlite on ONE node). This package says it runs only on the bridge. Both hold only when the bridge node is the node that holds the rag store. Is that the placement rule, or should the bridge forward federated queries to the store holder over the LAN? ## Done-when - [ ] mcl_core replaces mcl_om; no `mcl_om` name is left outside CHANGELOG history. - [ ] On a member node, `join_federation` does not wait for a pool, and `/health` is not degraded by the federation; a test asserts both. - [ ] On a bridge node and on a standalone node (LAN off), it joins as today: the existing `serve_federated_query_tests` pass unchanged. - [ ] The open question's answer is in the code and the README. - [ ] The last commit pins `mcl_core ~> 1.0` once 1.0.0 is on hex. ## Not in scope - #34 (evoq ~> 1.32, Pallas): no commit here until it lands. - #31's other items.
Author
Member

Supervisor ruling 2026-12-02 (relayed by Mars; Raf may overrule) on the open question: placement rule, the bridge node is the rag store holder. A member never attempts join_federation, so the retry loop goes. The rule is written into mcl-core docs/DESIGN.md (mcl-lan is being archived). Commits here wait for #34 (evoq ~> 1.32) to land.

Supervisor ruling 2026-12-02 (relayed by Mars; Raf may overrule) on the open question: **placement rule, the bridge node is the rag store holder.** A member never attempts `join_federation`, so the retry loop goes. The rule is written into mcl-core `docs/DESIGN.md` (mcl-lan is being archived). Commits here wait for #34 (evoq ~> 1.32) to land.
Author
Member

Landed: main e07f3e111e (PR 37, fast-forward). Main runs 6975 (build-push, including attest), 6976 (c4 model) and 6977 (lint-and-test) are all green. Review: Jupiter PASS at r=1 (3a6a0d6) and a diff-only r=2 (e07f3e1). Companion: mcl-core design §9 landed at db68d823 (mcl-core PR 11).

Done-when, against main:

  • mcl_core replaces mcl_om: {mcl_core, "~> 1.0"} (rebar.config:35), and calls, sys.config, the app list, the README and the C4 model use mcl_core. Comments that cite past versions (e.g. "mcl_om 0.33.1") are kept as history; no mcl_om name is left for the current library.
  • On a member, join_federation does not wait for a pool (join(false) -> member, join_federation.erl:94), and /health is ok: a_cluster_member_does_not_join_test (serve_federated_query_tests.erl:140) reads the role from mcl_core's real lan/bridge env. 5 mutants on this path were all caught.
  • Bridge and standalone join as before: a_cluster_bridge_joins_test (:157), with the existing joining tests unchanged.
  • The open question's answer (bridge = store holder) is in the code's moduledoc, the README and mcl-core docs/DESIGN.md §9.
  • The last commit pins mcl_core ~> 1.0 (hex 1.0.0).

Also in this package, from the rulings: every procedure is marked export => mesh, with a test; the README says the service works on a LAN with no station and on the mesh (DECIDED 2026-12-02 "we won't loose the mesh! I just don't want to pitch Martha as "mesh-only"", Raf).

Landed: main e07f3e111e6239754444dc59037d7a2b023aef0f (PR 37, fast-forward). Main runs 6975 (build-push, including attest), 6976 (c4 model) and 6977 (lint-and-test) are all green. Review: Jupiter PASS at r=1 (3a6a0d6) and a diff-only r=2 (e07f3e1). Companion: mcl-core design §9 landed at db68d823 (mcl-core PR 11). Done-when, against main: - [x] mcl_core replaces mcl_om: `{mcl_core, "~> 1.0"}` (rebar.config:35), and calls, sys.config, the app list, the README and the C4 model use mcl_core. Comments that cite past versions (e.g. "mcl_om 0.33.1") are kept as history; no mcl_om name is left for the current library. - [x] On a member, `join_federation` does not wait for a pool (`join(false) -> member`, join_federation.erl:94), and /health is ok: `a_cluster_member_does_not_join_test` (serve_federated_query_tests.erl:140) reads the role from mcl_core's real `lan`/`bridge` env. 5 mutants on this path were all caught. - [x] Bridge and standalone join as before: `a_cluster_bridge_joins_test` (:157), with the existing joining tests unchanged. - [x] The open question's answer (bridge = store holder) is in the code's moduledoc, the README and mcl-core docs/DESIGN.md §9. - [x] The last commit pins `mcl_core ~> 1.0` (hex 1.0.0). Also in this package, from the rulings: every procedure is marked `export => mesh`, with a test; the README says the service works on a LAN with no station and on the mesh (DECIDED 2026-12-02 "we won't loose the mesh! I just don't want to pitch Martha as "mesh-only"", Raf).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-services/mcl-rag#35
No description provided.