)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"e71f2d5b6ad9bee39c23e68d7b9ada283ca48105","unresolved":false,"context_lines":[{"line_number":10,"context_line":"assign same IP to multiple different requests."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Idbb04d3ce6eacd308b05536f1942a35a0792199e"},{"line_number":13,"context_line":"Fixes: bug #1110807"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAM3%2F%2FFOY%3D","line":13,"updated":"2013-02-07 18:51:02.000000000","message":"nit: This line should be in L11","commit_id":"3e5dc67fb085653ca9174596ea0049317fa72e92"}],"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":458,"context_line":"        range_qry \u003d context.session.query("},{"line_number":459,"context_line":"            models_v2.IPAvailabilityRange,"},{"line_number":460,"context_line":"            models_v2.IPAllocationPool).join("},{"line_number":461,"context_line":"                models_v2.IPAllocationPool)"},{"line_number":462,"context_line":"        results \u003d range_qry.filter_by(subnet_id\u003dsubnet_id).all()"},{"line_number":463,"context_line":"        for (range, pool) in results:"},{"line_number":464,"context_line":"            first \u003d int(netaddr.IPAddress(range[\u0027first_ip\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B8hM%3D","line":461,"updated":"2013-02-13 17:44:33.000000000","message":"I\u0027m not clear on the exact usage of with_lockmode(), but is this branch of the code properly covered?  Does with_lockmode(\u0027update\u0027) prevent any updates other than those on the current context until the associated query object goes out of scope?","commit_id":"f22b497529d30ee803189a99510d1ab6a96545ad"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":458,"context_line":"        range_qry \u003d context.session.query("},{"line_number":459,"context_line":"            models_v2.IPAvailabilityRange,"},{"line_number":460,"context_line":"            models_v2.IPAllocationPool).join("},{"line_number":461,"context_line":"                models_v2.IPAllocationPool)"},{"line_number":462,"context_line":"        results \u003d range_qry.filter_by(subnet_id\u003dsubnet_id).all()"},{"line_number":463,"context_line":"        for (range, pool) in results:"},{"line_number":464,"context_line":"            first \u003d int(netaddr.IPAddress(range[\u0027first_ip\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2BwVI%3D","line":461,"in_reply_to":"AAAAM3%2F%2B7K4%3D","updated":"2013-02-19 22:11:26.000000000","message":"Hi Ante,\n\nYes, I understand all of that.  While I\u0027m specifically wondering is if the _allocate_specific_ip() method also needs locking for the same reason.  Basically, we are shifting an IP from being unallocated to allocated without a lock.  It seems like this could overalp with another call to allocate_specific_ip for the same address.  Less likely that the case we already fixed for sure, but if we\u0027re already thinking about how to lock ip allocations, I just want to make sure we\u0027re being complete.","commit_id":"f22b497529d30ee803189a99510d1ab6a96545ad"},{"author":{"_account_id":2583,"name":"Ante Karamatić","email":"ante.karamatic@canonical.com","username":"ivoks"},"change_message_id":"3a5a14fbd465ba31569d28c9733845fe666cd25f","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        range_qry \u003d context.session.query("},{"line_number":459,"context_line":"            models_v2.IPAvailabilityRange,"},{"line_number":460,"context_line":"            models_v2.IPAllocationPool).join("},{"line_number":461,"context_line":"                models_v2.IPAllocationPool)"},{"line_number":462,"context_line":"        results \u003d range_qry.filter_by(subnet_id\u003dsubnet_id).all()"},{"line_number":463,"context_line":"        for (range, pool) in results:"},{"line_number":464,"context_line":"            first \u003d int(netaddr.IPAddress(range[\u0027first_ip\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B7K4%3D","line":461,"in_reply_to":"AAAAM3%2F%2B8hM%3D","updated":"2013-02-18 15:52:32.000000000","message":"Idea behind this branch is to make sure that we don\u0027t allocate the same IP twice. Currently, if a query allocates an IP from the pool, there are no guarantees other parallel query will not allocate the same IP before it\u0027s removed from the pool of available IPs (thus the bug). With the update lock, SQL will lock the row on select, denying parallel query to select the same row.\n\nWhat we are doing here is exact copy of an example described in the MySQL manual Nachi linked (starts with \u0027Let us look at another example\u0027).","commit_id":"f22b497529d30ee803189a99510d1ab6a96545ad"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":458,"context_line":"        range_qry \u003d context.session.query("},{"line_number":459,"context_line":"            models_v2.IPAvailabilityRange,"},{"line_number":460,"context_line":"            models_v2.IPAllocationPool).join("},{"line_number":461,"context_line":"                models_v2.IPAllocationPool)"},{"line_number":462,"context_line":"        results \u003d range_qry.filter_by(subnet_id\u003dsubnet_id).all()"},{"line_number":463,"context_line":"        for (range, pool) in results:"},{"line_number":464,"context_line":"            first \u003d int(netaddr.IPAddress(range[\u0027first_ip\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAN3%2F%2F%2BKQ%3D","line":461,"in_reply_to":"AAAAM3%2F%2BwVI%3D","updated":"2013-03-04 23:39:18.000000000","message":"I agree with Dan. It looks we need to lock here too","commit_id":"f22b497529d30ee803189a99510d1ab6a96545ad"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":484,"context_line":"        range_qry \u003d context.session.query("},{"line_number":485,"context_line":"            models_v2.IPAvailabilityRange,"},{"line_number":486,"context_line":"            models_v2.IPAllocationPool).join("},{"line_number":487,"context_line":"                models_v2.IPAllocationPool)"},{"line_number":488,"context_line":"        results \u003d range_qry.filter_by(subnet_id\u003dsubnet_id).all()"},{"line_number":489,"context_line":"        for (range, pool) in results:"},{"line_number":490,"context_line":"            first \u003d int(netaddr.IPAddress(range[\u0027first_ip\u0027]))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F4jM%3D","line":487,"updated":"2013-03-07 17:55:02.000000000","message":"In the last rev of the patch, I though we believed that we needed to add a with_lockmode() here as well.  Did that discussion get resolved somewhere else?","commit_id":"6f49ce39af6c86eb2e85a616cadfec419323a510"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":484,"context_line":"        range_qry \u003d context.session.query("},{"line_number":485,"context_line":"            models_v2.IPAvailabilityRange,"},{"line_number":486,"context_line":"            models_v2.IPAllocationPool).join("},{"line_number":487,"context_line":"                models_v2.IPAllocationPool)"},{"line_number":488,"context_line":"        results \u003d range_qry.filter_by(subnet_id\u003dsubnet_id).all()"},{"line_number":489,"context_line":"        for (range, pool) in results:"},{"line_number":490,"context_line":"            first \u003d int(netaddr.IPAddress(range[\u0027first_ip\u0027]))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F4eE%3D","line":487,"in_reply_to":"AAAAN3%2F%2F4jM%3D","updated":"2013-03-07 18:41:32.000000000","message":"thanks. sorry i missed this.\ni\u0027ll update","commit_id":"6f49ce39af6c86eb2e85a616cadfec419323a510"}]}
