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 2021/01/07 18:50:33 UTC

[GitHub] [trafficcontrol] rob05c opened a new issue #5413: Traffic Ops /api/3.0/servers/:host_name/update_status returns pending true for OFFLINE topology parents

rob05c opened a new issue #5413:
URL: https://github.com/apache/trafficcontrol/issues/5413


   ## I'm submitting a ...
   -  bug report
   
   ## Traffic Control components affected ...
   -  Traffic Ops
   
   ## Current behavior:
   /api/3.0/servers/:host_name/update_status (but not /api/2.0 it appears) returns parent_pending and parent_reval_pending true if parents that aren't ONLINE or REPORTED are pending (which are likely offline, and will never update).
   
   This breaks ORT, which will never update or reval those children.
   
   It appears the problem is here https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/server/servers_update_status.go#L56
   
   I think I see what's happening in the query.
   The `parentservers` CTE is checking `WHERE pstatus.name != $1`
   But the `server_topology_ancestors` doesn't, nor do either of the final 2 subqueries that use it,
   `SELECT sta.upd_pending FROM server_topology_ancestors sta WHERE sta.base_server_id = s.id`.
   I think either adding the check to `parentservers`, or else the 2 places it's used:
   ```
   SELECT sta.upd_pending FROM server_topology_ancestors sta WHERE sta.base_server_id = s.id and sta.status <> (select id from status where name = $1)
   ```
   Fixes it.
   
   Also, the query only checks `<> OFFLINE`. I think it really needs to exclude everything not ONLINE or REPORTED. So, I think everything `<> OFFLINE` needs changed to `NOT IN (ONLINE, REPORTED)`.
   
   ## Expected behavior:
   
   /api/3.0/servers/:host_name/update_status only returns parent_pending or parent_reval_pending true if ONLINE or REPORTED parents are upd_pending or reval_pending.
   
   ## Minimal reproduction of the problem with instructions:
   Set up topologies, set a Mid in the Topology to OFFLINE and queue updates on it. Queue a child, and then run ORT on that child, or request 
   
   ## Anything else:
   <!--
   e.g. stacktraces, related issues, suggestions how to fix (feel free to delete
   this section)
   -->
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       https://apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


----------------------------------------------------------------
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 closed issue #5413: Traffic Ops /api/3.0/servers/:host_name/update_status returns pending true for OFFLINE topology parents

Posted by GitBox <gi...@apache.org>.
rawlinp closed issue #5413:
URL: https://github.com/apache/trafficcontrol/issues/5413


   


----------------------------------------------------------------
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 closed issue #5413: Traffic Ops /api/3.0/servers/:host_name/update_status returns pending true for OFFLINE topology parents

Posted by GitBox <gi...@apache.org>.
rawlinp closed issue #5413:
URL: https://github.com/apache/trafficcontrol/issues/5413


   


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