From c2707fdcf863f62ba121e1460f724a6c25feb1bc Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 13 Jul 2026 10:46:18 -0400 Subject: [PATCH] =?UTF-8?q?docs(health):=20CentralHealthReportLoop=20comme?= =?UTF-8?q?nts=20say=20oldest-member,=20not=20cluster=20leader=20=E2=80=94?= =?UTF-8?q?=20stop=20re-teaching=20the=20S2=20conflation=20(plan=20R2-01?= =?UTF-8?q?=20T9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CentralHealthReportLoop.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs b/src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs index ab822374..bafe8366 100644 --- a/src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs +++ b/src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs @@ -9,9 +9,11 @@ namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring; /// Periodically builds a SiteHealthReport for the central cluster itself /// (siteId = ) and feeds it into the local /// CentralHealthAggregator so the UI can render central as another card -/// on /monitoring/health. Only the cluster leader (Primary) generates -/// reports — the standby's aggregator catches up on failover when it -/// becomes Primary and starts its own loop. +/// on /monitoring/health. Only the active node (Primary = the **oldest Up +/// member**, i.e. the singleton host — IClusterNodeProvider.SelfIsPrimary, +/// never Akka cluster leadership) generates reports; the standby's aggregator +/// catches up on failover when it becomes the oldest and its loop starts +/// reporting. /// public class CentralHealthReportLoop : BackgroundService { @@ -41,8 +43,9 @@ public class CentralHealthReportLoop : BackgroundService private readonly HealthMonitoringOptions _options; private readonly ILogger _logger; - // Seeded with Unix-ms so reports from a newly-elected central leader - // always sort after reports from any prior leader for siteId="central". + // Seeded with Unix-ms so reports from a node that has newly become active + // (oldest Up member) always sort after reports from any previously-active + // node for siteId="central". // The clock is read through the injected TimeProvider so the seeding is // deterministically testable. private long _sequenceNumber;