liquidmetal-dev / liquidmetal-dev/brigade
M3 follow-up: warn when quorum gating disabled (min_cluster_size default is unsafe for clusters)
- Dominant language
- Elixir
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Context
The scheduler has a split-brain guard (`in_quorum?`) that refuses placements when the
local partition is smaller than `min_cluster_size`. But the **default is `1`**, which
disables gating entirely. On a real multi-node cluster left at the default, a minority
partition will happily place VMs — and nothing at runtime warns the operator they're
running without split-brain protection.
## Evidence
- `config/config.exs:10` — `min_cluster_size: 1` with the inline note
*"1 = no gating (single-node/dev). Set to majority for real clusters."*
- `lib/brigade/scheduler.ex:114-115` — reads the value at `init`.
- `lib/brigade/scheduler.ex:137` — the reserve path gates on `not in_quorum?(state)`.
- `lib/brigade/scheduler.ex:178` —
`defp in_quorum?(state), do: length([Node.self() | Node.list()]) >= state.min_cluster_size`.
## Scope
- Emit a **single warning at scheduler start** (in `init/1`) when the mesh has more
than one node but `min_cluster_size <= 1`, e.g. *"quorum gating disabled
(min_cluster_size=1) on a N-node cluster — no split-brain protection."*
- Optionally surface the unsafe posture via `/status` (`lib/brigade/status.ex`).
## Acceptance
- Single-node / dev (one node) stays silent.
- Multi-node mesh with `min_cluster_size=1` emits a clear one-time warning.
- The `in_quorum` telemetry gauge and existing gating behaviour are unchanged.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in lib/brigade/scheduler.ex, reading init/1 and the existing in_quorum? and reserve paths, with config/config.exs:10 for the default. Add a one-time startup warning only for multi-node meshes with min_cluster_size <= 1; leave gating and telemetry unchanged. Check lib/brigade/status.ex only if implementing the optional status surface, and verify single-node startup remains silent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100