)]}'
{"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"cd19cf5fb8e677a0f523959eba36f45fdfd292c8","unresolved":true,"context_lines":[{"line_number":1419,"context_line":"            port_data[\u0027mac_address\u0027] \u003d p.get(\u0027mac_address\u0027)"},{"line_number":1420,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":1421,"context_line":"            # Ensure that the network exists."},{"line_number":1422,"context_line":"            if not self._network_exists(context, network_id):"},{"line_number":1423,"context_line":"                raise exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":1424,"context_line":""},{"line_number":1425,"context_line":"            # Create the port"}],"source_content_type":"text/x-python","patch_set":4,"id":"b9c27cde_6701a0f8","line":1422,"updated":"2021-03-05 19:05:10.000000000","message":"I\u0027m not a sql person, but I see other callers sometimes using the object classes, like:\n\nif not network_obj.Network.objects_exist(context, id\u003dnetwork_id):\n\nOccurrence just above this on L1312.\n\nFaster?","commit_id":"078cb3436fc228319e2d929bfdf81f35a6300020"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7e26ce4670b5a87a9010b8a3c8a9d17c6b6373b2","unresolved":true,"context_lines":[{"line_number":1419,"context_line":"            port_data[\u0027mac_address\u0027] \u003d p.get(\u0027mac_address\u0027)"},{"line_number":1420,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":1421,"context_line":"            # Ensure that the network exists."},{"line_number":1422,"context_line":"            if not self._network_exists(context, network_id):"},{"line_number":1423,"context_line":"                raise exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":1424,"context_line":""},{"line_number":1425,"context_line":"            # Create the port"}],"source_content_type":"text/x-python","patch_set":4,"id":"75f4707a_db300418","line":1422,"in_reply_to":"4421bdba_5c852245","updated":"2021-03-09 17:07:23.000000000","message":"Ack, thanks for looking Oleg.  So I guess this could also be used at L1312 then since it\u0027s doing the same thing?","commit_id":"078cb3436fc228319e2d929bfdf81f35a6300020"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"33fd443b6b6fb6b72d7196480b376c9562ae9b55","unresolved":true,"context_lines":[{"line_number":1419,"context_line":"            port_data[\u0027mac_address\u0027] \u003d p.get(\u0027mac_address\u0027)"},{"line_number":1420,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":1421,"context_line":"            # Ensure that the network exists."},{"line_number":1422,"context_line":"            if not self._network_exists(context, network_id):"},{"line_number":1423,"context_line":"                raise exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":1424,"context_line":""},{"line_number":1425,"context_line":"            # Create the port"}],"source_content_type":"text/x-python","patch_set":4,"id":"52f15ed9_7a2791b1","line":1422,"in_reply_to":"75f4707a_db300418","updated":"2021-03-10 07:06:50.000000000","message":"Indeed it can, thanks Brian","commit_id":"078cb3436fc228319e2d929bfdf81f35a6300020"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98d624911f90e331ddd2ca319acf96b1c03e8284","unresolved":true,"context_lines":[{"line_number":1419,"context_line":"            port_data[\u0027mac_address\u0027] \u003d p.get(\u0027mac_address\u0027)"},{"line_number":1420,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":1421,"context_line":"            # Ensure that the network exists."},{"line_number":1422,"context_line":"            if not self._network_exists(context, network_id):"},{"line_number":1423,"context_line":"                raise exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":1424,"context_line":""},{"line_number":1425,"context_line":"            # Create the port"}],"source_content_type":"text/x-python","patch_set":4,"id":"4421bdba_5c852245","line":1422,"in_reply_to":"83acdbe7_8211a915","updated":"2021-03-09 14:07:10.000000000","message":"I mean in fact DB query is not different from the current one (without the patch) so it\u0027s slower than this patch proposes","commit_id":"078cb3436fc228319e2d929bfdf81f35a6300020"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9a0d331a1aeddb8afdc7aeab848eb022c0280a21","unresolved":true,"context_lines":[{"line_number":1419,"context_line":"            port_data[\u0027mac_address\u0027] \u003d p.get(\u0027mac_address\u0027)"},{"line_number":1420,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":1421,"context_line":"            # Ensure that the network exists."},{"line_number":1422,"context_line":"            if not self._network_exists(context, network_id):"},{"line_number":1423,"context_line":"                raise exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":1424,"context_line":""},{"line_number":1425,"context_line":"            # Create the port"}],"source_content_type":"text/x-python","patch_set":4,"id":"83acdbe7_8211a915","line":1422,"in_reply_to":"b9c27cde_6701a0f8","updated":"2021-03-06 11:06:36.000000000","message":"From what I can see object_exists still does a full model query:\n https://github.com/openstack/neutron/blob/5187397da1976ba600f3d222e3714866083c58d7/neutron/objects/db/api.py#L26 and then in neutron lib https://github.com/openstack/neutron-lib/blob/698e4c8daa7d43018a71122ec5b0cd5b17b55141/neutron_lib/db/model_query.py#L265\n\nIn fact object_exists accepts any fields of the object to be able to filter, so it\u0027s not faster.","commit_id":"078cb3436fc228319e2d929bfdf81f35a6300020"}]}
