You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/01/08 15:47:14 UTC

[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5416: Limit which Topology parent CacheGroup Servers to check for updates

rawlinp commented on a change in pull request #5416:
URL: https://github.com/apache/trafficcontrol/pull/5416#discussion_r554021921



##########
File path: traffic_ops/traffic_ops_golang/server/servers_update_status.go
##########
@@ -51,39 +53,44 @@ func getServerUpdateStatus(tx *sql.Tx, cfg *config.Config, hostName string) ([]t
 
 	selectQuery := `
 /* topology_ancestors finds the ancestor topology nodes of the topology node for
- * the cachegroup containing server $4.
+ * the cachegroup containing server $5.
  */
 WITH RECURSIVE topology_ancestors AS (
 /* This is the base case of the recursive CTE, the topology node for the
- * cachegroup containing server $4.
+ * cachegroup containing server $5.
  */
 	SELECT tcp.child parent, NULL cachegroup, s.id base_server_id
 	FROM "server" s
 	JOIN cachegroup c ON s.cachegroup = c.id
 	JOIN topology_cachegroup tc ON c."name" = tc.cachegroup
 	JOIN topology_cachegroup_parents tcp ON tc.id = tcp.child
-	WHERE s.host_name = $4
+	WHERE s.host_name = $5
 UNION ALL
 /* Find all direct topology parent nodes tc of a given topology ancestor ta. */
 	SELECT tcp.parent, tc.cachegroup, ta.base_server_id
 	FROM topology_ancestors ta, topology_cachegroup_parents tcp
 	JOIN topology_cachegroup tc ON tcp.parent = tc.id
+	JOIN cachegroup c ON tc.cachegroup = c."name"
+	JOIN "type" t ON c."type" = t.id
 	WHERE ta.parent = tcp.child
+	AND t."name" = ANY($4::TEXT[])

Review comment:
       I think we may want to support cachegroup types other than EDGE_LOC/MID_LOC, but still require them to have either the EDGE or MID prefix. E.g. EDGE_FOO_LOC or MID_BAR_LOC. So we should probably start just checking for the EDGE/MID prefix now, similar to how we check the EDGE/MID prefix for server types.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org