This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new eed246c Select server topology ancestors from the same CDN as the
base server (#5578)
eed246c is described below
commit eed246c7854f6f9aefab4b65ce6c35846460e8c9
Author: Zach Hoffman <[email protected]>
AuthorDate: Fri Feb 26 10:40:16 2021 -0700
Select server topology ancestors from the same CDN as the base server
(#5578)
---
CHANGELOG.md | 1 +
traffic_ops/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 98bc05a..23bac3d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -62,6 +62,7 @@ The format is based on [Keep a
Changelog](http://keepachangelog.com/en/1.0.0/).
- Fix for public schema in 2020062923101648_add_deleted_tables.sql
- Fixed and issue with 2020082700000000_server_id_primary_key.sql trying to
create multiple primary keys when there are multiple schemas.
- 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 d1d2a67..78bdd7f 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,