)]}'
{"neutron/services/trunk/plugin.py":[{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d166178adf7ddb734742d09e2dcfaedf838a3c3b","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        subports \u003d [{\u0027segmentation_id\u0027: x.segmentation_id,"},{"line_number":46,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":47,"context_line":"                     \u0027port_id\u0027: x.port_id,"},{"line_number":48,"context_line":"                     \u0027mac_address\u0027: x.port.mac_address}"},{"line_number":49,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":50,"context_line":"        trunk_details \u003d {\u0027trunk_id\u0027: port_db.trunk_port.id,"},{"line_number":51,"context_line":"                         \u0027sub_ports\u0027: subports}"},{"line_number":52,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d trunk_details"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_d3ef2eaf","side":"PARENT","line":49,"range":{"start_line":48,"start_character":21,"end_line":49,"end_character":58},"updated":"2016-12-09 21:53:46.000000000","message":"Ick, it never crossed my mind this would be problematic. Should look a little more carefully at the models I suppose :)","commit_id":"406c6e6f39696a751b36cefd8c95b994feefea11"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9c58d322faf1fb10252ce4c723da00bb9e78fc3d","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        subports \u003d [{\u0027segmentation_id\u0027: x.segmentation_id,"},{"line_number":46,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":47,"context_line":"                     \u0027port_id\u0027: x.port_id,"},{"line_number":48,"context_line":"                     \u0027mac_address\u0027: x.port.mac_address}"},{"line_number":49,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":50,"context_line":"        trunk_details \u003d {\u0027trunk_id\u0027: port_db.trunk_port.id,"},{"line_number":51,"context_line":"                         \u0027sub_ports\u0027: subports}"},{"line_number":52,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d trunk_details"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_b900d335","side":"PARENT","line":49,"range":{"start_line":48,"start_character":21,"end_line":49,"end_character":58},"in_reply_to":"3a71b18c_d3ef2eaf","updated":"2016-12-09 22:47:26.000000000","message":"it\u0027s elegant and yet painful. I\u0027d like zzzeek input on this because this might subtly hidden in other places. It\u0027s interesting that \n\nneutron port-list\n\nwould execute this code and not cause any penalty and yet doing:\n\nneutron port-list --device-id foo\n\ncauses pain.","commit_id":"406c6e6f39696a751b36cefd8c95b994feefea11"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d166178adf7ddb734742d09e2dcfaedf838a3c3b","unresolved":false,"context_lines":[{"line_number":40,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":44,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":45,"context_line":"    if port_db.trunk_port:"},{"line_number":46,"context_line":"        subports \u003d {"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_53387eee","line":43,"range":{"start_line":43,"start_character":54,"end_line":43,"end_character":61},"updated":"2016-12-09 21:53:46.000000000","message":"We don\u0027t pass the OVO model here. This has me wanting go look into how this optimization would look with OVO. An exercise for the reviewer (me), no need to incorporate into this patch.","commit_id":"eedcbff095101bde6cc07f07e1375039ac7a0d38"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"b5eb77b666e7c6e79dcda5bae41891702a857694","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        subports \u003d [{\u0027segmentation_id\u0027: x.segmentation_id,"},{"line_number":46,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":47,"context_line":"                     \u0027port_id\u0027: x.port_id,"},{"line_number":48,"context_line":"                     \u0027mac_address\u0027: x.port.mac_address}"},{"line_number":49,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":50,"context_line":"        trunk_details \u003d {\u0027trunk_id\u0027: port_db.trunk_port.id,"},{"line_number":51,"context_line":"                         \u0027sub_ports\u0027: subports}"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a71b18c_85dabe49","side":"PARENT","line":48,"updated":"2016-12-11 01:13:20.000000000","message":"I figured out the issue here. This is a circular relationship. We are querying ports, which is joined to trunks, which is joined to sub_ports, which is then joined back to ports again.\n\nFor this to work, I believe we would need additional configuration of the relationship with a depth: http://docs.sqlalchemy.org/en/latest/orm/self_referential.html#configuring-self-referential-eager-loading\n\nHowever, this is making a standard ports query extremely complex (and it already is as it stands) so I think the proposed solution is a better approach anyway.\n\n\nSo you might ask yourself, \"Why did this only show up when filtering by device_id?\"\n\nWhen doing a full ports query, the wonder of the identity map was protecting us against additional DB queries to retrieve the subports\u0027 ports because they were already in the identity map from the full query!\n\nSo it\u0027s not just filtering by device_id that produced this behavior, it\u0027s any port query that wouldn\u0027t have included the subports\u0027 ports in the result. Even a port-show of a trunk\u0027s parent port would have emitted a query for each subport!","commit_id":"8976e42e30e21a03678c5ea7397ea0da1f30900e"}]}
