)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"b73d88ea83d4ff120cc157ea1700ce1b55dd2dd4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"1f03e018_93b5fbb5","updated":"2021-12-03 11:47:36.000000000","message":"recheck","commit_id":"176503e610aee16cb5799a77466579bc55129450"}],"neutron/services/segments/db.py":[{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"e857320569a12e6229f4123b1e6394a5949dcfab","unresolved":true,"context_lines":[{"line_number":41,"context_line":"_USER_CONFIGURED_SEGMENT_PLUGIN \u003d None"},{"line_number":42,"context_line":"FOR_NET_DELETE \u003d \u0027for_net_delete\u0027"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def check_user_configured_segment_plugin():"}],"source_content_type":"text/x-python","patch_set":1,"id":"b2ce005c_5d445255","line":44,"range":{"start_line":44,"start_character":0,"end_line":44,"end_character":33},"updated":"2021-11-30 13:15:40.000000000","message":"not used","commit_id":"ac73aa31b1324665e35834c27c5fc92005d42a77"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"fcad40db992c6c263c8023c6ffc69ff72b91257d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"_USER_CONFIGURED_SEGMENT_PLUGIN \u003d None"},{"line_number":42,"context_line":"FOR_NET_DELETE \u003d \u0027for_net_delete\u0027"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def check_user_configured_segment_plugin():"}],"source_content_type":"text/x-python","patch_set":1,"id":"36e9eb85_37c39fe6","line":44,"range":{"start_line":44,"start_character":0,"end_line":44,"end_character":33},"in_reply_to":"b2ce005c_5d445255","updated":"2021-12-02 14:06:45.000000000","message":"Done","commit_id":"ac73aa31b1324665e35834c27c5fc92005d42a77"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"3bbedfa2e8a14a7fef11ec58a838f607209e31ac","unresolved":true,"context_lines":[{"line_number":306,"context_line":"    start_flag \u003d agent.get(\u0027start_flag\u0027, None)"},{"line_number":307,"context_line":"    if host in reported_hosts and not start_flag:"},{"line_number":308,"context_line":"        return"},{"line_number":309,"context_line":"    reported_hosts.add(host)"},{"line_number":310,"context_line":"    agent_db \u003d directory.get_plugin()._get_agent_by_type_and_host("},{"line_number":311,"context_line":"        context, agent[\u0027agent_type\u0027], agent[\u0027host\u0027])"},{"line_number":312,"context_line":"    if agent.get(\u0027configurations\u0027) \u003d\u003d agent_db[\u0027configurations\u0027]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"cf0486f6_bc0a1ee5","line":309,"range":{"start_line":309,"start_character":4,"end_line":309,"end_character":18},"updated":"2021-11-30 09:48:26.000000000","message":"Related question: \"reported_hosts\" is a local variable to remember the reported hosts that have been handled by this specific worker. I\u0027m wondering if this is safe enough in case the segment is updated (changed) for this host.","commit_id":"ac73aa31b1324665e35834c27c5fc92005d42a77"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"fcad40db992c6c263c8023c6ffc69ff72b91257d","unresolved":true,"context_lines":[{"line_number":306,"context_line":"    start_flag \u003d agent.get(\u0027start_flag\u0027, None)"},{"line_number":307,"context_line":"    if host in reported_hosts and not start_flag:"},{"line_number":308,"context_line":"        return"},{"line_number":309,"context_line":"    reported_hosts.add(host)"},{"line_number":310,"context_line":"    agent_db \u003d directory.get_plugin()._get_agent_by_type_and_host("},{"line_number":311,"context_line":"        context, agent[\u0027agent_type\u0027], agent[\u0027host\u0027])"},{"line_number":312,"context_line":"    if agent.get(\u0027configurations\u0027) \u003d\u003d agent_db[\u0027configurations\u0027]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"f0ad1694_4764596b","line":309,"range":{"start_line":309,"start_character":4,"end_line":309,"end_character":18},"in_reply_to":"cf0486f6_bc0a1ee5","updated":"2021-12-02 14:06:45.000000000","message":"Good question. I found that in ml2 we do not allow the update of the segment\u0027s physnet:\n\nhttps://opendev.org/openstack/neutron/src/commit/bd8e78401c8487a1c4b906f260ca4a5f07accad6/neutron/plugins/ml2/plugin.py#L922-L937\n\nI believe segment deletions are already handled.\n\nDo we have any other update that could be relevant here?","commit_id":"ac73aa31b1324665e35834c27c5fc92005d42a77"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"fcad40db992c6c263c8023c6ffc69ff72b91257d","unresolved":false,"context_lines":[{"line_number":307,"context_line":"    if host in reported_hosts and not start_flag:"},{"line_number":308,"context_line":"        return"},{"line_number":309,"context_line":"    reported_hosts.add(host)"},{"line_number":310,"context_line":"    agent_db \u003d directory.get_plugin()._get_agent_by_type_and_host("},{"line_number":311,"context_line":"        context, agent[\u0027agent_type\u0027], agent[\u0027host\u0027])"},{"line_number":312,"context_line":"    if agent.get(\u0027configurations\u0027) \u003d\u003d agent_db[\u0027configurations\u0027]:"},{"line_number":313,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":1,"id":"b60e537c_9d2d4be0","line":310,"range":{"start_line":310,"start_character":38,"end_line":310,"end_character":65},"updated":"2021-12-02 14:06:45.000000000","message":"I realized that we need to get the previous state of the agent differently. As you can see in line 370 we are called in the AFTER_CREATE event. That means we cannot compare the agent\u0027s previous and current config by taking the previous from the db, because we already committed the current state to the db a moment ago. However we can pass the previous agent state in the event payload...","commit_id":"ac73aa31b1324665e35834c27c5fc92005d42a77"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"e857320569a12e6229f4123b1e6394a5949dcfab","unresolved":true,"context_lines":[{"line_number":315,"context_line":"    current_segment_ids \u003d {"},{"line_number":316,"context_line":"        segment[\u0027id\u0027] for segment in segments"},{"line_number":317,"context_line":"        if check_segment_for_agent(segment, agent)}"},{"line_number":318,"context_line":"    update_segment_host_mapping(context, host, current_segment_ids)"},{"line_number":319,"context_line":"    registry.publish(resources.SEGMENT_HOST_MAPPING, events.AFTER_CREATE,"},{"line_number":320,"context_line":"                     plugin, payload\u003devents.DBEventPayload("},{"line_number":321,"context_line":"                         context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7295b686_1d765a99","line":318,"range":{"start_line":318,"start_character":4,"end_line":318,"end_character":67},"updated":"2021-11-30 13:15:40.000000000","message":"by the unit tests it seems that needs to be called even if we already have the same agent config stored","commit_id":"ac73aa31b1324665e35834c27c5fc92005d42a77"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"fcad40db992c6c263c8023c6ffc69ff72b91257d","unresolved":false,"context_lines":[{"line_number":315,"context_line":"    current_segment_ids \u003d {"},{"line_number":316,"context_line":"        segment[\u0027id\u0027] for segment in segments"},{"line_number":317,"context_line":"        if check_segment_for_agent(segment, agent)}"},{"line_number":318,"context_line":"    update_segment_host_mapping(context, host, current_segment_ids)"},{"line_number":319,"context_line":"    registry.publish(resources.SEGMENT_HOST_MAPPING, events.AFTER_CREATE,"},{"line_number":320,"context_line":"                     plugin, payload\u003devents.DBEventPayload("},{"line_number":321,"context_line":"                         context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"0f22f1f1_70bc71bc","line":318,"range":{"start_line":318,"start_character":4,"end_line":318,"end_character":67},"in_reply_to":"7295b686_1d765a99","updated":"2021-12-02 14:06:45.000000000","message":"All unit tests should pass now.","commit_id":"ac73aa31b1324665e35834c27c5fc92005d42a77"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6d94bda4f2758ec2da2ca590a69f41a41e242eaf","unresolved":true,"context_lines":[{"line_number":308,"context_line":"            payload.states[1] is not None and"},{"line_number":309,"context_line":"            agent.get(\u0027configurations\u0027) \u003d\u003d payload.states[1].get("},{"line_number":310,"context_line":"                \u0027configurations\u0027)):"},{"line_number":311,"context_line":"        return"},{"line_number":312,"context_line":"    segments \u003d get_segments_with_phys_nets(context, phys_nets)"},{"line_number":313,"context_line":"    current_segment_ids \u003d {"},{"line_number":314,"context_line":"        segment[\u0027id\u0027] for segment in segments"}],"source_content_type":"text/x-python","patch_set":2,"id":"7480f4f1_27254161","line":311,"updated":"2022-07-21 10:30:19.000000000","message":"That is my current understanding and behavior i\u0027m suffering. For a given environment using network provider. Switching to routed provider network that by setting to a given subnet on a network with physnet a segment will not work anymore as the process is now blocked on a comparison between configuration file change of the agent.\n\nto reproduce, you can deploy a devstack using network provider. Then you want to assign segment to subnet using `openstack subnet set --network-segment {segid} {subnet}`\n\nYou are expecting that the process to go into line 312.","commit_id":"176503e610aee16cb5799a77466579bc55129450"}],"neutron/tests/unit/extensions/test_segment.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"39cb49b2f4f4bde5b189e8bbefd3a19a53302ba2","unresolved":true,"context_lines":[{"line_number":967,"context_line":"        self.assertIn(host, db.reported_hosts)"},{"line_number":968,"context_line":"        self.assertEqual(1, mock_function.call_count)"},{"line_number":969,"context_line":"        expected_call \u003d mock.call(mock.ANY, host, set())"},{"line_number":970,"context_line":"        mock_function.assert_has_calls([expected_call])"},{"line_number":971,"context_line":""},{"line_number":972,"context_line":"    @mock.patch(mock_path)"},{"line_number":973,"context_line":"    def test_no_starting_agent_is_not_processed(self, mock_function):"}],"source_content_type":"text/x-python","patch_set":2,"id":"41580de1_76d32dab","line":970,"range":{"start_line":970,"start_character":22,"end_line":970,"end_character":38},"updated":"2021-12-08 07:51:13.000000000","message":"nit: assert_called_once_with(mock.ANY, host, set())","commit_id":"176503e610aee16cb5799a77466579bc55129450"}]}
