A3 package 2: the store mode comes from config, and a cluster node waits for its join #6

Closed
opened 2026-12-02 10:49:33 +00:00 by venus · 1 comment
Member

Purpose (capability): whiteboard can run on a clustered store, so every node of a cluster holds every board and a node can go down without losing one.

A3 package 2 for mcl-whiteboard (plan: the mcl-martha consolidation analysis, A3 + corrections R1/R2). It ships with the held A3 package 4 wrap (#5, 71c944f) in one range.

What

  • The store mode comes from config: MCL_STORE_MODE = single (default, unchanged) or cluster; anything else refuses the boot by name. It is no longer hardcoded :single in MclWhiteboard.Service.event_store/0.
  • On a cluster-mode node the app does not return from opening its store (so nothing appends, and the web UI is not up) until reckon_db_cluster:local_healthy/1 says the store has joined. reckon-db 5.12 guide: an event appended to an empty node in the count-then-join window is wiped by the join.
  • The three *ToMesh emitters run under mcl_om_singleton only in cluster mode. In single mode each node's store holds only its own events, so each node keeps publishing its own.

Operator rules (written into the README)

  • A node whose store holds data refuses every join, including one to an existing multi-member cluster (reckon-db#2). Start the node that holds data first; if the empty nodes clustered first, follow the reckon-db guide's recovery steps.
  • A cluster-mode node alone does not take writes: it waits for a peer. Two nodes give copies; three are needed for failover.

Netsplit

global runs one singleton per connected partition. Each side's emitter republishes its side's events; the receivers are idempotent (#5 comment 8131: a takeover is a burst, not a gap). Stated in the PR; no new guard.

Done when

  • mode read from MCL_STORE_MODE, an unknown value refuses the boot.
  • cluster-mode open waits for the join; a peer test proves it holds while alone and returns once two nodes join; the mutant (no wait) fails it.
  • emitters: singleton in cluster mode, one handler per node in single mode; peer tests pin both; the mutant (mode ignored) fails one.
  • pin floor raised to reckon_db 5.12.1 before the land (reckon-db#14).
  • README states both operator rules.

Refs #5, Refs reckon-db-org/reckon-db#2, Refs reckon-db-org/reckon-db#14

Purpose (capability): whiteboard can run on a clustered store, so every node of a cluster holds every board and a node can go down without losing one. A3 package 2 for mcl-whiteboard (plan: the mcl-martha consolidation analysis, A3 + corrections R1/R2). It ships with the held A3 package 4 wrap (#5, 71c944f) in one range. ## What - The store mode comes from config: `MCL_STORE_MODE` = `single` (default, unchanged) or `cluster`; anything else refuses the boot by name. It is no longer hardcoded `:single` in `MclWhiteboard.Service.event_store/0`. - On a cluster-mode node the app does not return from opening its store (so nothing appends, and the web UI is not up) until `reckon_db_cluster:local_healthy/1` says the store has joined. reckon-db 5.12 guide: an event appended to an empty node in the count-then-join window is wiped by the join. - The three *ToMesh emitters run under `mcl_om_singleton` only in cluster mode. In single mode each node's store holds only its own events, so each node keeps publishing its own. ## Operator rules (written into the README) - A node whose store holds data refuses every join, including one to an existing multi-member cluster (reckon-db#2). Start the node that holds data first; if the empty nodes clustered first, follow the reckon-db guide's recovery steps. - A cluster-mode node alone does not take writes: it waits for a peer. Two nodes give copies; three are needed for failover. ## Netsplit `global` runs one singleton per connected partition. Each side's emitter republishes its side's events; the receivers are idempotent (#5 comment 8131: a takeover is a burst, not a gap). Stated in the PR; no new guard. ## Done when - [x] mode read from `MCL_STORE_MODE`, an unknown value refuses the boot. - [x] cluster-mode open waits for the join; a peer test proves it holds while alone and returns once two nodes join; the mutant (no wait) fails it. - [x] emitters: singleton in cluster mode, one handler per node in single mode; peer tests pin both; the mutant (mode ignored) fails one. - [x] pin floor raised to reckon_db 5.12.1 before the land (reckon-db#14). - [x] README states both operator rules. Refs #5, Refs reckon-db-org/reckon-db#2, Refs reckon-db-org/reckon-db#14
Author
Member

Done on main 9c6fe7c (PR #7: a3b0a47, plus the floor round d9b3b59 and 9c6fe7c; Mercurius PASS r1 and r2). Main runs 6914 (c4) and 6915 (gates) are green.

  • runtime_store_mode_test.exs runs the real runtime.exs: unset reads as single, single and cluster are read, and any other value is refused by name.
  • cluster_open_test.exs: two peers. The lone node holds 10 s without opening; both open once they meet, including connected-before-start (reckon-db#15, fixed in 5.12.1). Mutant "no wait" fails it.
  • one_node_publishes_test.exs: single mode gives one handler per node, cluster mode one per cluster. Mutants fixing the mode to cluster (2 fail) or to single (1 fails).
  • Floor raised to {:reckon_db, "~> 5.12.1"} (d9b3b59), and {:evoq, "~> 1.32"} across the umbrella (9c6fe7c).
  • README "Cluster mode" states both operator rules.
Done on main 9c6fe7c (PR #7: a3b0a47, plus the floor round d9b3b59 and 9c6fe7c; Mercurius PASS r1 and r2). Main runs 6914 (c4) and 6915 (gates) are green. - `runtime_store_mode_test.exs` runs the real runtime.exs: unset reads as single, single and cluster are read, and any other value is refused by name. - `cluster_open_test.exs`: two peers. The lone node holds 10 s without opening; both open once they meet, including connected-before-start (reckon-db#15, fixed in 5.12.1). Mutant "no wait" fails it. - `one_node_publishes_test.exs`: single mode gives one handler per node, cluster mode one per cluster. Mutants fixing the mode to cluster (2 fail) or to single (1 fails). - Floor raised to `{:reckon_db, "~> 5.12.1"}` (d9b3b59), and `{:evoq, "~> 1.32"}` across the umbrella (9c6fe7c). - README "Cluster mode" states both operator rules.
venus closed this issue 2026-12-02 13:17:31 +00:00
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-whiteboard#6
No description provided.