rawlinp commented on a change in pull request #6527:
URL: https://github.com/apache/trafficcontrol/pull/6527#discussion_r804120813
##########
File path: traffic_monitor/manager/monitorconfig.go
##########
@@ -286,25 +307,46 @@ func monitorConfigListen(
}
peerSet := map[tc.TrafficMonitorName]struct{}{}
+ tmsByGroup := make(map[string][]tc.TrafficMonitor)
for _, srv := range monitorConfig.TrafficMonitor {
- if srv.HostName == staticAppData.Hostname {
+ if tc.CacheStatusFromString(srv.ServerStatus) !=
tc.CacheStatusOnline {
+ continue
+ }
+ tmsByGroup[srv.Location] =
append(tmsByGroup[srv.Location], srv)
+ }
+
+ for _, srv := range monitorConfig.TrafficMonitor {
+ if srv.HostName == staticAppData.Hostname ||
(cfg.DistributedPolling && srv.Location != thisTMGroup) {
continue
}
if tc.CacheStatusFromString(srv.ServerStatus) !=
tc.CacheStatusOnline {
continue
}
// TODO: the URL should be config driven. -jse
- url4 :=
fmt.Sprintf("http://%s:%d/publish/CrStates?raw", srv.IP, srv.Port)
- url6 :=
fmt.Sprintf("http://[%s]:%d/publish/CrStates?raw", ipv6CIDRStrToAddr(srv.IP6),
srv.Port)
- peerURLs[srv.HostName] = poller.PollConfig{URL: url4,
URLv6: url6, Host: srv.FQDN} // TODO determine timeout.
+ peerURL :=
fmt.Sprintf("http://%s:%d/publish/CrStates?raw", srv.FQDN, srv.Port)
Review comment:
Correct, TM peers will no longer oscillate between ipv4 and ipv6,
because there is no need. They now just poll each other using their FQDNs
(which may resolve to ipv4 or ipv6).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]