mcl_core 1.1.0: realm call relayed by the bridge; publish to the LAN and the mesh #14

Closed
venus wants to merge 0 commits from venus/10-realm-call into main
Member

mcl_core 1.1.0: a realm call relayed by the bridge (#10), and a publish that goes to the LAN and the mesh, deduplicated at the bridge (#12). The LAN sits beside the mesh, never in place of it (Raf, 2026-12-02).

  • mcl_core:call_realm/3: direct dial on the pool; a member relays it to the bridge over erpc. Never raises.
  • publish/2,3 goes to the LAN and the mesh. The answer is the mesh's, but ok when the LAN took the fact and the mesh can't be reached (mesh_unavailable, a member's {bridge_unreachable, _}). A publish naming the node's own realm reaches the LAN too.
  • On the bridge, a LAN-carried subscription runs behind mcl_core_cluster_echo (drops a mesh event whose publisher is a cluster node); it reads back unwrapped, so the reconcile doesn't restart it. Sealed-group subs stay mesh-only; standalone is unchanged; no wire change.

Local: lint, xref, eunit 595/0, dialyzer green; ex_doc warns only at the pre-existing mcl_core_service.erl:181. ct at ef5cbd5: every suite passes except mcl_service_template_SUITE init, which refuses locally because the installed rebar3 template points at another checkout (environment, not code). After ef5cbd5 only DESIGN.md changed (merge of main + one wording line). Mutants: 9 on the new decisions, each fails a test.

Refs #10, Refs #12, Refs macula-services/mcl-graph#19, Refs macula-services/mcl-kanban#16

mcl_core 1.1.0: a realm call relayed by the bridge (#10), and a publish that goes to the LAN and the mesh, deduplicated at the bridge (#12). The LAN sits beside the mesh, never in place of it (Raf, 2026-12-02). - `mcl_core:call_realm/3`: direct dial on the pool; a member relays it to the bridge over erpc. Never raises. - `publish/2,3` goes to the LAN and the mesh. The answer is the mesh's, but `ok` when the LAN took the fact and the mesh can't be reached (`mesh_unavailable`, a member's `{bridge_unreachable, _}`). A publish naming the node's own `realm` reaches the LAN too. - On the bridge, a LAN-carried subscription runs behind `mcl_core_cluster_echo` (drops a mesh event whose publisher is a cluster node); it reads back unwrapped, so the reconcile doesn't restart it. Sealed-group subs stay mesh-only; standalone is unchanged; no wire change. Local: lint, xref, eunit 595/0, dialyzer green; ex_doc warns only at the pre-existing mcl_core_service.erl:181. ct at ef5cbd5: every suite passes except mcl_service_template_SUITE init, which refuses locally because the installed rebar3 template points at another checkout (environment, not code). After ef5cbd5 only DESIGN.md changed (merge of main + one wording line). Mutants: 9 on the new decisions, each fails a test. Refs #10, Refs #12, Refs macula-services/mcl-graph#19, Refs macula-services/mcl-kanban#16
The LAN sits beside the mesh, never in place of it (Raf, 2026-12-02).

Realm call (#10): mcl_core:call_realm/3 dials a realm procedure with
macula:call/5 on the mesh pool. On a member the bridge node makes it over
erpc with the relayed-call budget. It never raises: mesh_unavailable,
{bridge_unreachable, R}, {bridge_failed, R} (an older bridge),
{realm_call_crashed, C, R}.

Publish to both (#12): mcl_core_transport:publish/3 sends to the LAN's
subscribers AND through the bridge to the mesh; the answer is the mesh's,
but ok when the LAN took it and there is no mesh. On the bridge a
LAN-carried subscription runs behind mcl_core_cluster_echo, which drops a
mesh event whose publisher is a cluster node (mcl_core_lan:cluster_node/1),
and reads back as the service's own declaration so the reconcile does not
restart it. Sealed-group subscriptions stay mesh-only; standalone is
unchanged; no wire change.

Tests: eunit for the realm call, transport, echo wrapper and the
subscription wrap/unwrap; peer cases in mcl_core_bridge_SUITE for the
relayed realm call and a member publish reaching LAN and mesh once.
CHANGELOG 1.1.0, the LAN guide and DESIGN (§3, §5, §7, §9) updated.
- mcl_core_lan:publish/3 skips the LAN only for a realm other than this
  node's own (own_realm/1). Before, a publish naming the own realm went to
  the mesh alone, and the bridge's echo wrapper then dropped it as a cluster
  node's fact, so no LAN-carried subscriber heard it.
- mcl_core_transport:publish/3 answers ok when the LAN took the fact and a
  member's relay answers {bridge_unreachable, _}, as for mesh_unavailable:
  1.0 answered ok there, and a retry would deliver to the LAN twice.
- eunit for both, three mutants each fail a test; guide, CHANGELOG, DESIGN §9.
design §9: the 1.1.0 entry points at Raf's beside-the-mesh decision instead of quoting it twice (Refs #12)
Some checks failed
advisories / erlang in . (pull_request) Has been skipped
advisories / erlang in . (container) (pull_request) Successful in 14s
advisories / Dependency advisories (pull_request) Successful in 0s
docs / doc snippets (erlang) (pull_request) Successful in 2m36s
template-lint-image / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 2s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 7m59s
advisories / erlang in . (push) Has been skipped
advisories / erlang in . (container) (push) Successful in 12s
advisories / Dependency advisories (push) Successful in 0s
template-lint-image / scaffold lint toolchain runs in its pinned image (push) Failing after 7s
docs / doc snippets (erlang) (push) Successful in 2m30s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (push) Successful in 9m15s
391fe14cce
Member

Landed by fast-forward: main is 391fe14cce (from db68d823). This repository does not allow the manually-merged style, so the PR is closed by hand.

Landed by fast-forward: main is 391fe14cce8f316f39c42ecc59ad9ccc1ff1e6de (from db68d823). This repository does not allow the manually-merged style, so the PR is closed by hand.
terra closed this pull request 2026-12-02 15:02:02 +00:00
Some checks failed
advisories / erlang in . (pull_request) Has been skipped
advisories / erlang in . (container) (pull_request) Successful in 14s
advisories / Dependency advisories (pull_request) Successful in 0s
docs / doc snippets (erlang) (pull_request) Successful in 2m36s
template-lint-image / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 2s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 7m59s
advisories / erlang in . (push) Has been skipped
advisories / erlang in . (container) (push) Successful in 12s
advisories / Dependency advisories (push) Successful in 0s
template-lint-image / scaffold lint toolchain runs in its pinned image (push) Failing after 7s
docs / doc snippets (erlang) (push) Successful in 2m30s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (push) Successful in 9m15s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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-core!14
No description provided.