feat(717): Warm non-transparent redundancy, default-off (T1-T10)

OpcUa:Redundancy:Mode (Unset default = today's server exactly; None; Warm; Hot and unknown values fail start).
- T1 options + validator + effective-URI check + boot banner; Warm needs the driver role.
- T2 metadata in OnNodeManagerStartedAsync: Warm -> NonTransparentRedundancyType, read-only
  ServerUriArray [self, peers], RedundancySupport=Warm, boot ServiceLevel 1; None -> RedundancySupport=None
  and the SDK's orphan i=11314 deleted; Unset untouched.
- T3 RedundancyStateChanged.Revision (up-number, incarnation tick, sequence); subscribers drop older
  revisions under Warm (OpcUaPublishActor, DriverHostActor); unrevisioned never makes a node Active.
- T4 WarmRoleAuthority + ComputeWarm bands (Standby 90/50, Active 250/200/100), PromoteWhilePrimaryUnreachable.
- T5 IStandbyProjection + DeferredStandbyProjection; OpcUaPublishActor runs promotion/demotion in the spec
  4.7 order (Active level last and retried; Standby level first, data degraded regardless).
- T6 EquipmentVariableState read projection (BadOutOfService/null); Warm Standby refuses writes BadInvalidState.
- T7 D4 mechanism adopted after T0: ordinary-tag marker on MonitoredItemNotification.Message validated by
  (ClientHandle, DataValue); first-delivery decision keyed by (SubscriptionId, SequenceNumber); the SDK's
  cached copy is never mutated.
- T8 queue current/BadOutOfService to live ordinary-tag items ignoring filters.
- T9 alarm stamp/deliver split (suppressed on Standby), Part 9 methods refused on Standby, promotion
  refresh via ISubscription.ConditionRefresh2Async on every live event item.
- T10 deploy-time RedundancyMode cross-check + six instruments.

Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
This commit is contained in:
Joseph Doherty
2026-11-13 03:26:36 -05:00
parent dcff5ae994
commit 7829b937d1
27 changed files with 3056 additions and 29 deletions
@@ -44,6 +44,9 @@ internal sealed class ServerEventRig : IAsyncDisposable
public string EndpointUrl => $"opc.tcp://127.0.0.1:{_port}/OtOpcUa";
/// <summary>The configured <c>OpcUa:ApplicationUri</c> (the effective one: the rig loads no XML).</summary>
public string ApplicationUri => _hostOptions.ApplicationUri;
public OtOpcUaNodeManager Nm => _server.NodeManager!;
internal OtOpcUaSdkServer Server => _server;
@@ -57,7 +60,12 @@ internal sealed class ServerEventRig : IAsyncDisposable
public SdkAddressSpaceSink Sink { get; private set; } = null!;
public static async Task<ServerEventRig> StartAsync(string name, bool encrypted, CancellationToken ct)
public static Task<ServerEventRig> StartAsync(string name, bool encrypted, CancellationToken ct) =>
StartAsync(name, encrypted, ct, configure: null);
/// <summary>Starts the rig, letting the caller adjust the host options first (Gitea #717: redundancy mode, peers).</summary>
public static async Task<ServerEventRig> StartAsync(
string name, bool encrypted, CancellationToken ct, Action<OpcUaApplicationHostOptions>? configure)
{
var rig = new ServerEventRig(Path.Combine(Path.GetTempPath(), $"otopcua-{name}-{Guid.NewGuid():N}"));
rig._hostOptions = new OpcUaApplicationHostOptions
@@ -71,6 +79,7 @@ internal sealed class ServerEventRig : IAsyncDisposable
: [OpcUaSecurityProfile.None],
AutoAcceptUntrustedClientCertificates = true,
};
configure?.Invoke(rig._hostOptions);
(rig._host, rig._server) = await OpcUaHostStart.StartAsync(
port =>
{