apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.06k stars 340 forks source link

mid header rewrite location parameter creation is sending to the incorrect CDN #2460

Closed saoyag001 closed 5 years ago

saoyag001 commented 6 years ago

Steps to reproduce. Create a DS with a mid header rewrite in cdn a check parameters that are created. hdr_rw_mid_XML-ID.config will show in an incorrect CDN if the Traffic control instance has more than one CDN.

rob05c commented 6 years ago

This can't be Go, because DS creation where it was observed isn't in Go yet

mitchell852 commented 6 years ago

may be related to #2176 as well

mitchell852 commented 6 years ago

I tried this in TP (which uses the TO API) and it worked fine for me. I created a DNS DS (xml-id=bad-hdr) in CDN A and added a value for "Mid Header Rewrite Rules". then flipped over to the parameters view and searched for any parameters that were dynamically created for bad-hdr. i found one

image

clicked on it and checked with profile(s) it belonged to. It belonged to 2 profiles both part of CDN A...

this was checked against the head of master...

mitchell852 commented 6 years ago

@saoyag001 - need to know what version of TO this bug was observed in.

mitchell852 commented 6 years ago

also, i think this can happen if a DS from CDN A has a cache assigned to it from CDN B.

rob05c commented 6 years ago

This was encountered in the Perl. The endpoint has since been rewritten in Go, which only creates parameters for profiles of servers on the same CDN as the DS https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go#L840

Which is to say, it should be fixed in master.

dneuman64 commented 5 years ago

I tested this in the latest 3.x release and it is no longer an issue. Closing.