)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":26832,"name":"Stefan Hoffmann","email":"stefan.hoffmann@cloudandheat.com","username":"shoffmann"},"change_message_id":"b4f2d88e0f08aaf88e34633a9294a4fa493bf265","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"3fc0fb31_4dacddc6","updated":"2024-07-01 12:40:00.000000000","message":"@ihrachys@redhat.com there was also the idea from our side to skip notifying nova here completely and use the events at */ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitoring.py\n\nI have two issues with that:\n1. I don\u0027t find, where currently the event is send to nova. With my current approach we delay the return of the API request made by nova to neutron. While I searched the place, the event got send, it feels like nova isn\u0027t waiting for an event but continues, as soon the API request returns.\n2. Not sure, if we have an Event at ovsdb_monitoring that we can use/already sends the event to nova (but later). I guess, there I would also need to build in a check, that ovn-controller completed the change.","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":26832,"name":"Stefan Hoffmann","email":"stefan.hoffmann@cloudandheat.com","username":"shoffmann"},"change_message_id":"0451dad31b98affbf8a3774b09c338795ba100a0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"331bac23_2e2e72f2","updated":"2024-06-25 15:32:06.000000000","message":"This patch may be not the best approach and lacks testing, but it\u0027s a first approach, based on we can discuss, how and where wait for southbound to have the port binding updated.","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":26832,"name":"Stefan Hoffmann","email":"stefan.hoffmann@cloudandheat.com","username":"shoffmann"},"change_message_id":"e6e6ccbfd7b736218b115a861bcd6bf4dbe4ab27","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"37f5b344_b0d1b712","updated":"2024-06-26 08:02:06.000000000","message":"recheck\n\nfunctional test\ncouldn\u0027t reproduce in my devstack","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"}],"neutron/conf/plugins/ml2/drivers/ovn/ovn_conf.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":96,"context_line":"                      \u0027connection keepalive feature. If non-zero the value \u0027"},{"line_number":97,"context_line":"                      \u0027will be forced to at least 1000 milliseconds. Defaults \u0027"},{"line_number":98,"context_line":"                      \u0027to 60 seconds.\u0027)),"},{"line_number":99,"context_line":"    cfg.IntOpt(\u0027northd_port_binding_sync_wait_time\u0027,"},{"line_number":100,"context_line":"               min\u003d0,"},{"line_number":101,"context_line":"               default\u003d60,"},{"line_number":102,"context_line":"               help\u003d_(\u0027The time in seconds neutron waits for southbound ovsdb \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"ea2abc7f_8b8895b7","line":99,"updated":"2024-06-26 20:41:17.000000000","message":"I think we should wait for ovn-controller to indicate that it configured the port (additional_chassis field), not that northd copied requested-chassis string from NB to SB (at which point the port is still not configured). If so, the name of the option would be different. (E.g. `port_binding_configured_timeout`.)","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":99,"context_line":"    cfg.IntOpt(\u0027northd_port_binding_sync_wait_time\u0027,"},{"line_number":100,"context_line":"               min\u003d0,"},{"line_number":101,"context_line":"               default\u003d60,"},{"line_number":102,"context_line":"               help\u003d_(\u0027The time in seconds neutron waits for southbound ovsdb \u0027"},{"line_number":103,"context_line":"                      \u0027to have the port binding update set and vif-plugged \u0027"},{"line_number":104,"context_line":"                      \u0027event is send to nova. This is used at live migrations \u0027"},{"line_number":105,"context_line":"                      \u0027where northd may need some time to sync the port \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"4ee755ad_33d604a9","line":102,"updated":"2024-06-26 20:41:17.000000000","message":"This is not exactly correct. The implementation waits for 1 seconds 60 times; plus does some work in between; plus other green threads may do their job. Maybe the implementation should wait up to pre-calculated deadline (in 1s-chunks) instead of 60x1s?","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":101,"context_line":"               default\u003d60,"},{"line_number":102,"context_line":"               help\u003d_(\u0027The time in seconds neutron waits for southbound ovsdb \u0027"},{"line_number":103,"context_line":"                      \u0027to have the port binding update set and vif-plugged \u0027"},{"line_number":104,"context_line":"                      \u0027event is send to nova. This is used at live migrations \u0027"},{"line_number":105,"context_line":"                      \u0027where northd may need some time to sync the port \u0027"},{"line_number":106,"context_line":"                      \u0027binding. If waiting to short, nova starts and finishes \u0027"},{"line_number":107,"context_line":"                      \u0027live migration before port setup is done at \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"85942550_46559929","line":104,"range":{"start_line":104,"start_character":59,"end_line":104,"end_character":77},"updated":"2024-06-26 20:41:17.000000000","message":"during live migration","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":101,"context_line":"               default\u003d60,"},{"line_number":102,"context_line":"               help\u003d_(\u0027The time in seconds neutron waits for southbound ovsdb \u0027"},{"line_number":103,"context_line":"                      \u0027to have the port binding update set and vif-plugged \u0027"},{"line_number":104,"context_line":"                      \u0027event is send to nova. This is used at live migrations \u0027"},{"line_number":105,"context_line":"                      \u0027where northd may need some time to sync the port \u0027"},{"line_number":106,"context_line":"                      \u0027binding. If waiting to short, nova starts and finishes \u0027"},{"line_number":107,"context_line":"                      \u0027live migration before port setup is done at \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"34572c3b_9a6fffed","line":104,"range":{"start_line":104,"start_character":32,"end_line":104,"end_character":36},"updated":"2024-06-26 20:41:17.000000000","message":"sent","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"}],"neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":881,"context_line":"            LOG.info(\"Setting port %s status from DOWN to UP in order \""},{"line_number":882,"context_line":"                     \"to emit vif-interface-plugged event.\","},{"line_number":883,"context_line":"                     port[\u0027id\u0027])"},{"line_number":884,"context_line":"            ports \u003d self.sb_ovn.get_network_port_bindings_by_ip("},{"line_number":885,"context_line":"                port[\u0027network_id\u0027],"},{"line_number":886,"context_line":"                port[\u0027fixed_ips\u0027][0][\u0027ip_address\u0027],"},{"line_number":887,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":1,"id":"0d603db5_14088b73","line":884,"updated":"2024-06-26 20:41:17.000000000","message":"please put this code into a separate function (`wait_for_port_binding_on_chassis`?)","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":885,"context_line":"                port[\u0027network_id\u0027],"},{"line_number":886,"context_line":"                port[\u0027fixed_ips\u0027][0][\u0027ip_address\u0027],"},{"line_number":887,"context_line":"            )"},{"line_number":888,"context_line":"            if len(ports) \u003d\u003d 1:"},{"line_number":889,"context_line":"                destination \u003d port[portbindings.PROFILE]["},{"line_number":890,"context_line":"                    ovn_const.MIGRATING_ATTR]"},{"line_number":891,"context_line":"                if destination !\u003d \"\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"82740522_55970563","line":888,"updated":"2024-06-26 20:41:17.000000000","message":"when is it not \u003d\u003d 1?","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":26832,"name":"Stefan Hoffmann","email":"stefan.hoffmann@cloudandheat.com","username":"shoffmann"},"change_message_id":"e3db3b94571289c954f3e4afa2fab66aa9a6ca3d","unresolved":true,"context_lines":[{"line_number":885,"context_line":"                port[\u0027network_id\u0027],"},{"line_number":886,"context_line":"                port[\u0027fixed_ips\u0027][0][\u0027ip_address\u0027],"},{"line_number":887,"context_line":"            )"},{"line_number":888,"context_line":"            if len(ports) \u003d\u003d 1:"},{"line_number":889,"context_line":"                destination \u003d port[portbindings.PROFILE]["},{"line_number":890,"context_line":"                    ovn_const.MIGRATING_ATTR]"},{"line_number":891,"context_line":"                if destination !\u003d \"\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"8a37a673_b895d6b9","line":888,"in_reply_to":"82740522_55970563","updated":"2024-07-02 10:00:09.000000000","message":"This happens at the second time we run into that function while a migration (the activate port call, send by destination compute-node.)\n\nFor reasons get_network_port_bindings_by_ip() don\u0027t returns any port in that case. I need to investigate why the function doesn\u0027t return a port.","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":889,"context_line":"                destination \u003d port[portbindings.PROFILE]["},{"line_number":890,"context_line":"                    ovn_const.MIGRATING_ATTR]"},{"line_number":891,"context_line":"                if destination !\u003d \"\":"},{"line_number":892,"context_line":"                    i \u003d 0"},{"line_number":893,"context_line":"                    while (i \u003c ovn_conf."},{"line_number":894,"context_line":"                            get_ovn_northd_port_binding_sync_wait_time()):"},{"line_number":895,"context_line":"                        requested_chassis \u003d ports[0].options.get("}],"source_content_type":"text/x-python","patch_set":1,"id":"7f02c906_541eb2cf","line":892,"updated":"2024-06-26 20:41:17.000000000","message":"```\nfor _ in range(get_ovn_northd_port_binding_sync_wait_time()):\n    ...\n    sleep(1)\n```","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":892,"context_line":"                    i \u003d 0"},{"line_number":893,"context_line":"                    while (i \u003c ovn_conf."},{"line_number":894,"context_line":"                            get_ovn_northd_port_binding_sync_wait_time()):"},{"line_number":895,"context_line":"                        requested_chassis \u003d ports[0].options.get("},{"line_number":896,"context_line":"                            ovn_const.LSP_OPTIONS_REQUESTED_CHASSIS_KEY,"},{"line_number":897,"context_line":"                            \u0027\u0027)"},{"line_number":898,"context_line":"                        if destination in requested_chassis:"}],"source_content_type":"text/x-python","patch_set":1,"id":"96f2f26c_5ec84a2e","line":895,"updated":"2024-06-26 20:41:17.000000000","message":"this is polling the IDL; I think it\u0027s better to wait for an IDL event (update to `additional_chassis` field in SB.)","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":26832,"name":"Stefan Hoffmann","email":"stefan.hoffmann@cloudandheat.com","username":"shoffmann"},"change_message_id":"b4f2d88e0f08aaf88e34633a9294a4fa493bf265","unresolved":true,"context_lines":[{"line_number":892,"context_line":"                    i \u003d 0"},{"line_number":893,"context_line":"                    while (i \u003c ovn_conf."},{"line_number":894,"context_line":"                            get_ovn_northd_port_binding_sync_wait_time()):"},{"line_number":895,"context_line":"                        requested_chassis \u003d ports[0].options.get("},{"line_number":896,"context_line":"                            ovn_const.LSP_OPTIONS_REQUESTED_CHASSIS_KEY,"},{"line_number":897,"context_line":"                            \u0027\u0027)"},{"line_number":898,"context_line":"                        if destination in requested_chassis:"}],"source_content_type":"text/x-python","patch_set":1,"id":"6aa9ceca_fa97fa35","line":895,"in_reply_to":"96f2f26c_5ec84a2e","updated":"2024-07-01 12:40:00.000000000","message":"Do you have an example, how to wait for an event?","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":893,"context_line":"                    while (i \u003c ovn_conf."},{"line_number":894,"context_line":"                            get_ovn_northd_port_binding_sync_wait_time()):"},{"line_number":895,"context_line":"                        requested_chassis \u003d ports[0].options.get("},{"line_number":896,"context_line":"                            ovn_const.LSP_OPTIONS_REQUESTED_CHASSIS_KEY,"},{"line_number":897,"context_line":"                            \u0027\u0027)"},{"line_number":898,"context_line":"                        if destination in requested_chassis:"},{"line_number":899,"context_line":"                            break"}],"source_content_type":"text/x-python","patch_set":1,"id":"a19d8642_587a2f29","line":896,"updated":"2024-06-26 20:41:17.000000000","message":"This is not an indication that the additional ovn-controller completed binding. (At least for multichassis port bindings code path). ovn-controller will update `PB.additional_chassis` db field to list its chassis, which *is* the sign that it completed configuration.\n\nSome background may be found here: https://ihar.dev/posts/ovn-chassis-binding-walkthru/#multichassis-port-bindings\n\nTo quote,\n\n```\nIf the current chassis is listed in additional_requested_chassis, then the port is claimed by the chassis, confirming this chassis as “additional”. Among other things, the Port_Binding.additional_chassis field is updated to include the current chassis. The additional hypervisor will not touch Port_Binding.up field.\n\n...\n\nAt this point, both chassis have the port wired and ready to serve traffic. Once the hypervisor completes Live Migration to the new chassis, OVN will - hopefully - be ready to immediately serve it there.\n```","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":895,"context_line":"                        requested_chassis \u003d ports[0].options.get("},{"line_number":896,"context_line":"                            ovn_const.LSP_OPTIONS_REQUESTED_CHASSIS_KEY,"},{"line_number":897,"context_line":"                            \u0027\u0027)"},{"line_number":898,"context_line":"                        if destination in requested_chassis:"},{"line_number":899,"context_line":"                            break"},{"line_number":900,"context_line":"                        LOG.debug(\"Waiting for port binding to have both \""},{"line_number":901,"context_line":"                                  \"chassis. new chassis: %s, current \""}],"source_content_type":"text/x-python","patch_set":1,"id":"55b56674_8c27cf27","line":898,"updated":"2024-06-26 20:41:17.000000000","message":"I think this check is racy: consider scenario where a port is being migrated HOST1 to HOST2 and then immediately switched to HOST3. If there\u0027s a short interval between first and second migration requests (lower than 1s), then there\u0027s a chance your check will not catch the moment when requested_chassis option in SB flipped to list HOST2.","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"7147d6fabce40292ef68c8dce859cd1013e6699c","unresolved":true,"context_lines":[{"line_number":897,"context_line":"                            \u0027\u0027)"},{"line_number":898,"context_line":"                        if destination in requested_chassis:"},{"line_number":899,"context_line":"                            break"},{"line_number":900,"context_line":"                        LOG.debug(\"Waiting for port binding to have both \""},{"line_number":901,"context_line":"                                  \"chassis. new chassis: %s, current \""},{"line_number":902,"context_line":"                                  \"requested-chassis: %s\","},{"line_number":903,"context_line":"                                  destination,"}],"source_content_type":"text/x-python","patch_set":1,"id":"de8bd868_5430a2f2","line":900,"updated":"2024-06-26 20:41:17.000000000","message":"strictly speaking, you do not check that both chassis are in the requested-chassis. You only check that the destination chassis is there.","commit_id":"1eb26e2f92758f8eaa745d1653239c9a3b8b5012"}]}
