review(Cluster): record findings + fix snapshot consistency, dispose, stale docs
Code review at HEAD 7286d320. Cluster-001 (SeedFromCurrentState reads from one
snapshot), Cluster-003 (HoconLoader double-dispose), Cluster-004 (stale akka.conf
header), Cluster-005 (ServiceLevelCalculator tests added to Cluster.Tests). Cluster-002
deferred (no production caller).
This commit is contained in:
@@ -99,7 +99,7 @@ public sealed class ClusterRoleInfo : IClusterRoleInfo, IDisposable
|
||||
|
||||
foreach (var role in snapshot.Members.SelectMany(m => m.Roles).Distinct())
|
||||
{
|
||||
var leaderAddr = _cluster.State.RoleLeader(role);
|
||||
var leaderAddr = snapshot.RoleLeader(role);
|
||||
_roleLeaders[role] = leaderAddr is not null
|
||||
? snapshot.Members.FirstOrDefault(m => m.Address == leaderAddr)
|
||||
: null;
|
||||
|
||||
@@ -9,10 +9,10 @@ public static class HoconLoader
|
||||
/// <returns>The loaded HOCON configuration as a string.</returns>
|
||||
public static string LoadBaseConfig()
|
||||
{
|
||||
using var stream = typeof(HoconLoader).Assembly.GetManifestResourceStream(ResourceName)
|
||||
?? throw new InvalidOperationException(
|
||||
$"Embedded resource '{ResourceName}' not found. Verify EmbeddedResource glob in csproj.");
|
||||
using var reader = new StreamReader(stream);
|
||||
using var reader = new StreamReader(
|
||||
typeof(HoconLoader).Assembly.GetManifestResourceStream(ResourceName)
|
||||
?? throw new InvalidOperationException(
|
||||
$"Embedded resource '{ResourceName}' not found. Verify EmbeddedResource glob in csproj."));
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# Base Akka.NET cluster configuration for OtOpcUa fused-host nodes.
|
||||
#
|
||||
# Roles, seed nodes, public hostname/port, and the actor system name are overlaid
|
||||
# at runtime by AkkaHostedService — see ZB.MOM.WW.OtOpcUa.Cluster/AkkaHostedService.cs.
|
||||
# at runtime by ServiceCollectionExtensions.WithOtOpcUaClusterBootstrap (via Akka.Hosting).
|
||||
# Everything else here is the cluster-wide tuning that should match across nodes.
|
||||
#
|
||||
# Tuning sourced from ScadaLink (ScadaLink.Host/Actors/AkkaHostedService.BuildHocon);
|
||||
# any divergence must be deliberate and recorded in docs/v2/Architecture.md.
|
||||
# Any divergence from these defaults must be deliberate and recorded in docs/v2/Architecture.md.
|
||||
|
||||
akka {
|
||||
extensions = [
|
||||
|
||||
Reference in New Issue
Block a user