feat(cluster): AllowSingleNodeCluster flag — single-seed installs drop the phantom seed
Validator lowers the seed-count floor to 1 when AllowSingleNodeCluster is set, otherwise still requires 2 and points operators at the flag. The plan's deploy/wonder-app-vd03/appsettings.Central.json edit is skipped: that production deploy artifact is not tracked in this repo (only its deployment record doc is).
This commit is contained in:
@@ -76,4 +76,12 @@ public class ClusterOptions
|
||||
/// other reachable members, rather than running as an isolated single-node cluster.
|
||||
/// </summary>
|
||||
public bool DownIfAlone { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Acknowledges a deliberate single-node deployment: permits exactly one seed
|
||||
/// node (normally ≥2 are required so either node can start first). Without this
|
||||
/// flag a single-node install must list a phantom second seed, which the node
|
||||
/// dials forever — log noise and a defeated validation intent (review 01).
|
||||
/// </summary>
|
||||
public bool AllowSingleNodeCluster { get; set; }
|
||||
}
|
||||
|
||||
@@ -26,11 +26,13 @@ public sealed class ClusterOptionsValidator : OptionsValidatorBase<ClusterOption
|
||||
// two. Accepting a single-seed configuration silently defeats the
|
||||
// "no startup ordering dependency" guarantee called out by
|
||||
// Component-ClusterInfrastructure.md (Node Configuration).
|
||||
builder.RequireThat(options.SeedNodes is not null && options.SeedNodes.Count >= 2,
|
||||
"ClusterOptions.SeedNodes must contain at least 2 seed nodes "
|
||||
+ "(Component-ClusterInfrastructure.md → Node Configuration: "
|
||||
+ "both nodes are seed nodes); a single-seed configuration defeats "
|
||||
+ "the no-startup-ordering-dependency guarantee.");
|
||||
var minSeeds = options.AllowSingleNodeCluster ? 1 : 2;
|
||||
builder.RequireThat(options.SeedNodes is not null && options.SeedNodes.Count >= minSeeds,
|
||||
options.AllowSingleNodeCluster
|
||||
? "ClusterOptions.SeedNodes must contain at least 1 seed node."
|
||||
: "ClusterOptions.SeedNodes must contain at least 2 seed nodes "
|
||||
+ "(Component-ClusterInfrastructure.md → Node Configuration: both nodes are seed nodes); "
|
||||
+ "for a deliberate single-node install set ClusterOptions.AllowSingleNodeCluster = true instead of listing a phantom seed.");
|
||||
|
||||
builder.RequireThat(
|
||||
!string.IsNullOrWhiteSpace(options.SplitBrainResolverStrategy)
|
||||
|
||||
Reference in New Issue
Block a user