)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"4c45ad3be0d893218b607f838449c5093ba366c4","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Ensure non-overlapping cidrs in subnetpools with galera"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change enables galera support in _lock_subnetpool[1]. It uses a"},{"line_number":10,"context_line":"SELECT ... FOR UPDATE lock to disallow 2 concurrent subnet allocation in"},{"line_number":11,"context_line":"the same subnetpool with non-galera db (and galera mono-writer cluster)"},{"line_number":12,"context_line":"and an update to disallow 2 transactions performing concurrent subnet"},{"line_number":13,"context_line":"allocation in the same subnetpool to succeed: the 2 transactions will"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"3a50d1a3_349956d1","line":10,"updated":"2015-07-30 09:03:01.000000000","message":"not anymore!","commit_id":"695186c784da89c75cf91ed632341159385861a0"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"43bf7d418da8e2a4c48f5d98b69c28230db9dfb2","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Ensure non-overlapping cidrs in subnetpools with galera"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change enables galera support in _lock_subnetpool[1]. It uses a"},{"line_number":10,"context_line":"SELECT ... FOR UPDATE lock to disallow 2 concurrent subnet allocation in"},{"line_number":11,"context_line":"the same subnetpool with non-galera db (and galera mono-writer cluster)"},{"line_number":12,"context_line":"and an update to disallow 2 transactions performing concurrent subnet"},{"line_number":13,"context_line":"allocation in the same subnetpool to succeed: the 2 transactions will"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"3a50d1a3_b7700875","line":10,"in_reply_to":"3a50d1a3_349956d1","updated":"2015-07-30 09:22:33.000000000","message":"Done","commit_id":"695186c784da89c75cf91ed632341159385861a0"}],"neutron/db/migration/alembic_migrations/versions/26c371498592_subnetpool_hash.py":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"ba616b1519f7b24ce542674cd80b27a777768058","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.add_column(\u0027subnetpools,"},{"line_number":34,"context_line":"                  sa.Column(\u0027hash\u0027, sa.String(36), nullable\u003dFalse, default\u003d\u0027\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_89d21eff","line":33,"updated":"2015-06-03 14:02:16.000000000","message":"Missing \u0027","commit_id":"1d277682147361405111c8d271785d361f6d56fa"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"ba616b1519f7b24ce542674cd80b27a777768058","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.add_column(\u0027subnetpools,"},{"line_number":34,"context_line":"                  sa.Column(\u0027hash\u0027, sa.String(36), nullable\u003dFalse, default\u003d\u0027\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_e9e072ce","line":34,"updated":"2015-06-03 14:02:16.000000000","message":"default is useless in migrations. Use server_default. More information here - http://docs.openstack.org/developer/neutron/devref/db_layer.html#difference-between-default-and-server-default-parameters-for-columns","commit_id":"1d277682147361405111c8d271785d361f6d56fa"}],"neutron/ipam/subnet_alloc.py":[{"author":{"_account_id":14258,"name":"Ryan Tidwell","email":"rktidwell85@gmail.com","username":"tidwellr"},"change_message_id":"d11840daa6909b88d01a63e9fcb10c21d155e7c5","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        query \u003d session.query(SubnetPool).filter_by("},{"line_number":56,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":57,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"},{"line_number":58,"context_line":"        if not count:"},{"line_number":59,"context_line":"            raise db_exc.RetryRequest()"},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_9d1c9278","line":57,"updated":"2015-06-03 17:29:38.000000000","message":"I\u0027m a little illiterate when it comes to Galera, so this is more of a question not a critique.  What happens from a sqlalchemy perspective when 2 transactions are trying to modify the same record? Does update() simply return 0, or is there an exception raised?  By reading line 58 it appears that the clue we get is update() returning a row count of 0. Am I understanding this correctly?","commit_id":"1d277682147361405111c8d271785d361f6d56fa"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"4ae6e2d0fd079c91693e1b50373c4aa98c5aae3d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":57,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"},{"line_number":58,"context_line":"        if not count:"},{"line_number":59,"context_line":"            raise db_exc.RetryRequest()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _get_allocated_cidrs(self):"},{"line_number":62,"context_line":"        query \u003d self._context.session.query(models_v2.Subnet)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_f3473e49","line":59,"updated":"2015-06-08 15:29:16.000000000","message":"This works, but I\u0027m not sure compare and swap is worthwhile here. This local check will only trigger on a local race between the query and the update, which is only a miniscule part of what we\u0027re interested in. The purpose of this lock is to lock the whole transaction. It achieves this because it does a dependent row update, but the failure can happen anywhere in this transaction up to commit, not just here. That is, you\u0027re exceptionally unlikely to ever raise this RetryRequest(). You\u0027re far more likely to raise a deadlock later when a conflicting remote transaction is committed.\n\nYou might as well use a select for update here, as it amounts to the same thing and it\u0027s slightly clearer.","commit_id":"1d277682147361405111c8d271785d361f6d56fa"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"0f30f2d7daa3507c7d601b90738b98c926773725","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":57,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"},{"line_number":58,"context_line":"        if not count:"},{"line_number":59,"context_line":"            raise db_exc.RetryRequest()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _get_allocated_cidrs(self):"},{"line_number":62,"context_line":"        query \u003d self._context.session.query(models_v2.Subnet)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_5b5b9887","line":59,"in_reply_to":"3afb71cf_114384b3","updated":"2015-06-30 22:27:34.000000000","message":"Done","commit_id":"1d277682147361405111c8d271785d361f6d56fa"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"6577923a592c1afc5a32bafe1019c9a00a8b9f11","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":57,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"},{"line_number":58,"context_line":"        if not count:"},{"line_number":59,"context_line":"            raise db_exc.RetryRequest()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _get_allocated_cidrs(self):"},{"line_number":62,"context_line":"        query \u003d self._context.session.query(models_v2.Subnet)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_114384b3","line":59,"in_reply_to":"3afb71cf_d3bb22e4","updated":"2015-06-10 15:37:34.000000000","message":"the deadlocks when a remote transaction is committed is what happens when two galera nodes have a conflict in their transaction logs.  The canonical documentation for this is here:  http://galeracluster.com/documentation-webpages/certificationbasedreplication.html, which is a little vague as to what actually happens when a transaction is \"discarded\", so more clues to what that means are here: http://galeracluster.com/documentation-webpages/dealingwithmultimasterconflicts.html.  Basically it throws a \"deadlock\" error.\n\nJay talks about how it specifically occurs with SELECT FOR UPDATE in Nova here: http://www.joinfu.com/2015/01/understanding-reservations-concurrency-locking-in-nova/  and also \n\nbut I think what Matt is saying is that what we\u0027re doing above will have the same effect anyway as a SELECT FOR UPDATE, e.g. you pass the retryrequest because on that one galera node you are OK, but then a conflicting write occurred on a different galera node.   hence this just needs to be a plain SELECT..FOR UPDATE plus a retry decorator at the top level of the whole operation, which I think is what has been said already (e.g. Jay\u0027s comment on May 16).","commit_id":"1d277682147361405111c8d271785d361f6d56fa"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"4f108f78f31d5c1c2ebc8164655cd603926b2068","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":57,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"},{"line_number":58,"context_line":"        if not count:"},{"line_number":59,"context_line":"            raise db_exc.RetryRequest()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _get_allocated_cidrs(self):"},{"line_number":62,"context_line":"        query \u003d self._context.session.query(models_v2.Subnet)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_d3bb22e4","line":59,"in_reply_to":"3afb71cf_f3473e49","updated":"2015-06-08 15:34:39.000000000","message":"@Matthew: Some references to a documentation would be appreciated","commit_id":"1d277682147361405111c8d271785d361f6d56fa"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bae46c729b474827aff26cdcd2e9b50a5197d22","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        subnetpool."},{"line_number":49,"context_line":"        \"\"\""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        # NOTE(cbrandily): select for update disallows 2 concurrent subnet a"},{"line_number":52,"context_line":"        # 2 subnets in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_c748d6ce","line":51,"updated":"2015-07-15 13:43:05.000000000","message":"comment is malformed somehow","commit_id":"78859e623d46b354269ddf9f70bbbf9188b40fae"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"37e086a6bb4e2ce5c7aee2db2a958b5be4430189","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        subnetpool."},{"line_number":49,"context_line":"        \"\"\""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        # NOTE(cbrandily): select for update disallows 2 concurrent subnet a"},{"line_number":52,"context_line":"        # 2 subnets in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_6ab8af75","line":51,"in_reply_to":"9a41bdd9_c748d6ce","updated":"2015-07-15 14:00:55.000000000","message":"Done","commit_id":"78859e623d46b354269ddf9f70bbbf9188b40fae"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8bae46c729b474827aff26cdcd2e9b50a5197d22","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"},{"line_number":59,"context_line":"        # to succeed with Galera: at most 1 transaction will succeed, others"},{"line_number":60,"context_line":"        # will rollback and be catched in neutron.db.v2.base"},{"line_number":61,"context_line":"        query \u003d self._context.session.query(models_v2.SubnetPool).filter_by("},{"line_number":62,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":63,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_670eaa8d","line":60,"updated":"2015-07-15 13:43:05.000000000","message":"caught","commit_id":"78859e623d46b354269ddf9f70bbbf9188b40fae"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"37e086a6bb4e2ce5c7aee2db2a958b5be4430189","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"},{"line_number":59,"context_line":"        # to succeed with Galera: at most 1 transaction will succeed, others"},{"line_number":60,"context_line":"        # will rollback and be catched in neutron.db.v2.base"},{"line_number":61,"context_line":"        query \u003d self._context.session.query(models_v2.SubnetPool).filter_by("},{"line_number":62,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":63,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_0ab4837d","line":60,"in_reply_to":"9a41bdd9_670eaa8d","updated":"2015-07-15 14:00:55.000000000","message":"Done","commit_id":"78859e623d46b354269ddf9f70bbbf9188b40fae"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"bed074d77b1b00269b9a2b3a95f8d27e55cd72c9","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        # will rollback and be caught in neutron.db.v2.base"},{"line_number":61,"context_line":"        query \u003d self._context.session.query(models_v2.SubnetPool).filter_by("},{"line_number":62,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":63,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"},{"line_number":64,"context_line":"        if not count:"},{"line_number":65,"context_line":"            raise db_exc.RetryRequest()"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_fcfbb045","line":63,"updated":"2015-07-24 19:29:54.000000000","message":"question.  wouldn\u0027t galera detect the deadlock here even if you did something like \"UPDATE table SET id\u003did WHERE id\u003d:id\"?  e.g. do we really need the extra column.","commit_id":"42c3e89bf186b494a486331aa62e1471a3adb526"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"4beff26543fc11c4b42d273d97e750a0684e8c68","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        # will rollback and be caught in neutron.db.v2.base"},{"line_number":61,"context_line":"        query \u003d self._context.session.query(models_v2.SubnetPool).filter_by("},{"line_number":62,"context_line":"            id\u003dself._subnetpool[\u0027id\u0027], hash\u003dcurrent_hash)"},{"line_number":63,"context_line":"        count \u003d query.update({\u0027hash\u0027: new_hash})"},{"line_number":64,"context_line":"        if not count:"},{"line_number":65,"context_line":"            raise db_exc.RetryRequest()"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_afb96cee","line":63,"in_reply_to":"3a50d1a3_fcfbb045","updated":"2015-07-24 19:44:32.000000000","message":"OK, I just did some experimentation.  you definitely *do* want a net change in the data that is also different from what the other transaction is doing, and you also want to make sure the WHERE clause of your update includes the previous version as criteria.  so i think this is right.","commit_id":"42c3e89bf186b494a486331aa62e1471a3adb526"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d773489263398f08b94e0eae8da97f5be4437215","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # allocations in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":55,"context_line":"                        .with_lockmode(\u0027update\u0027).scalar())"},{"line_number":56,"context_line":"        new_hash \u003d uuidutils.generate_uuid()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a50d1a3_930a4b89","line":55,"updated":"2015-07-27 21:59:31.000000000","message":"If current_hash turns out to be None, then does the rest of the query handle it correctly?","commit_id":"1eb50e7ed9d7a2438688c7a06fe5733451b55f4d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a4c3425852fff86ac66536a88d895d54dfa197ea","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # allocations in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":55,"context_line":"                        .with_lockmode(\u0027update\u0027).scalar())"},{"line_number":56,"context_line":"        new_hash \u003d uuidutils.generate_uuid()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a50d1a3_4153866b","line":55,"updated":"2015-07-28 05:17:57.000000000","message":"i would prefer to not use with_lockmode update at all. that way the behavior is the same between non-galera and galera deployments.","commit_id":"1eb50e7ed9d7a2438688c7a06fe5733451b55f4d"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"41c10409d05f3c9e374cc60cbbaf6310db2a91b0","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # allocations in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":55,"context_line":"                        .with_lockmode(\u0027update\u0027).scalar())"},{"line_number":56,"context_line":"        new_hash \u003d uuidutils.generate_uuid()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a50d1a3_64df4969","line":55,"in_reply_to":"3a50d1a3_4153866b","updated":"2015-07-29 20:20:10.000000000","message":"@kevin, i would prefer also but how? \n\nAFAIK, we cannot use a db constraint to avoid cidr overlapping in a subnetpool. The only way i see to avoid with_mockmode is to:\n\n* 1) create a transaction\n* 2) choose a subnet candidate\n* 3) create the subnet candidate\n* 4) commit transaction\n* 5) check if subnet doesn\u0027t overlap other subnets\n* 6) delete the subnet if it overlaps with a new transaction\n\n4) is required otherwise 2 concurrent 5) won\u0027t see the other subnet.\n\nWhen 6) is required, an error during 5) 6) implies an overlapping \"zombie\" subnet. We can add something to handle such zombies but it makes things even more complicated.","commit_id":"1eb50e7ed9d7a2438688c7a06fe5733451b55f4d"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"7adb779412d95f17e4dce568c535ed923210e257","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # allocations in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":55,"context_line":"                        .with_lockmode(\u0027update\u0027).scalar())"},{"line_number":56,"context_line":"        new_hash \u003d uuidutils.generate_uuid()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a50d1a3_9796453c","line":55,"in_reply_to":"3a50d1a3_446fad5f","updated":"2015-07-29 20:24:18.000000000","message":"Done","commit_id":"1eb50e7ed9d7a2438688c7a06fe5733451b55f4d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a825a6833553361520954c05d7ea7fd683b2c280","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # allocations in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":55,"context_line":"                        .with_lockmode(\u0027update\u0027).scalar())"},{"line_number":56,"context_line":"        new_hash \u003d uuidutils.generate_uuid()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a50d1a3_f1cea02c","line":55,"in_reply_to":"3a50d1a3_64df4969","updated":"2015-07-30 08:53:18.000000000","message":"your compare and swap strategy works for both galera and single-writer. the lockmode shouldn\u0027t be necessary.","commit_id":"1eb50e7ed9d7a2438688c7a06fe5733451b55f4d"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"41c10409d05f3c9e374cc60cbbaf6310db2a91b0","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # allocations in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":55,"context_line":"                        .with_lockmode(\u0027update\u0027).scalar())"},{"line_number":56,"context_line":"        new_hash \u003d uuidutils.generate_uuid()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a50d1a3_446fad5f","line":55,"in_reply_to":"3a50d1a3_930a4b89","updated":"2015-07-29 20:20:10.000000000","message":"current_hash \u003d\u003d None implies the filtered query returned nothing:\n\n\u003d\u003e the subnetpool was deleted concurrently and by consequence,\n\u003d\u003e count \u003d\u003d0 in L63-64 and a RetryRequest is raised\n\u003d\u003e Next iteration raises a SubnetPoolNotFound error in _get_subnetpool ( neutron.db.db_base_plugin_common module).\n\nSo it\u0027s supported but not really elegant, it would be better to raise SubnetPoolNotFound if current_hash is None","commit_id":"1eb50e7ed9d7a2438688c7a06fe5733451b55f4d"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"dbe1ceb9b40bdf60664246dca1ef1f03caad7554","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # allocations in the same subnetpool (except with Galera)"},{"line_number":53,"context_line":"        current_hash \u003d (self._context.session.query(models_v2.SubnetPool.hash)"},{"line_number":54,"context_line":"                        .filter_by(id\u003dself._subnetpool[\u0027id\u0027])"},{"line_number":55,"context_line":"                        .with_lockmode(\u0027update\u0027).scalar())"},{"line_number":56,"context_line":"        new_hash \u003d uuidutils.generate_uuid()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a50d1a3_d43cb2c1","line":55,"in_reply_to":"3a50d1a3_f1cea02c","updated":"2015-07-30 09:01:46.000000000","message":"Done","commit_id":"1eb50e7ed9d7a2438688c7a06fe5733451b55f4d"}]}
