rawlinp opened a new pull request #5186: URL: https://github.com/apache/trafficcontrol/pull/5186
## What does this PR (Pull Request) do? If the returned caches turn out to all be unavailable for the client's IP version, we don't want to 503. Instead, we want to follow the regular cache availability logic (falling back to closest available location, etc). In order to do this, TR needs to consider the requested IP version when determining individual cache availability. ## Which Traffic Control components are affected by this PR? - Traffic Router ## What is the best way to verify this PR? Run the TM unit (covered by the github checks) and integration tests, verify they pass. Mock the TM `/publish/CrStates` endpoint, have TR poll it via `traffic_monitor.bootstrap.hosts`, then change the IP availability of an expected cache (must be the only available one in its cachegroup) to be returned from a given request for an HTTP delivery service and a DNS delivery service. 1. Make a request to the HTTP DS w/ `curl -4`, verify the expected cache is returned via 302. 2. Set `ipv4Available` to `false`, repeat the previous curl, and verify that a cache from the next closest cachegroup is returned instead. 3. Make a request w/ `curl -6`, verify the expected cache is returned via 302. 4. Set `ipv4Available` to `true` and `ipv6Available` to `false`, repeat the previous curl, and verify that a cache from the next closest cachegroup is returned instead. 5. Set both to `true`. 6. Make a request to the DNS DS w/ `dig <fqdn> A`, verify the IP of the expected cache is returned. 7. Set `ipv4Available` to `false`, repeat the previous dig, and verify that one or more IPs from the next closest cachegroup are returned instead. 8. Make a request to the DNS DS w/ `dig <fqdn> AAAA`, verify the IPv6 of the expected cache is returned. 9. Set `ipv4Available` to `true` and `ipv6Available` to `false`, repeat the previous dig, and verify that one or more IPv6s from the next closest cachegroup are returned instead. Without this fix, steps 2 and 4 would return a 503, and steps 7 and 9 would return NXDOMAIN. ## If this is a bug fix, what versions of Traffic Control are affected? - master - 5.0.0-RC1 - 4.1.0 ## The following criteria are ALL met by this PR - [x] This PR includes tests OR I have explained why tests are unnecessary - [x] bugfix, no docs necessary - [x] This PR includes an update to CHANGELOG.md OR such an update is not necessary - [x] This PR includes any and all required license headers - [x] This PR ensures that database migration sequence is correct OR this PR does not include a database migration - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details) ---------------------------------------------------------------- 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: [email protected]
