)]}'
{"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"058819110614de54df39c4da878f7b22db57bdfe","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            # resolving bug 1367391?"},{"line_number":345,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":346,"context_line":"                cur_binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":347,"context_line":"                    session, port_id, orig_binding.host)"},{"line_number":348,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":349,"context_line":"                self, plugin_context, port, network, cur_binding,"},{"line_number":350,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_cc7689d8","line":347,"updated":"2015-02-01 10:15:07.000000000","message":"Can you please help clarify how the above line will be hit ports that are DV R INTERFACES?\n\nSince dvr_interfaces bindings are still managed within this patch under the ml2_dvr_port_bindings table different from the main port-bindings table, the previous call in 336, get_locked_port_and_binding() would have retruend None, None thereby exiting this method early at L339 itself...","commit_id":"8d07e09dc5ce7bf462a1779b2d3e851771116d4f"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"41143c1db38a5a91e8bea93aa5b04ed743c04846","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            # resolving bug 1367391?"},{"line_number":345,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":346,"context_line":"                cur_binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":347,"context_line":"                    session, port_id, orig_binding.host)"},{"line_number":348,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":349,"context_line":"                self, plugin_context, port, network, cur_binding,"},{"line_number":350,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_2ba52653","line":347,"in_reply_to":"da86d52c_85037e0e","updated":"2015-02-02 17:07:07.000000000","message":"Done","commit_id":"8d07e09dc5ce7bf462a1779b2d3e851771116d4f"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"60dde9a7d5717e0cedf6b0e1cdf1013ac27066e1","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            # resolving bug 1367391?"},{"line_number":345,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":346,"context_line":"                cur_binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":347,"context_line":"                    session, port_id, orig_binding.host)"},{"line_number":348,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":349,"context_line":"                self, plugin_context, port, network, cur_binding,"},{"line_number":350,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_d9cf28af","line":347,"in_reply_to":"da86d52c_cc7689d8","updated":"2015-02-01 17:06:43.000000000","message":"Sure, Vivek.\n\nWhenever any port is created, whether non-DVR or DVR, the Ml2Plugin._create_port_db() function is called, and it calls db.add_port_binding(), which adds the normal ml2_port_bindings record in the DB. Therefore, db.get_locked_port_and_binding() is able to retrieve and return both records. As you\u0027ve noticed, this non-DVR PortBinding record is not used in this function in the DVR case.\n\nI had initially considered avoiding this unnecessary query by reorganizing this function so that it would not call db.get_locked_port_and_binding() in the DVR case, possibly using a new db.get_locked_port_and_dvr_binding() function instead. But in the second part of resolving bug 1367391, I plan to use the ml2_port_bindings table for both non-DVR and DVR ports, to store the vnic_type and profile of the port. A new ml2_port_binding_hosts table, with  port_id and host as PKs, will store the vif_type and vif_details of the port\u0027s binding on the host. Similarly, in https://review.openstack.org/#/c/116122/16/neutron/plugins/ml2/models.py, the segment and driver fields are moved to an ml2_port_binding_levels table that has port_id and host as PKs, along with level. Since this function will then need the records from all of these tables, it did not seem to make sense to bother optimizing the code now to avoid retrieving the ml2_port_bindings record.\n\nDoes the above clarify why the code currently works, and justify keeping the call to db.get_locked_port_and_binding() for now? If so, do you think explaining this in the REVISIT comment would be helpful?\n\n-Bob","commit_id":"8d07e09dc5ce7bf462a1779b2d3e851771116d4f"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"814466acd1ddd28f363807dfb6880316a299d79d","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            # resolving bug 1367391?"},{"line_number":345,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":346,"context_line":"                cur_binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":347,"context_line":"                    session, port_id, orig_binding.host)"},{"line_number":348,"context_line":"            cur_context \u003d driver_context.PortContext("},{"line_number":349,"context_line":"                self, plugin_context, port, network, cur_binding,"},{"line_number":350,"context_line":"                original_port\u003doport)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_85037e0e","line":347,"in_reply_to":"da86d52c_d9cf28af","updated":"2015-02-02 05:42:28.000000000","message":"This explanation helps clarify.  \n\nI agree with you that we need not optimize this right away and the optimization can be encompassed as part of your hierarchical port binding changes.\n\nCurrently,the entries in PortBinding table for DVR interfaces are never used.  They are dummies out there , but eventually these dummies will become  useful, because DVRPortBindings table will be removed and all its contents are brought into the main PortBinding table.\n\nI request that we add in a REVISIT comment to capture the behaviour here.","commit_id":"8d07e09dc5ce7bf462a1779b2d3e851771116d4f"}]}
