From d735833f70545cdbd3ab5d79b069b6afed5df030 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Fri, 26 Feb 2021 10:40:16 -0700 Subject: [PATCH] Select server topology ancestors from the same CDN as the base server (#5578) (cherry picked from commit eed246c7854f6f9aefab4b65ce6c35846460e8c9) --- CHANGELOG.md | 1 + .../traffic_ops_golang/server/servers_update_status.go | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2dc9d9e78..cc38fd10ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed an issue with 2020082700000000_server_id_primary_key.sql trying to create multiple primary keys when there are multiple schemas. - Fix for public schema in 2020062923101648_add_deleted_tables.sql - Moved move_lets_encrypt_to_acme.sql, add_max_request_header_size_delivery_service.sql, and server_interface_ip_address_cascade.sql past last migration in 5.0.0 +- [#5505](https://github.com/apache/trafficcontrol/issues/5505) - Make `parent_reval_pending` for servers in a Flexible Topology CDN-specific on `GET /servers/{name}/update_status` ### Changed - Refactored the Traffic Ops Go client internals so that all public methods have a consistent behavior/implementation diff --git a/traffic_ops/traffic_ops_golang/server/servers_update_status.go b/traffic_ops/traffic_ops_golang/server/servers_update_status.go index d1d2a67484..78bdd7f5ae 100644 --- a/traffic_ops/traffic_ops_golang/server/servers_update_status.go +++ b/traffic_ops/traffic_ops_golang/server/servers_update_status.go @@ -108,12 +108,16 @@ SELECT status.name AS status, /* True if the cachegroup parent or any ancestor topology node has pending updates. */ TRUE IN ( - SELECT sta.upd_pending FROM server_topology_ancestors sta WHERE sta.base_server_id = s.id + SELECT sta.upd_pending FROM server_topology_ancestors sta + WHERE sta.base_server_id = s.id + AND sta.cdn_id = s.cdn_id UNION SELECT COALESCE(BOOL_OR(ps.upd_pending), FALSE) ) AS parent_upd_pending, /* True if the cachegroup parent or any ancestor topology node has pending revalidation. */ TRUE IN ( - SELECT sta.reval_pending FROM server_topology_ancestors sta WHERE sta.base_server_id = s.id + SELECT sta.reval_pending FROM server_topology_ancestors sta + WHERE sta.base_server_id = s.id + AND sta.cdn_id = s.cdn_id UNION SELECT COALESCE(BOOL_OR(ps.reval_pending), FALSE) ) AS parent_reval_pending FROM use_reval_pending,