)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"871cd82eaf9cf40e03b223a2cb63bba6756f1757","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Today if live migration has failed after the inactive"},{"line_number":10,"context_line":"binding was created on the destination node but before"},{"line_number":11,"context_line":"the activation of the binding. the port\u0027s binding level"},{"line_number":12,"context_line":"for the destination host is not cleared during nova\u0027s API call to neutron"},{"line_number":13,"context_line":"to delete the port binding."},{"line_number":14,"context_line":"This causes future attempts to perform live migration of the instance"},{"line_number":15,"context_line":"to the same host to fail."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_b27447d0","line":12,"updated":"2019-01-31 17:53:07.000000000","message":"Please, restrict the commit message line length to 72 chars\n\nhttps://www.python.org/dev/peps/pep-0008/#maximum-line-length","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"74be255dc0fc6062e90a247706b64cd0db98f1f0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Today if live migration has failed after the inactive"},{"line_number":10,"context_line":"binding was created on the destination node but before"},{"line_number":11,"context_line":"the activation of the binding. the port\u0027s binding level"},{"line_number":12,"context_line":"for the destination host is not cleared during nova\u0027s API call to neutron"},{"line_number":13,"context_line":"to delete the port binding."},{"line_number":14,"context_line":"This causes future attempts to perform live migration of the instance"},{"line_number":15,"context_line":"to the same host to fail."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_25c161e5","line":12,"in_reply_to":"9fdfeff1_b27447d0","updated":"2019-02-10 14:11:07.000000000","message":"Done","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"871cd82eaf9cf40e03b223a2cb63bba6756f1757","unresolved":false,"context_lines":[{"line_number":17,"context_line":"This change removes port binding level object during port binding deletion."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"**missing unit tests"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: Idd55f7d24a2062c08ac8a0dc2243625632d962a5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_f25def78","line":20,"updated":"2019-01-31 17:53:07.000000000","message":"Do you have a bug report? Could be very useful to have some error examples.\n\nBTW, when a port is bound, plugin.ML2Plugin.create_port_binding(), and the variable \"is_active_binding\", in \"_process_active_binding_change\" the port binding levels are deleted. When this error you are referring is happening.\n\nAnyway, if the PortBinding is deleted, the PortBindingLevels should be deleted too.","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"74be255dc0fc6062e90a247706b64cd0db98f1f0","unresolved":false,"context_lines":[{"line_number":17,"context_line":"This change removes port binding level object during port binding deletion."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"**missing unit tests"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: Idd55f7d24a2062c08ac8a0dc2243625632d962a5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_2566412b","line":20,"in_reply_to":"9fdfeff1_f25def78","updated":"2019-02-10 14:11:07.000000000","message":"Hi, I have created a bug report with repro steps examples and some log samples that i think are relevant to convey the issue.\n\nI am refering to the case where an inactive binding was created (never activated) and then deleted.\n\nthis may happen during VM Live migration in case libvirt fails to perform the migration. (e.g qemu migration port is blocked) nova then performs some cleanup which deletes the created (and inactive) binding.","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"871cd82eaf9cf40e03b223a2cb63bba6756f1757","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9fdfeff1_b2af6728","line":22,"updated":"2019-01-31 17:53:07.000000000","message":"PortBindingLevels should depend on PortBinding too, and have a dependency on PortBinding ondelete\u003dCASCADE. That means when a PortBinding is deleted, all levels are deleted too.\n\nMaybe this change is too intrusive, because it implies to modify the database. Maybe just deleting the levels when Nova calls the delete function is enough.","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"74be255dc0fc6062e90a247706b64cd0db98f1f0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9fdfeff1_0531bd0b","line":22,"in_reply_to":"9fdfeff1_b2af6728","updated":"2019-02-10 14:11:07.000000000","message":"when nova uses multiple port binding during live migration it uses port binding delete:\nDELETE /v2.0/ports/​{port_id}​/bindings/{host_id} as depicted in [1]\n\ni would expect that the following series of calls:\n1. create an inactive port binding for host B\n2. delete port binding for host B\nwould leave the system in a state as it was before step 1.\n\nan alternative to the fix would be to modify the tables relations as you propose. (will need some pointers if we decide to go this way)\n\n\n[1] https://specs.openstack.org/openstack/nova-specs/specs/queens/approved/neutron-new-port-binding-api.html","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"871cd82eaf9cf40e03b223a2cb63bba6756f1757","unresolved":false,"context_lines":[{"line_number":2277,"context_line":"        ports_obj.PortBinding.delete_objects(context,"},{"line_number":2278,"context_line":"                                             host\u003dhost,"},{"line_number":2279,"context_line":"                                             port_id\u003dport_id)"},{"line_number":2280,"context_line":"        ports_obj.PortBindingLevel.delete_objects(context,"},{"line_number":2281,"context_line":"                                                  host\u003dhost,"},{"line_number":2282,"context_line":"                                                  port_id\u003dport_id)"},{"line_number":2283,"context_line":"        # TODO(adrianc): need to perform checks before"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_12651346","line":2280,"updated":"2019-01-31 17:53:07.000000000","message":"There is a function, plugins.ml2.db.clear_binding_levels(), to execute this cleanup.","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"74be255dc0fc6062e90a247706b64cd0db98f1f0","unresolved":false,"context_lines":[{"line_number":2277,"context_line":"        ports_obj.PortBinding.delete_objects(context,"},{"line_number":2278,"context_line":"                                             host\u003dhost,"},{"line_number":2279,"context_line":"                                             port_id\u003dport_id)"},{"line_number":2280,"context_line":"        ports_obj.PortBindingLevel.delete_objects(context,"},{"line_number":2281,"context_line":"                                                  host\u003dhost,"},{"line_number":2282,"context_line":"                                                  port_id\u003dport_id)"},{"line_number":2283,"context_line":"        # TODO(adrianc): need to perform checks before"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_e06fc7c2","line":2280,"in_reply_to":"9fdfeff1_12651346","updated":"2019-02-10 14:11:07.000000000","message":"Done","commit_id":"dd56db2dd55c36eea7f2564e7cc838378dbd42ae"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"8f4ea8ecae76906233327a58939047cfd7544fb8","unresolved":false,"context_lines":[{"line_number":2274,"context_line":"    @utils.transaction_guard"},{"line_number":2275,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":2276,"context_line":"    def delete_port_binding(self, context, host, port_id):"},{"line_number":2277,"context_line":"        ports_obj.PortBinding.delete_objects(context,"},{"line_number":2278,"context_line":"                                             host\u003dhost,"},{"line_number":2279,"context_line":"                                             port_id\u003dport_id)"},{"line_number":2280,"context_line":"        db.clear_binding_levels(context,"},{"line_number":2281,"context_line":"                                port_id\u003dport_id,"},{"line_number":2282,"context_line":"                                host\u003dhost)"},{"line_number":2283,"context_line":"        # TODO(adrianc): need to perform checks before"},{"line_number":2284,"context_line":"        #  deleting port binding levels ?"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_036f82fc","line":2284,"range":{"start_line":2277,"start_character":0,"end_line":2284,"end_character":41},"updated":"2019-02-22 11:44:17.000000000","message":"it seem like you should do what is done here [1]  \n\n[1] - https://github.com/openstack/neutron/blob/9df57adf6006d11dae62fea753749a89cb6f11b5/neutron/plugins/ml2/plugin.py#L403-L408","commit_id":"f8743897ee378b426b2e1fce808d47966c09b808"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"041731d3f19bd068eea3744a6ddc664ad515e4ca","unresolved":false,"context_lines":[{"line_number":2274,"context_line":"    @utils.transaction_guard"},{"line_number":2275,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":2276,"context_line":"    def delete_port_binding(self, context, host, port_id):"},{"line_number":2277,"context_line":"        ports_obj.PortBinding.delete_objects(context,"},{"line_number":2278,"context_line":"                                             host\u003dhost,"},{"line_number":2279,"context_line":"                                             port_id\u003dport_id)"},{"line_number":2280,"context_line":"        db.clear_binding_levels(context,"},{"line_number":2281,"context_line":"                                port_id\u003dport_id,"},{"line_number":2282,"context_line":"                                host\u003dhost)"},{"line_number":2283,"context_line":"        # TODO(adrianc): need to perform checks before"},{"line_number":2284,"context_line":"        #  deleting port binding levels ?"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_2265d71d","line":2284,"range":{"start_line":2277,"start_character":0,"end_line":2284,"end_character":41},"in_reply_to":"9fdfeff1_036f82fc","updated":"2019-02-22 20:04:18.000000000","message":"Agreed, and I also wonder if binding levels need to be cleared before deleting the port binding.","commit_id":"f8743897ee378b426b2e1fce808d47966c09b808"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"f37e73a01ea0fabfa8a1bf3a79698172ab874b9b","unresolved":false,"context_lines":[{"line_number":2274,"context_line":"    @utils.transaction_guard"},{"line_number":2275,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":2276,"context_line":"    def delete_port_binding(self, context, host, port_id):"},{"line_number":2277,"context_line":"        ports_obj.PortBinding.delete_objects(context,"},{"line_number":2278,"context_line":"                                             host\u003dhost,"},{"line_number":2279,"context_line":"                                             port_id\u003dport_id)"},{"line_number":2280,"context_line":"        db.clear_binding_levels(context,"},{"line_number":2281,"context_line":"                                port_id\u003dport_id,"},{"line_number":2282,"context_line":"                                host\u003dhost)"},{"line_number":2283,"context_line":"        # TODO(adrianc): need to perform checks before"},{"line_number":2284,"context_line":"        #  deleting port binding levels ?"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_471e4960","line":2284,"range":{"start_line":2277,"start_character":0,"end_line":2284,"end_character":41},"in_reply_to":"9fdfeff1_2265d71d","updated":"2019-03-03 10:20:13.000000000","message":"So, looking closer at the code,  i dont think its needed to call Ml2Plugin._clear_port_binding() as the additional attributes being updated in Ml2Plugin._clear_port_binding() are created and used by the calling methods. (e.g mech_context is being created in Ml2Plugin.update_port()[1] and is used to notify mechanism drivers, its life line ends once we exit update_port() method.)\n\nWe dont need to do that here as the only intention is to delete the PortBindingLevels from the database similarly to what is done with PortBinding.\n\nPlease tell me if i got things wrong here.\n\n[1] https://github.com/openstack/neutron/blob/9df57adf6006d11dae62fea753749a89cb6f11b5/neutron/plugins/ml2/plugin.py#L1454","commit_id":"f8743897ee378b426b2e1fce808d47966c09b808"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"5d133219e3e6dfdd8529e5725bcd7ee7221991aa","unresolved":false,"context_lines":[{"line_number":2274,"context_line":"    @utils.transaction_guard"},{"line_number":2275,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":2276,"context_line":"    def delete_port_binding(self, context, host, port_id):"},{"line_number":2277,"context_line":"        ports_obj.PortBinding.delete_objects(context,"},{"line_number":2278,"context_line":"                                             host\u003dhost,"},{"line_number":2279,"context_line":"                                             port_id\u003dport_id)"},{"line_number":2280,"context_line":"        db.clear_binding_levels(context,"},{"line_number":2281,"context_line":"                                port_id\u003dport_id,"},{"line_number":2282,"context_line":"                                host\u003dhost)"},{"line_number":2283,"context_line":"        # TODO(adrianc): need to perform checks before"},{"line_number":2284,"context_line":"        #  deleting port binding levels ?"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_87499167","line":2284,"range":{"start_line":2277,"start_character":0,"end_line":2284,"end_character":41},"in_reply_to":"9fdfeff1_471e4960","updated":"2019-03-03 10:28:22.000000000","message":"Also calling port_obj.PortBindingLevel.delete_objects() directly is pretty much equivalent here, save the check for a non empty host.","commit_id":"f8743897ee378b426b2e1fce808d47966c09b808"}]}
