Port deletion fails due to foreign key constraint
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Rodolfo Alonso |
Bug Description
During a VM deletion, the port cannot be deleted with the following error: http://
2021-05-24 10:55:05.495 29 ERROR neutron.
2021-05-24 10:55:05.495 29 ERROR neutron.
The referred port has a floating IP assigned that is concurrently deleted.
This error happens when the VM, created with Heat, is deleted.
More information about the deployment in https:/
Changed in neutron: | |
status: | New → In Progress |
Changed in neutron: | |
importance: | Undecided → Medium |
Changed in neutron: | |
assignee: | nobody → Rodolfo Alonso (rodolfo-alonso-hernandez) |
I think we should change the "floatingip" DB model definition. The "fixed_port" (the internal fixed IP port, attached to a VM) should be "viewonly" attribute to the "floatingip" object. From [1] (version 1.4, but I think you are using an older one, I need to check that once I have access):
""" viewonly can work with a wider range of SQL operations within the relationship. primaryjoin condition, including operations that feature the use of a variety of comparison operators as well as SQL functions such as cast(). The relationship. viewonly flag is also of general use when defining any kind of relationship() that doesn’t represent the full set of related objects, to prevent modifications of the collection from resulting in persistence operations.
When set to True, the relationship is used only for loading objects, and not for any persistence operation. A relationship() which specifies relationship.
When using the relationship. viewonly flag in conjunction with backrefs, the originating relationship for a particular state change will not produce state changes within the viewonly relationship. This is the behavior implied by relationship. sync_backref being set to False.
"""
That means a change in the viewed object ("port") won't produce changes in the backref ("floatingip").