)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"a3eb6d7ddf8e26e7ea90c2d670d66bda587c74c6","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix update of trunk subports during live migration"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During the live migration trunk subports where updated only based"},{"line_number":10,"context_line":"on the \"host_id\" field. But when rpc message to update subports"},{"line_number":11,"context_line":"is send trunk\u0027s port is still bound to the old host and has"},{"line_number":12,"context_line":"\"migrating_to\" field in binding:profile set to the new host."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"b098f4f2_a6e38e1d","line":9,"range":{"start_line":9,"start_character":41,"end_line":9,"end_character":46},"updated":"2021-02-08 13:08:18.000000000","message":"nit: were","commit_id":"e05101c8ac953cc2823b35aaed3d499afc101988"}],"neutron/services/trunk/rpc/server.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ab9c4a4c60754bd300caf03fdea26256e01a44fa","unresolved":true,"context_lines":[{"line_number":127,"context_line":"        trunk_port_id \u003d trunk.port_id"},{"line_number":128,"context_line":"        trunk_port \u003d self.core_plugin.get_port(context, trunk_port_id)"},{"line_number":129,"context_line":"        trunk_host \u003d trunk_port.get(portbindings.HOST_ID)"},{"line_number":130,"context_line":"        migrating_to_host \u003d trunk_port.get("},{"line_number":131,"context_line":"            portbindings.PROFILE, {}).get(\u0027migrating_to\u0027)"},{"line_number":132,"context_line":"        if migrating_to_host and trunk_host !\u003d migrating_to_host:"},{"line_number":133,"context_line":"            # Trunk is migrating now, so lets update host of the subports"}],"source_content_type":"text/x-python","patch_set":1,"id":"4ad008f2_b321cdfb","line":130,"range":{"start_line":130,"start_character":8,"end_line":130,"end_character":25},"updated":"2021-02-10 16:35:24.000000000","message":"That will work because when the port is being migrated, the active binding is the ORIGIN host, that contains the \"migrating_to\" key in the profile.","commit_id":"e05101c8ac953cc2823b35aaed3d499afc101988"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"8c2d974b7a0a2bba509ca02726e5cf7dcafef270","unresolved":true,"context_lines":[{"line_number":128,"context_line":"        trunk_port \u003d self.core_plugin.get_port(context, trunk_port_id)"},{"line_number":129,"context_line":"        trunk_host \u003d trunk_port.get(portbindings.HOST_ID)"},{"line_number":130,"context_line":"        migrating_to_host \u003d trunk_port.get("},{"line_number":131,"context_line":"            portbindings.PROFILE, {}).get(\u0027migrating_to\u0027)"},{"line_number":132,"context_line":"        if migrating_to_host and trunk_host !\u003d migrating_to_host:"},{"line_number":133,"context_line":"            # Trunk is migrating now, so lets update host of the subports"},{"line_number":134,"context_line":"            # to the new host already"}],"source_content_type":"text/x-python","patch_set":1,"id":"285d7b24_9cf42922","line":131,"updated":"2021-02-08 15:08:17.000000000","message":"With multiple port binding feature, once the migration is done, the port portbinding should point to the destination host. This is when the portbinding is changed. When \"migrating_to\" key is still in the portbinding dictionary, the port is still being migrated and we can\u0027t set the binding to the dest host yet.\n\nWhat I think is happening is a race condition as in [1]:\n- Ports are created in destination host.\n- Ports portbinding is updated, now only destination host is defined.\n- Ports are set as ACTIVE from the destination host agent.\n- Ports are set as DOWN (because are deleted) from the origin host.\n\nCan you test [1] in your environment?\n\n[1]https://review.opendev.org/c/openstack/neutron/+/766277","commit_id":"e05101c8ac953cc2823b35aaed3d499afc101988"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ab9c4a4c60754bd300caf03fdea26256e01a44fa","unresolved":true,"context_lines":[{"line_number":128,"context_line":"        trunk_port \u003d self.core_plugin.get_port(context, trunk_port_id)"},{"line_number":129,"context_line":"        trunk_host \u003d trunk_port.get(portbindings.HOST_ID)"},{"line_number":130,"context_line":"        migrating_to_host \u003d trunk_port.get("},{"line_number":131,"context_line":"            portbindings.PROFILE, {}).get(\u0027migrating_to\u0027)"},{"line_number":132,"context_line":"        if migrating_to_host and trunk_host !\u003d migrating_to_host:"},{"line_number":133,"context_line":"            # Trunk is migrating now, so lets update host of the subports"},{"line_number":134,"context_line":"            # to the new host already"}],"source_content_type":"text/x-python","patch_set":1,"id":"6d550bff_e0256869","line":131,"in_reply_to":"06db5913_c24cd3e1","updated":"2021-02-10 16:35:24.000000000","message":"We had a meeting to discuss this patch. There are two issues (interrelated):\n\n1) Set the correct subport bindings.\nWhen the trunk is created in the destination host, the subports are updated (following the code described in Slawek\u0027s comment). This is the only place that happens and this is why we need to set the correct host (the destination host). That\n\n2) When the trunk port is migrated, set the subports status to ACTIVE.\nThis is fixed with this code. If the subport binding information is correct (destination host), when the OVS agent updates the port information, the ACTIVE status will be set from the destination host. The DOWN status from the source host will be skipped.","commit_id":"e05101c8ac953cc2823b35aaed3d499afc101988"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"014bad38fc19cc805593b793a019a009214d6c71","unresolved":true,"context_lines":[{"line_number":128,"context_line":"        trunk_port \u003d self.core_plugin.get_port(context, trunk_port_id)"},{"line_number":129,"context_line":"        trunk_host \u003d trunk_port.get(portbindings.HOST_ID)"},{"line_number":130,"context_line":"        migrating_to_host \u003d trunk_port.get("},{"line_number":131,"context_line":"            portbindings.PROFILE, {}).get(\u0027migrating_to\u0027)"},{"line_number":132,"context_line":"        if migrating_to_host and trunk_host !\u003d migrating_to_host:"},{"line_number":133,"context_line":"            # Trunk is migrating now, so lets update host of the subports"},{"line_number":134,"context_line":"            # to the new host already"}],"source_content_type":"text/x-python","patch_set":1,"id":"06db5913_c24cd3e1","line":131,"in_reply_to":"285d7b24_9cf42922","updated":"2021-02-09 13:34:34.000000000","message":"I have this patch in my env but the issue with subports is a bit different.\nIt is race between Nova-compute and neutron-ovs-agent:\n1. nova-compute on destination host creates trunk bridge as part of the L1 wiring,\n2. this bridge is then wired by trunk driver: https://github.com/openstack/neutron/blob/ab8a17c6a4902bb94c95f3e763eab0481e1e0c43/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py#L152 and as part of that handle_trunk_add method it will call wire_subports_for_trunk(): https://github.com/openstack/neutron/blob/ab8a17c6a4902bb94c95f3e763eab0481e1e0c43/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py#L416\n3. This method will call server through rpc and on the server side it will call https://github.com/openstack/neutron/blob/ab8a17c6a4902bb94c95f3e763eab0481e1e0c43/neutron/services/trunk/rpc/server.py#L83 - this method will then get trunk\u0027s port, see https://github.com/openstack/neutron/blob/ab8a17c6a4902bb94c95f3e763eab0481e1e0c43/neutron/services/trunk/rpc/server.py#L128 and based on the binding_host of that port it will update subports.\n\nThe problem is that trunk\u0027s port can still not be updated by nova that migration is finished really. And then we ends up in that issue described in the bug here.\nIn fact, when I put simple sleep(20) in the L127 here migration worked fine for me and subports were updated properly.\n\nNow the reason why I want to use such \"hack\" with this migration_to host is simple. It will be easy to backport fix to the stable branches also.\nOtherwise we would probably need to update rpc messages format to be able to send back to agent list of \"failed\" subports and agent would need to try to wire such trunk again in such case. Currently there is no such possibility there.","commit_id":"e05101c8ac953cc2823b35aaed3d499afc101988"}]}
