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

Last-Server-In-Cache Group validation runs when Cache Group has not changed #5165

@zrhoffman

Description

@zrhoffman

I'm submitting a ...

  • bug report

Traffic Control components affected ...

  • Traffic Ops

Current behavior:

Server validation will fail due to it being the last Server in its Cache Group if

  1. The Server is in a Topology-based Cache Group
  2. The Server is updated

Expected behavior:

Validation should only fail on a Server due to it being the last Server in its Cache Group if the Cache Group of the Server has changed.

Minimal reproduction of the problem with instructions:

  1. Make a Cache Group
  2. Make a Server
  3. Add the Server to the Cache Group
  4. Make a Topology
  5. Add the Server to the Topology
  6. Update the Server without changing anything

Anything else:

Found because UniqueIPProfileTestServers runs on a random Server each time and was failing 20% of the time due to this bug. Last 12 lines of that:

servers_test.go:296: Response:  midInTopologyEdgeCg06   {[{Server created success}]}
servers_test.go:296: Response:  midInTopologyEdgeCg07   {[{Server created success}]}
topologies_test.go:56: Response:  &{{a multi-site origin topology mso-topology [{0 multiOriginCachegroup [] <nil>} {0 parentCachegroup [0] <nil>} {0 secondaryCachegroup [0] <nil>} {0 cachegroup3 [1 2] <nil>}] <nil>} {[{topology was created. success}]}}
topologies_test.go:56: Response:  &{{another topology another-topology [{0 parentCachegroup [] <nil>} {0 cachegroup1 [0] <nil>} {0 secondaryCachegroup [] <nil>} {0 cachegroup2 [2] <nil>}] <nil>} {[{topology was created. success}]}}
topologies_test.go:56: Response:  &{{A topology with secondary parents secondary-parents [{0 parentCachegroup [] <nil>} {0 cachegroup1 [0 2] <nil>} {0 secondaryCachegroup [] <nil>} {0 fallback1 [2 0] <nil>} {0 fallback2 [2 0] <nil>}] <nil>} {[{topology was created. success}]}}
topologies_test.go:56: Response:  &{{A 4-tier topology 4-tiers [{0 parentCachegroup [] <nil>} {0 parentCachegroup2 [0] <nil>} {0 cachegroup1 [1] <nil>} {0 secondaryCachegroup [1 0] <nil>} {0 fallback1 [3] <nil>}] <nil>} {[{topology was created. success}]}}
topologies_test.go:56: Response:  &{{This topology stems from 2 ancestors forked-topology [{0 topology-edge-cg-01 [2] <nil>} {0 topology-edge-cg-02 [6] <nil>} {0 topology-mid-cg-01 [3] <nil>} {0 topology-mid-cg-02 [4] <nil>} {0 topology-mid-cg-03 [5] <nil>} {0 topology-mid-cg-04 [] <nil>} {0 topology-mid-cg-05 [7] <nil>} {0 topology-mid-cg-06 [8] <nil>} {0 topology-mid-cg-07 [] <nil>}] <nil>} {[{topology was created. success}]}}
topologies_test.go:56: Response:  &{{a topology top-for-ds-req [{0 dtrc1 [] <nil>} {0 dtrc2 [0] <nil>} {0 dtrc3 [0] <nil>}] <nil>} {[{topology was created. success}]}}
topologies_test.go:56: Response:  &{{a topology top-for-ds-req2 [{0 dtrc1 [] <nil>} {0 dtrc2 [0] <nil>}] <nil>} {[{topology was created. success}]}}
servers_test.go:653: expected update to pass: 400 Bad Request[400] - Error requesting Traffic Ops https://localhost:6443/api/3.0/servers/47122 {"alerts":[{"text":"server is the last one in its cachegroup, which is used by a topology, so it cannot be moved to another cachegroup: cachegroups with no servers in them: multiOriginCachegroup in topologies: mso-topology","level":"error"}]}
types_test.go:208: ---- DeleteTestTypes ----
--- FAIL: TestServers (8.35s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Traffic Opsrelated to Traffic Opsregression buga bug in existing functionality introduced by a new version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions