)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"0ed1bc3b3e126f28a89c68783a6ddfae42713bdd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"04289581_b1c0802b","updated":"2023-10-23 15:52:22.000000000","message":"I\u0027m not sure this 100% fixes the issue. I believe there can be segmenthostmappings for hosts that are not OVN and does not have any agent?","commit_id":"3ca7e3093f277475a8982dca4389d906477a74bf"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c3c1a347fc83e309345c47ddb980d88327170464","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"70bf713b_1ea6108a","updated":"2023-10-23 19:06:54.000000000","message":"-1 to have discussion","commit_id":"8e3821e6f58a78a225db03ec146c35450978c404"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f23293f467009160757728728726d6599c73dc75","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"fdadf3a0_8fe7818e","updated":"2023-10-24 12:40:50.000000000","message":"Failures in the functional tests are related:\n\nhttps://0b597ddfdb96120d63ef-c12fcc42ad5d5aae8f50cd1a8b1d9931.ssl.cf2.rackcdn.com/899077/5/check/neutron-functional-with-uwsgi/924218b/testr_results.html","commit_id":"7b708f07a346ca8c932ff2d761b69d7f51bfc833"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4f8386d12c3413e43312276e483e1e3958a9dce6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"e40571a6_a82275c5","updated":"2023-10-24 12:25:28.000000000","message":"Thanks, the new version with the filter is so much cleaner!","commit_id":"7b708f07a346ca8c932ff2d761b69d7f51bfc833"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"9758968392895875013e33fcce63b07d2a0b1d74","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"e8e4d402_8dbb30f2","in_reply_to":"fdadf3a0_8fe7818e","updated":"2023-10-24 17:24:49.000000000","message":"ok, updated the functional test. With this change we need agents to be present.\n\nI also added a couple of testcases to make it clear that a host can exist in neutron but no chassis in sb DB. The host will not be deleted/cleaned unless there is also an agent of type \u0027OVN Controller agent\u0027 present.","commit_id":"7b708f07a346ca8c932ff2d761b69d7f51bfc833"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"23306f8458ac8f0f187141bbe462b63d9948280b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"5980bb96_8520b38d","updated":"2023-11-21 09:06:23.000000000","message":"recheck  TIMED_OUT","commit_id":"3aafeefc8553fd637bad238ee236b1767d8548ea"}],"neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c3c1a347fc83e309345c47ddb980d88327170464","unresolved":true,"context_lines":[{"line_number":1365,"context_line":"            agent_objs \u003d agent_obj.Agent.get_objects(ctx, fields\u003dfields)"},{"line_number":1366,"context_line":"            non_ovn_hosts \u003d {"},{"line_number":1367,"context_line":"                obj.host for obj in agent_objs"},{"line_number":1368,"context_line":"                if obj.agent_type !\u003d ovn_const.OVN_CONTROLLER_AGENT}"},{"line_number":1369,"context_line":"            stale_hosts \u003d stale_hosts - non_ovn_hosts"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":2,"id":"09672c59_5b602050","line":1368,"updated":"2023-10-23 19:06:54.000000000","message":"So after sitting through a PTG meeting on neutron DB performance issues, I\u0027m not sure getting all the agent objects and filtering here is the right thing to do since we don\u0027t know how many agent objects will be returned.\n\nI think you could make code similar to get_availability_zones_by_agent_type() (and it\u0027s callee) that would do this, would just have to change things slightly like:\n\n  ovn_hosts \u003d get_hosts_by_agent_type(ovn_const.OVN_CONTROLLER_AGENT)\n  stale_hosts \u003d stale_hosts \u0026 ovn_hosts\n\nDoes that sound like it would work?","commit_id":"8e3821e6f58a78a225db03ec146c35450978c404"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"3856bc65d59c1aed9eb84d4f6e8ab8ede838a561","unresolved":true,"context_lines":[{"line_number":1365,"context_line":"            agent_objs \u003d agent_obj.Agent.get_objects(ctx, fields\u003dfields)"},{"line_number":1366,"context_line":"            non_ovn_hosts \u003d {"},{"line_number":1367,"context_line":"                obj.host for obj in agent_objs"},{"line_number":1368,"context_line":"                if obj.agent_type !\u003d ovn_const.OVN_CONTROLLER_AGENT}"},{"line_number":1369,"context_line":"            stale_hosts \u003d stale_hosts - non_ovn_hosts"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5d24b135_dbb4ca5d","line":1368,"in_reply_to":"09672c59_5b602050","updated":"2023-10-23 20:06:22.000000000","message":"Right, the thought on performance did strike me while writing the code - but I figured it would not be a major issue since this run\u0027s only on startup.\n\nAnother idea would be to extend get_hosts_mapped_with_segments to support an ``agent_type`` flag, if we can do a joined query we may be able to let the database do the job?\n\nIt\u0027s late, so I\u0027ll leave it as is and give Rodolfo a chance to comment as well.","commit_id":"8e3821e6f58a78a225db03ec146c35450978c404"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"2e99d264312f197074ca9e73582b41d69328ea8a","unresolved":true,"context_lines":[{"line_number":1365,"context_line":"            agent_objs \u003d agent_obj.Agent.get_objects(ctx, fields\u003dfields)"},{"line_number":1366,"context_line":"            non_ovn_hosts \u003d {"},{"line_number":1367,"context_line":"                obj.host for obj in agent_objs"},{"line_number":1368,"context_line":"                if obj.agent_type !\u003d ovn_const.OVN_CONTROLLER_AGENT}"},{"line_number":1369,"context_line":"            stale_hosts \u003d stale_hosts - non_ovn_hosts"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":2,"id":"d8596aba_78f44b67","line":1368,"in_reply_to":"5d24b135_dbb4ca5d","updated":"2023-10-24 08:02:20.000000000","message":"I proposed a patch[1] adding include/exclude hosts based on agent_type in the get_hosts_mapped_with_segments method. With that we might simply do:\n\n```\nprevious_hosts \u003d segments_db.get_hosts_mapped_with_segments(\n                     ctx, include_agent_types\u003d{ovn_const.OVN_CONTROLLER_AGENT})\n```\n\n\n[1] https://review.opendev.org/c/openstack/neutron/+/899130","commit_id":"8e3821e6f58a78a225db03ec146c35450978c404"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"3d6cce0d72597532d1553d771cd728a8c2a6dd71","unresolved":true,"context_lines":[{"line_number":1365,"context_line":"            agent_objs \u003d agent_obj.Agent.get_objects(ctx, fields\u003dfields)"},{"line_number":1366,"context_line":"            non_ovn_hosts \u003d {"},{"line_number":1367,"context_line":"                obj.host for obj in agent_objs"},{"line_number":1368,"context_line":"                if obj.agent_type !\u003d ovn_const.OVN_CONTROLLER_AGENT}"},{"line_number":1369,"context_line":"            stale_hosts \u003d stale_hosts - non_ovn_hosts"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":2,"id":"10f2fe2f_4e97b4e3","line":1368,"in_reply_to":"acebff11_2e0b6994","updated":"2023-10-24 10:32:47.000000000","message":"Patch rebased and now uses the filtering in get_hosts_mapped_with_segments.","commit_id":"8e3821e6f58a78a225db03ec146c35450978c404"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"73bea19a70fbbd623cf1742aae2c4e7918f613a3","unresolved":true,"context_lines":[{"line_number":1365,"context_line":"            agent_objs \u003d agent_obj.Agent.get_objects(ctx, fields\u003dfields)"},{"line_number":1366,"context_line":"            non_ovn_hosts \u003d {"},{"line_number":1367,"context_line":"                obj.host for obj in agent_objs"},{"line_number":1368,"context_line":"                if obj.agent_type !\u003d ovn_const.OVN_CONTROLLER_AGENT}"},{"line_number":1369,"context_line":"            stale_hosts \u003d stale_hosts - non_ovn_hosts"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":2,"id":"acebff11_2e0b6994","line":1368,"in_reply_to":"d8596aba_78f44b67","updated":"2023-10-24 09:41:12.000000000","message":"Thanks Harald!\n\nI quite like the idea of being able to filter these segments as proposed on your patch there. I left a few comments on it but I think it would worth to rebase this patch on top of [1] and using it here.\n\n[1] https://review.opendev.org/c/openstack/neutron/+/899130","commit_id":"8e3821e6f58a78a225db03ec146c35450978c404"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"11e4b59aec1329701c5d951f9362388d50d96e71","unresolved":true,"context_lines":[{"line_number":1354,"context_line":"        host_phynets_map \u003d self.ovn_api.get_chassis_hostname_and_physnets()"},{"line_number":1355,"context_line":"        current_hosts \u003d set(host_phynets_map)"},{"line_number":1356,"context_line":"        previous_hosts \u003d segments_db.get_hosts_mapped_with_segments("},{"line_number":1357,"context_line":"            ctx, include_agent_types\u003d{ovn_const.OVN_CONTROLLER_AGENT})"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"        stale_hosts \u003d previous_hosts - current_hosts"},{"line_number":1360,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":9,"id":"2a3a546d_5356ae54","line":1357,"updated":"2023-11-05 21:29:03.000000000","message":"Should this be in [] ? the other change says it expects a list","commit_id":"71d69cf6277ba553354512209a2bff61c013f8ea"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"f1ff9829e2a30af8ba6ec51cacfa921826d35c16","unresolved":true,"context_lines":[{"line_number":1354,"context_line":"        host_phynets_map \u003d self.ovn_api.get_chassis_hostname_and_physnets()"},{"line_number":1355,"context_line":"        current_hosts \u003d set(host_phynets_map)"},{"line_number":1356,"context_line":"        previous_hosts \u003d segments_db.get_hosts_mapped_with_segments("},{"line_number":1357,"context_line":"            ctx, include_agent_types\u003d{ovn_const.OVN_CONTROLLER_AGENT})"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"        stale_hosts \u003d previous_hosts - current_hosts"},{"line_number":1360,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ef785b5_2cc75f3e","line":1357,"in_reply_to":"2a3a546d_5356ae54","updated":"2023-11-06 12:58:48.000000000","message":"It should be a set, I tried to indicate that in the doc string with ``(set)`` to indicate the type. I can see how the following doc text is confusing.\nShould we update the this change and change the docstring to \"Set of agent types\" instead?\n\n```\n    :param include_agent_types: (set) List of agent types, include hosts\n        with matching agents.\n    :param exclude_agent_types: (set) List of agent types, exclude hosts\n        with matching agents.\n```","commit_id":"71d69cf6277ba553354512209a2bff61c013f8ea"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"da0f799c6940999aedac5c42a1895b48848c49b6","unresolved":true,"context_lines":[{"line_number":1354,"context_line":"        host_phynets_map \u003d self.ovn_api.get_chassis_hostname_and_physnets()"},{"line_number":1355,"context_line":"        current_hosts \u003d set(host_phynets_map)"},{"line_number":1356,"context_line":"        previous_hosts \u003d segments_db.get_hosts_mapped_with_segments("},{"line_number":1357,"context_line":"            ctx, include_agent_types\u003d{ovn_const.OVN_CONTROLLER_AGENT})"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"        stale_hosts \u003d previous_hosts - current_hosts"},{"line_number":1360,"context_line":"        for host in stale_hosts:"}],"source_content_type":"text/x-python","patch_set":9,"id":"14a9b24e_54caf3e2","line":1357,"in_reply_to":"9ef785b5_2cc75f3e","updated":"2023-11-20 18:08:39.000000000","message":"No, I think it makes sense after looking at it again.","commit_id":"71d69cf6277ba553354512209a2bff61c013f8ea"}],"releasenotes/notes/ovn-db-sync-host-physnet-filter-agent-type-9e22942bed304807.yaml":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"da0f799c6940999aedac5c42a1895b48848c49b6","unresolved":true,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    When synchronizing the OVN databases, either when running the migration"},{"line_number":5,"context_line":"    command or during startup, the code responsible for syncronizaiton will"},{"line_number":6,"context_line":"    only clean up segment-to-host mappings for hosts with agent_type"},{"line_number":7,"context_line":"    ``OVN Controller agent``. Before, the synchronization would clean up"},{"line_number":8,"context_line":"    (delete) segment-to-host mappings for non-OVN hosts. Fixes bug:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"3c765151_2d2d4d77","line":5,"range":{"start_line":5,"start_character":56,"end_line":5,"end_character":70},"updated":"2023-11-20 18:08:39.000000000","message":"s/synchronization","commit_id":"71d69cf6277ba553354512209a2bff61c013f8ea"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"302bd507e23e4edd87ab25fc59e162831d47786f","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    When synchronizing the OVN databases, either when running the migration"},{"line_number":5,"context_line":"    command or during startup, the code responsible for syncronizaiton will"},{"line_number":6,"context_line":"    only clean up segment-to-host mappings for hosts with agent_type"},{"line_number":7,"context_line":"    ``OVN Controller agent``. Before, the synchronization would clean up"},{"line_number":8,"context_line":"    (delete) segment-to-host mappings for non-OVN hosts. Fixes bug:"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"1ded6a40_43a8d344","line":5,"range":{"start_line":5,"start_character":56,"end_line":5,"end_character":70},"in_reply_to":"3c765151_2d2d4d77","updated":"2023-11-20 20:17:11.000000000","message":"Done","commit_id":"71d69cf6277ba553354512209a2bff61c013f8ea"}]}
