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 2022/09/19 19:25:56 UTC

[GitHub] [trafficcontrol] rob05c commented on a diff in pull request #7043: Fix t3c non-topo edge-origin DS params

rob05c commented on code in PR #7043:
URL: https://github.com/apache/trafficcontrol/pull/7043#discussion_r974596651


##########
lib/go-atscfg/remapdotconfig.go:
##########
@@ -1002,11 +1002,53 @@ func serverIsLastCacheForDS(server *Server, ds *DeliveryService, topologies map[
 		return topoPlacement.IsLastCacheTier, nil
 	}
 
-	return noTopologyServerIsLastCacheForDS(server, ds), nil
+	return noTopologyServerIsLastCacheForDS(server, ds, cacheGroups), nil
 }
 
 // noTopologyServerIsLastCacheForDS returns whether the server is the last tier for the DS, if the DS has no Topology.
 // This helper MUST NOT be called if the DS has a Topology. It does not check.
-func noTopologyServerIsLastCacheForDS(server *Server, ds *DeliveryService) bool {
-	return strings.HasPrefix(server.Type, tc.MidTypePrefix) || !ds.Type.UsesMidCache()
+func noTopologyServerIsLastCacheForDS(server *Server, ds *DeliveryService, cgs map[tc.CacheGroupName]tc.CacheGroupNullable) bool {
+	if strings.HasPrefix(server.Type, tc.MidTypePrefix) {
+		return true // if the type is "MID" it's always the last cache for non-topologies
+	}
+	if !ds.Type.UsesMidCache() {
+		return true // if this DS type never uses mids (for pre-topology type-parentage), it's the last cache
+	}
+
+	// pre-topology parentage is based on Cachegroups
+
+	if server.Cachegroup == nil {
+		// if the server has no CG (which TO shouldn't allow), it can't possibly have parents.
+	}

Review Comment:
   Nope, missed the return. Fixed.



-- 
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: issues-unsubscribe@trafficcontrol.apache.org

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