[Overview] Leader matched across the whole app, not the cluster group (QA site shows central leader) #43
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the scadaproj#15 shared-library review (
code-reviews/Overview/findings.md, Overview-002), verified at91fb2b4. Update the finding's Resolution row when fixed.ZB.MOM.WW.Overview/src/ZB.MOM.WW.Overview/Polling/LeaderResolver.cs:85(scan at:150-166)Description
ResolveGrouppassesallInstances(every instance in the application) toResolveToInstanceName. That method returns the first instance in registry order whoseBaseUrlhost equals the Akka address host.A group's leader is by definition one of that group's members, but the members are never searched
first. Whenever two groups of the same application share hosts, the group listed later gets the
earlier group's instance name on its "Leader ·" chip. No card in the right group then gets the Leader
badge:
IsLeadercompares within the group, and the resolved name belongs to the other group.ZB.MOM.WW.Overview/CLAUDE.mdanddeployment.md§7 describe this as a single-box problem (workedaround on VD03 with
127.0.0.1BaseUrls) and state that "QA's registry can use real FQDNs" becausethe hosts are distinct. On QA, however, ScadaBridge central-a and site-a both run on vq03, and
central-b and site-b on vq04 (
deployment.md:52-53), all inside oneScadaBridgeapplication.Failure scenario
On the QA dashboard (
vq03:5320/vq04:5320), ScadaBridge's central group is listed first and thesite cluster's leader is on vq03. A scratch test of that exact layout gave:
central: leaderInstance=central-asite: leaderInstance=central-aSo the site group header reads "Leader · central-a" (a node in a different Akka cluster), and neither
site card shows the Leader chip. This is the only environment with a real HA pair, which is where
operators read leadership during failover. This is inferred from the documented QA layout; the QA
overlay is deployed-only and was not read.
Recommendation
In
ResolveGroup, resolve againstmembersfirst and fall back toallInstancesonly if no membermatches. Add a
LeaderResolverTestscase with two co-located groups. Then revisit the CLAUDE.md /deployment.mdguidance: with the fix, the VD03127.0.0.1workaround also becomes unnecessary.Resolution
Unresolved.
Fixed on main
6c81c0b(Overview-002 → Resolved): leader matched only against the group's own members (QA site group no longer shows central-a). Deliberately dropped the recommended whole-app fallback (it reintroduces the bug when a member doesn't match by host); an unmatched leader shows its raw address. Limit: two members of one group on one host are indistinguishable. Overview/CLAUDE.md and deployment.md §7 corrected. Evidence: Overview 195/195, Theme 65/65, GalaxyRepository 74/74; each regression test failed before its fix; code-reviews --check consistent.