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

Database migration 2 for multiple interfaces#4730

Merged
ocket8888 merged 3 commits into
apache:masterfrom
mattjackson220:DHmigration2
Jul 29, 2020
Merged

Database migration 2 for multiple interfaces#4730
ocket8888 merged 3 commits into
apache:masterfrom
mattjackson220:DHmigration2

Conversation

@mattjackson220
Copy link
Copy Markdown
Contributor

What does this PR (Pull Request) do?

This is the second database migration for allowing multiple interfaces. It removes redundant columns from the server table that have been moved previously to the ip_address and interface tables.

This is labeled as a WIP for now because it needs to wait to be merged until the issues listed in issue 4620 have all been closed.

Which Traffic Control components are affected by this PR?

  • Traffic Ops

What is the best way to verify this PR?

Run the db migration and verify that it runs successfully and the columns have been removed. verify that the unit and API tests still run successfully
Run the rollback script and verify that the data has been populated correctly. Run the tests and make sure they work still.

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

The following criteria are ALL met by this PR

No tests, docs, or CHANGELOG updates are necessary since it is a data migration and database update.

  • This PR includes tests OR I have explained why tests are unnecessary
  • This PR includes documentation OR I have explained why documentation is unnecessary
  • This PR includes an update to CHANGELOG.md OR such an update is not necessary
  • 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)

Additional Information

@mattjackson220 mattjackson220 added new feature A new feature, capability or behavior WIP "Work-in-Progress" - do not merge! (use 'draft' pull requests from now on) database relating to setup/installation/structure of the Traffic Ops database labels May 28, 2020
@mattjackson220 mattjackson220 changed the title WIP - Database migration 2 for multiple interfaces Database migration 2 for multiple interfaces Jun 18, 2020
@mattjackson220 mattjackson220 removed the WIP "Work-in-Progress" - do not merge! (use 'draft' pull requests from now on) label Jun 18, 2020
Comment thread traffic_ops/app/db/migrations/20200607000000_remove_redundancy.sql Outdated
Copy link
Copy Markdown
Member

@zrhoffman zrhoffman left a comment

Choose a reason for hiding this comment

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

Getting 500 errors in CDN-in-a-Box on POST /api/2.0/servers:

trafficops_1                | INFO: routing.go:249: 2020-07-09T20:22:15.808249627Z: POST /api/2.0/servers? handling (reqid 984)
trafficops_1                | DEBUG: plugin.go:190: 2020-07-09T20:22:15.808264413Z: DEBUG plugins.OnRequest calling 0 plugins
trafficops_1                | INFO: servers.go:344: 2020-07-09T20:22:15.810194869Z: got cdn id: 1 from profile and cdn id: 1 from server
trafficops_1                | ERROR: api.go:201: 2020-07-09T20:22:15.810908686Z: 172.19.0.7:50894 pq: column "interface_name" of relation "server" does not exist
trafficops_1                | DEBUG: api.go:206: 2020-07-09T20:22:15.810921728Z: Internal Server Error

Copy link
Copy Markdown
Member

@zrhoffman zrhoffman left a comment

Choose a reason for hiding this comment

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

Everything is working, just have a question about the CASE expressions.

Comment thread traffic_ops/app/db/migrations/2020072700000000_remove_redundancy.sql Outdated
Comment thread traffic_ops/app/db/migrations/2020072700000000_remove_redundancy.sql Outdated
Copy link
Copy Markdown
Member

@zrhoffman zrhoffman left a comment

Choose a reason for hiding this comment

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

  • API tests pass
  • Unit tests pass (CI failure was due to #4919, unrelated to this PR)
  • SQL formatting is readable

LGTM!

@ocket8888 ocket8888 merged commit cc6f339 into apache:master Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

database relating to setup/installation/structure of the Traffic Ops database new feature A new feature, capability or behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove redundant database columns

3 participants