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

Snapshot interfaces#4709

Merged
rawlinp merged 7 commits intoapache:masterfrom
ocket8888:snapshot-interfaces
Jun 11, 2020
Merged

Snapshot interfaces#4709
rawlinp merged 7 commits intoapache:masterfrom
ocket8888:snapshot-interfaces

Conversation

@ocket8888
Copy link
Copy Markdown
Contributor

@ocket8888 ocket8888 commented May 20, 2020

What does this PR (Pull Request) do?

Updates CDN Snapshot generation to account for multiple server interfaces.

Which Traffic Control components are affected by this PR?

  • Traffic Ops

What is the best way to verify this PR?

Run the unit and API tests, run CDN-in-a-Box and verify the snapshot is successful.

The following criteria are ALL met by this PR

  • No interface change, so existing tests should be sufficient
  • No interface change, so no documentation necessary
  • This PR includes an update to CHANGELOG.md
  • This PR includes any and all required license headers
  • This PR does not include a database migration
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY

@ocket8888 ocket8888 force-pushed the snapshot-interfaces branch from 6dd2f27 to 8fcbfbf Compare May 21, 2020 21:13
@ocket8888 ocket8888 mentioned this pull request Jun 4, 2020
7 tasks
@ocket8888 ocket8888 force-pushed the snapshot-interfaces branch from 8fcbfbf to bd7149f Compare June 8, 2020 16:15
@ocket8888 ocket8888 force-pushed the snapshot-interfaces branch from bd7149f to b922922 Compare June 9, 2020 18:45
@ocket8888 ocket8888 added improvement The functionality exists but it could be improved in some way. low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops labels Jun 9, 2020
@ocket8888 ocket8888 marked this pull request as ready for review June 9, 2020 23:38
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.

> go test ./...
--- FAIL: TestGetAllServers (0.00s)
    servers_test.go:208: getAllServers expected: nil error, actual: Error querying servers: Query 'SELECT s.id, s.host_name, cg.name as cachegroup, concat(s.host_name, '.', s.domain_name) AS fqdn, s.xmpp_id AS hashid, s.https_port, s.tcp_port, p.name AS profile_name, cast(p.routing_disabled AS int), st.name AS status, t.name AS type FROM server AS s INNER JOIN cachegroup AS cg ON cg.id = s.cachegroup INNER JOIN type AS t on t.id = s.type INNER JOIN profile AS p ON p.id = s.profile INNER JOIN status AS st ON st.id = s.status WHERE cdn_id = (SELECT id FROM cdn WHERE name = $1) AND (st.name = 'REPORTED' OR st.name = 'ONLINE' OR st.name = 'ADMIN_DOWN')', does not match regex [select]
--- FAIL: TestGetAllServersNonService (0.00s)
    servers_test.go:254: getAllServers expected: nil error, actual: Error querying servers: Query 'SELECT s.id, s.host_name, cg.name as cachegroup, concat(s.host_name, '.', s.domain_name) AS fqdn, s.xmpp_id AS hashid, s.https_port, s.tcp_port, p.name AS profile_name, cast(p.routing_disabled AS int), st.name AS status, t.name AS type FROM server AS s INNER JOIN cachegroup AS cg ON cg.id = s.cachegroup INNER JOIN type AS t on t.id = s.type INNER JOIN profile AS p ON p.id = s.profile INNER JOIN status AS st ON st.id = s.status WHERE cdn_id = (SELECT id FROM cdn WHERE name = $1) AND (st.name = 'REPORTED' OR st.name = 'ONLINE' OR st.name = 'ADMIN_DOWN')', does not match regex [select]
FAIL
FAIL	github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/crconfig	0.010s
FAIL

Comment thread traffic_ops/traffic_ops_golang/crconfig/servers.go Outdated
@rawlinp
Copy link
Copy Markdown
Contributor

rawlinp commented Jun 11, 2020

Unit test job failed with this:

unit_1  | === RUN   TestGetMidServers
unit_1  |     TestGetMidServers: servers_test.go:475: getMidServers expected: len(mid) == 1, actual: 0
unit_1  | --- FAIL: TestGetMidServers (0.00s)

Comment thread traffic_ops/traffic_ops_golang/dbhelpers/db_helpers.go
@ocket8888
Copy link
Copy Markdown
Contributor Author

I can't reproduce that failure. All unit tests are passing for me.

@rawlinp
Copy link
Copy Markdown
Contributor

rawlinp commented Jun 11, 2020

Ok, I'll pull this down and test when the CI completes again.

@shamrickus
Copy link
Copy Markdown
Member

The unit tests pass for me as well.

Copy link
Copy Markdown
Contributor

@rawlinp rawlinp left a comment

Choose a reason for hiding this comment

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

TO API tests pass, unit tests pass, taking a snapshot appears to be good (only saw ipv6 addresses going from uppercase to lowercase which seems to be expected now).

@rawlinp rawlinp merged commit a3d76f8 into apache:master Jun 11, 2020
@ocket8888 ocket8888 deleted the snapshot-interfaces branch June 11, 2020 19:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

improvement The functionality exists but it could be improved in some way. low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update /cdns/{{name}}/snapshot/new to use data from the new interfaces tables Update /cdns/{{name}}/snapshot to use data from new interfaces tables

3 participants