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 2020/10/22 22:50:15 UTC

[GitHub] [trafficcontrol] rawlinp opened a new pull request #5186: Check cache availability by IP version instead of filtering later

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:
users@infra.apache.org



[GitHub] [trafficcontrol] mattjackson220 merged pull request #5186: Check cache availability by IP version instead of filtering later

Posted by GitBox <gi...@apache.org>.
mattjackson220 merged pull request #5186:
URL: https://github.com/apache/trafficcontrol/pull/5186


   


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



[GitHub] [trafficcontrol] mattjackson220 commented on a change in pull request #5186: Check cache availability by IP version instead of filtering later

Posted by GitBox <gi...@apache.org>.
mattjackson220 commented on a change in pull request #5186:
URL: https://github.com/apache/trafficcontrol/pull/5186#discussion_r513761174



##########
File path: traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouterTest.java
##########
@@ -155,6 +156,55 @@ public void itCreatesHttpResults() throws Exception {
         assertThat(httpRouteResult.getUrl().toString(), equalTo("http://atscache.kabletown.net/index.html"));
     }
 
+    @Test
+    public void itFiltersByIPAvailability() throws Exception {
+
+        DeliveryService ds = mock(DeliveryService.class);
+
+        Cache cacheIPv4 = mock(Cache.class);
+        cacheIPv4.setIsAvailable(true);

Review comment:
       duplicated at line 172




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



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5186: Check cache availability by IP version instead of filtering later

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #5186:
URL: https://github.com/apache/trafficcontrol/pull/5186#discussion_r516263472



##########
File path: traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouterTest.java
##########
@@ -155,6 +156,55 @@ public void itCreatesHttpResults() throws Exception {
         assertThat(httpRouteResult.getUrl().toString(), equalTo("http://atscache.kabletown.net/index.html"));
     }
 
+    @Test
+    public void itFiltersByIPAvailability() throws Exception {
+
+        DeliveryService ds = mock(DeliveryService.class);
+
+        Cache cacheIPv4 = mock(Cache.class);
+        cacheIPv4.setIsAvailable(true);

Review comment:
       de-duplicated in https://github.com/apache/trafficcontrol/pull/5186/commits/6c1cbb0dc7c69c01cbb97fbb5790a08df568c059




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