Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Fixes the inability to clone ds assignments across servers when 1+ ds is assigned a topology#4905

Merged
ocket8888 merged 2 commits intoapache:masterfrom
mitchell852:top-ds-server-assign
Jul 23, 2020
Merged

Fixes the inability to clone ds assignments across servers when 1+ ds is assigned a topology#4905
ocket8888 merged 2 commits intoapache:masterfrom
mitchell852:top-ds-server-assign

Conversation

@mitchell852
Copy link
Copy Markdown
Member

@mitchell852 mitchell852 commented Jul 22, 2020

What does this PR (Pull Request) do?

With the introduction of topologies, it no longer makes sense to assign caches directly to a delivery service if that ds utilizes a topology. Therefore, a constraint was added to the following api in #4702 to prevent delivery services from being assigned directly to a server if that delivery service utilizes a topology:

POST api/version/servers/{server-id}/deliveryservices

However, a common practice when provisioning new caches is to clone the ds assignments (or bulk assign) from an existing cache to the newly provisioned cache using the aforementioned endpoint. However, due to the new constraint added in #4702, this activity will inevitably fail as more delivery services start to use topologies but were never directly unassigned from the servers in which they were previously assigned. Confused yet?

Anyhow, removing this constraint will ease the transition from delivery services that utilize a topology and other delivery services that choose to assign servers directly.

In addition, when assigning ds's directly to a server, it makes no sense to directly assign topology-based ds's to a server, therefore, those ds's have been disabled (or are unselectable) in TP.

TLDR; this PR allows bulk assignment of ds's to a server even if one of those ds's utilizes a topology but prevents individual assignment of a ds with a topology to a server (in TP). Because bulk assignment is part of the new server provisioning playbook and cannot be broken.

Which Traffic Control components are affected by this PR?

  • Traffic Ops

What is the best way to verify this PR?

  • Run the API and UI tests and/or
  • curl -X POST --data '[dsId]' https://trafficops.domain.com/api/3.x/servers/{server-id}/deliveryservices?replace=true where dsId is the id of a delivery service that utilizes a topology. The POST should succeed.
  • in TP:
    -- edit a delivery service to use a topology. create a topology first if you have to.
    -- view the delivery services of a server in the same cdn - https://tp.domain.com/#!/servers/{server-id}/delivery-services
    -- click on the Link Delivery Services to Server button
    -- notice that the delivery service with the topology assigned cannot be selected for direct assignment to the server.

If this is a bug fix, what versions of Traffic Control are affected?

  • master

The following criteria are ALL met by this PR

  • This PR includes tests OR I have explained why tests are unnecessary
  • This PR does NOT include documentation
  • This PR does NOT include an update to CHANGELOG.md as the bug was introduced between releases
  • This PR includes any and all required license headers
  • This PR ensures that database migration sequence is correct OR this PR does not include a database migration
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)

…g POST api/1.x|2.x|3.x/servers/{server-id}/deliveryservices
@mitchell852 mitchell852 added bug something isn't working as intended Traffic Ops related to Traffic Ops labels Jul 22, 2020
@mitchell852 mitchell852 added the Traffic Portal v1 related to Traffic Portal version 1 label Jul 23, 2020
Copy link
Copy Markdown
Member

@shamrickus shamrickus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  • TO unit/integration tests pass
  • TP integration tests pass
  • No go fmt issues
  • Able to assign Servers to DS with Topologies
  • TP disables assigning single topology based ds to a server

@ocket8888 ocket8888 merged commit 64564a0 into apache:master Jul 23, 2020
@zrhoffman zrhoffman added this to the Flexible Topologies milestone Sep 18, 2020
@zrhoffman zrhoffman removed this from the Flexible Topologies milestone Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug something isn't working as intended Traffic Ops related to Traffic Ops Traffic Portal v1 related to Traffic Portal version 1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TP: only delivery services not assigned to a topology can be assigned directly to a server

4 participants