apache / trafficcontrol

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

Traffic Ops update_status endpoint returns empty response without use_reval_pending parameter set in global profile #1595

Closed rivasj closed 6 years ago

rivasj commented 6 years ago

The endpoint at: /api/1.3/servers/$hostname_short/update_status returns an empty response if use_reval_pending parameter is not in the global profile. This is causing the ORT script to fail when run with the 'syncds' flag.

The perl endpoint at: /update/$hostname did not require this parameter to exist.

mitchell852 commented 6 years ago

@DylanVolz - can you look at this?

DylanVolz commented 6 years ago

This is being defaulted in the query now on master and the pull request here: https://github.com/apache/incubator-trafficcontrol/pull/1596 will fix the issues with coalesce.

mitchell852 commented 6 years ago

@rivasj - can you close this if all is good now?

dg4prez commented 6 years ago

It looks to me like the go version of the API is returning a value for reval_pending and parent_reval_pending regardless of the status or existence of use_reval_pending in global. This is not how the 1.2 api functioned, nor is it how ORT functions - if the parameter exists, it assumes that reval_pending is in use and does not check revalidation status. This will absolutely break invalidation unless reval pending is actually enabled. For backwards compatibility, the API needs to be updated to remove this value from the json, or we need to modify the ort script to change how it functions.

dg4prez commented 6 years ago

correction - not the 1.2 api: the UI server status page.

The old method set reval_pending to undef if use_reval_pending was not set to 1. The go API should do the same.

dg4prez commented 6 years ago

ORT fixed to use new API changes in https://github.com/apache/incubator-trafficcontrol/pull/2158