)]}'
{"neutron/db/ovn_revision_numbers_db.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ad1967694338e521f4ad67b699caeb131f4794fd","unresolved":true,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"@tenacity.retry(wait\u003dtenacity.wait_exponential(multiplier\u003d0.02),"},{"line_number":102,"context_line":"                stop\u003dtenacity.stop_after_delay(1),"},{"line_number":103,"context_line":"                reraise\u003dTrue)"},{"line_number":104,"context_line":"@db_api.retry_if_session_inactive()"},{"line_number":105,"context_line":"def create_initial_revision(context, resource_uuid, resource_type,"},{"line_number":106,"context_line":"                            revision_number\u003dINITIAL_REV_NUM,"}],"source_content_type":"text/x-python","patch_set":1,"id":"008c1b25_bdf9cb3c","line":103,"updated":"2020-12-21 17:28:51.000000000","message":"Ok, now I maybe understand what is happening with this standard_attr_id. This value is assigned by the DB engine because is a \"autoincrement\" integer.\n\nclass StandardAttribute():\n    ...\n    id \u003d sa.Column(sa.BigInteger().with_variant(sa.Integer(), \u0027sqlite\u0027),\n                   primary_key\u003dTrue, autoincrement\u003dTrue)\n\nThis value is provided, during a transaction, when the transaction is flushed. That happens in the network DB creation in [1], at the end of this subtransaction context.\n\nIf this \"id\", when the transaction is committed, has been used and deleted, the \"id\" reference will fail. We need a retry method but I suggest to use oslo_db.api.wrap_db_retry [2]\n\n\n[1]https://github.com/openstack/neutron/blob/8d6c301301e33697fd4eb4d6de53f680b909a04d/neutron/db/db_base_plugin_v2.py#L401\n[2]We talked about using oslo_db to decorate DB operations https://bugs.launchpad.net/neutron/+bug/1887523","commit_id":"d57209bf7f9894d8a769a3c606359f30d951468b"}]}
