feat: wire SQLite replication between site nodes and fix ConfigurationDatabase tests
Add SiteReplicationActor (runs on every site node) to replicate deployed configs and store-and-forward buffer operations to the standby peer via cluster member discovery and fire-and-forget Tell. Wire ReplicationService handler and pass replication actor to DeploymentManagerActor singleton. Fix 5 pre-existing ConfigurationDatabase test failures: RowVersion NOT NULL on SQLite, stale migration name assertion, and seed data count mismatch.
This commit is contained in:
34
src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs
Normal file
34
src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using ScadaLink.Commons.Messages.Artifacts;
|
||||
using ScadaLink.StoreAndForward;
|
||||
|
||||
namespace ScadaLink.SiteRuntime.Messages;
|
||||
|
||||
/// <summary>
|
||||
/// Outbound messages — sent by local DeploymentManagerActor/S&F service
|
||||
/// to the local SiteReplicationActor for forwarding to the peer node.
|
||||
/// </summary>
|
||||
public record ReplicateConfigDeploy(
|
||||
string InstanceName, string ConfigJson, string DeploymentId, string RevisionHash, bool IsEnabled);
|
||||
|
||||
public record ReplicateConfigRemove(string InstanceName);
|
||||
|
||||
public record ReplicateConfigSetEnabled(string InstanceName, bool IsEnabled);
|
||||
|
||||
public record ReplicateArtifacts(DeployArtifactsCommand Command);
|
||||
|
||||
public record ReplicateStoreAndForward(ReplicationOperation Operation);
|
||||
|
||||
/// <summary>
|
||||
/// Inbound messages — received from the peer's SiteReplicationActor
|
||||
/// and applied to local SQLite storage.
|
||||
/// </summary>
|
||||
public record ApplyConfigDeploy(
|
||||
string InstanceName, string ConfigJson, string DeploymentId, string RevisionHash, bool IsEnabled);
|
||||
|
||||
public record ApplyConfigRemove(string InstanceName);
|
||||
|
||||
public record ApplyConfigSetEnabled(string InstanceName, bool IsEnabled);
|
||||
|
||||
public record ApplyArtifacts(DeployArtifactsCommand Command);
|
||||
|
||||
public record ApplyStoreAndForward(ReplicationOperation Operation);
|
||||
Reference in New Issue
Block a user