Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODB should cascade delete interfaces and IP addresses when deleting a server via SQL #5364

Closed
rawlinp opened this issue Dec 8, 2020 · 0 comments · Fixed by #5402
Closed
Labels
bug something isn't working as intended database relating to setup/installation/structure of the Traffic Ops database low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops

Comments

@rawlinp
Copy link
Contributor

rawlinp commented Dec 8, 2020

I'm submitting a ...

  • bug report

Traffic Control components affected ...

  • Traffic Ops

Current behavior:

When trying to delete a server via DELETE FROM server WHERE ..., you are restricted due to the ON DELETE RESTRICT FK clauses on the interface and ip_address tables. Additionally, deleting server interfaces is restricted via the ON DELETE RESTRICT FK clause on the ip_address table.

Expected behavior:

If you delete a server via DELETE FROM server WHERE ..., it should cascade delete all the server's associated interfaces and IP addresses. If you delete an interface, it should cascade delete all the interface's associated IP addresses.

Basically these FK clauses should be ON DELETE CASCADE instead of ON DELETE RESTRICT.

Minimal reproduction of the problem with instructions:

For a server that has at least one interface, attempt to delete it via the SQL query: DELETE FROM server WHERE id = .... For an interface with at least one IP address, attempt to delete it via the SQL query: DELETE FROM interface WHERE server = ... AND name = ....

@rawlinp rawlinp added bug something isn't working as intended Traffic Ops related to Traffic Ops low impact affects only a small portion of a CDN, and cannot itself break one database relating to setup/installation/structure of the Traffic Ops database labels Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended database relating to setup/installation/structure of the Traffic Ops database 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 a pull request may close this issue.

1 participant