feat(cluster)!: leader-auto-down is the shipped default downing strategy (#116)

SplitBrainResolverStrategy now defaults to leader-auto-down (the in-repo
LeaderAutoDowningProvider, #106, with the #132 shut-out restart on). auto-down and
keep-oldest stay supported. Drilled on the docker rig, docker-env2 and the QA pair
(central + site, kill and stop-and-hold) before the flip.

- ClusterOptions default + validator/HOCON comments updated.
- Shipped Host appsettings.Central/Site.json and every docker/ and docker-env2/
  node appsettings now say leader-auto-down. The leader-auto-down overlays are
  kept as no-ops (drill records reference them); new docker-compose.auto-down.yml
  overlays keep Akka AutoDowning available for comparison drills.
- Tests: default asserts leader-auto-down; new HOCON test for an unset strategy;
  TwoNodeClusterFixture defaults to the production posture.
- Docs: CLAUDE.md, Component-ClusterInfrastructure, components/Host + Cluster,
  README, failover procedures, Traefik, docker + env2 READMEs; register row 70 closed.

No deploy needed: DEV, QA and both rigs set the key explicitly.

Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
This commit is contained in:
Joseph Doherty
2026-11-15 19:49:31 -05:00
parent 1213a74353
commit efade2eab0
36 changed files with 153 additions and 83 deletions
@@ -52,19 +52,20 @@ public class ClusterOptions
/// <summary>
/// Downing strategy for unreachable members. Three supported values:
/// <list type="bullet">
/// <item><c>auto-down</c> (default, decision 2026-07-21) — availability-first: each
/// <item><c>leader-auto-down</c> (<b>default</b> since 2026-11-15, ScadaBridge#106/#116) — the
/// in-repo <c>LeaderAutoDowningProvider</c> (Host): the same availability-first semantics as
/// <c>auto-down</c> below, without Akka's deprecated <c>AutoDowning</c>, so it survives that
/// provider's removal from a future Akka.NET and does not log the boot-time deprecation warning.
/// Adds the #132 shut-out restart (<see cref="LeaderAutoDown"/>). Drilled on the docker rig,
/// docker-env2 and the QA pair (central + site, kill and stop-and-hold) before becoming the
/// default.</item>
/// <item><c>auto-down</c> (the default from 2026-07-21 until 2026-11-15; still supported) — availability-first: each
/// side downs the unreachable peer after <see cref="StableAfter"/>, so a hard crash
/// of EITHER node (oldest included) fails over to the survivor. The accepted trade:
/// a true network partition produces two live one-node clusters (dual-active) until
/// an operator restarts one side. Chosen because ScadaBridge pairs run one node per
/// VM with no shared lease infrastructure, and a stalled system is a bigger risk
/// than a rare partition.</item>
/// <item><c>leader-auto-down</c> (opt-in, ScadaBridge#106) — identical semantics to
/// <c>auto-down</c>, implemented by the in-repo <c>LeaderAutoDowningProvider</c> (Host) instead
/// of Akka's deprecated <c>AutoDowning</c>, so it survives that provider's removal from a
/// future Akka.NET and does not log the boot-time deprecation warning. Not yet the default:
/// the docker failover drill must pass on it first
/// (<c>docs/plans/2026-11-09-autodowning-replacement-plan.md</c>).</item>
/// <item><c>keep-oldest</c> — partition-safe SBR: downs the side without the oldest
/// member. In a TWO-node cluster this makes a crash of the oldest/active node a
/// total outage: Akka's <c>down-if-alone</c> only rescues the survivor when its own
@@ -76,7 +77,7 @@ public class ClusterOptions
/// <c>keep-majority</c> just moves the fatal crash from the oldest to the
/// lowest-address node.
/// </summary>
public string SplitBrainResolverStrategy { get; set; } = "auto-down";
public string SplitBrainResolverStrategy { get; set; } = "leader-auto-down";
/// <summary>
/// Time the cluster membership must remain stable before the split-brain
@@ -14,14 +14,16 @@ public sealed class ClusterOptionsValidator : OptionsValidatorBase<ClusterOption
{
/// <summary>
/// Downing strategies supported for ScadaBridge's two-node clusters.
/// <c>auto-down</c> (default) survives a crash of either node at the accepted cost
/// <c>leader-auto-down</c> (default since 2026-11-15, ScadaBridge#116) and <c>auto-down</c>
/// survive a crash of either node at the accepted cost
/// of dual-active during a real partition; <c>keep-oldest</c> is partition-safe but
/// cannot survive a crash of the oldest node. Quorum strategies are rejected:
/// <c>static-quorum</c> quorum-size 1 trips Akka's IsTooManyMembers guard (DownAll
/// on any unreachability in a 2-node cluster) and <c>keep-majority</c> keys the
/// fatal crash to the lowest-address node instead of the oldest.
/// <c>leader-auto-down</c> (ScadaBridge#106) is the in-repo port of <c>auto-down</c>
/// (same semantics, no dependency on Akka's deprecated <c>AutoDowning</c>).
/// (same semantics, no dependency on Akka's deprecated <c>AutoDowning</c>), with the #132
/// shut-out restart.
/// </summary>
private static readonly HashSet<string> AllowedStrategies = new(StringComparer.OrdinalIgnoreCase)
{
@@ -303,12 +303,12 @@ public class AkkaHostedService : IHostedLifecycleService
/// whitespace cannot corrupt the document or be silently misparsed.
///
/// The downing block branches on <see cref="ClusterOptions.SplitBrainResolverStrategy"/>:
/// <c>auto-down</c> (default; decision 2026-07-21) installs Akka's
/// <c>auto-down</c> (the default 2026-07-21 to 2026-11-15) installs Akka's
/// <c>AutoDowning</c> provider with <c>auto-down-unreachable-after</c> =
/// <see cref="ClusterOptions.StableAfter"/> — the leader among the REACHABLE members
/// downs the unreachable peer, so a crash of either node (oldest included) fails
/// over to the survivor; the accepted trade is dual-active during a real network
/// partition. <c>leader-auto-down</c> (ScadaBridge#106, opt-in) installs the in-repo
/// partition. <c>leader-auto-down</c> (ScadaBridge#106; the default since 2026-11-15, #116) installs the in-repo
/// <see cref="LeaderAutoDowningProvider"/> — the same semantics without Akka's deprecated
/// provider — with its duration at
/// <see cref="LeaderAutoDowningProvider.UnreachableAfterPath"/>.
@@ -357,14 +357,14 @@ public class AkkaHostedService : IHostedLifecycleService
var seedNodesStr = string.Join(",", effectiveSeeds.Select(QuoteHocon));
var rolesStr = string.Join(",", roles.Select(QuoteHocon));
// auto-down (default): AutoDowning provider — the leader among the reachable
// auto-down (the default until 2026-11-15; still supported): AutoDowning provider — the leader among the reachable
// members downs the unreachable peer after StableAfter, so a crash of EITHER
// node fails over to the survivor (dual-active during a real partition is the
// accepted trade — decision 2026-07-21). Anything else: the SBR provider with
// the configured active-strategy (keep-oldest), which is partition-safe but
// cannot survive a crash of the oldest node in a two-node cluster.
//
// leader-auto-down (ScadaBridge#106, opt-in): the in-repo LeaderAutoDowningProvider — a
// leader-auto-down (ScadaBridge#106; the default since 2026-11-15, #116): the in-repo LeaderAutoDowningProvider — a
// port of AutoDowning with identical semantics that survives AutoDowning's eventual
// removal from Akka.NET. Its duration lives under our own key, so no
// auto-down-unreachable-after is emitted (which also silences Akka's deprecation warning).
@@ -13,7 +13,7 @@
"akka.tcp://scadabridge@localhost:8081",
"akka.tcp://scadabridge@localhost:8082"
],
"SplitBrainResolverStrategy": "auto-down",
"SplitBrainResolverStrategy": "leader-auto-down",
"StableAfter": "00:00:15",
"HeartbeatInterval": "00:00:02",
"FailureDetectionThreshold": "00:00:10",
@@ -16,7 +16,7 @@
"akka.tcp://scadabridge@localhost:8082",
"akka.tcp://scadabridge@localhost:8085"
],
"SplitBrainResolverStrategy": "auto-down",
"SplitBrainResolverStrategy": "leader-auto-down",
"StableAfter": "00:00:15",
"HeartbeatInterval": "00:00:02",
"FailureDetectionThreshold": "00:00:10",