)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"3a3f07d2af0f82e6f1fa9c89bb2fcc7b59055e70","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_f1b19747","line":8,"updated":"2014-11-18 09:01:49.000000000","message":"Changing the transaction isolation for a single transaction in the code base hurts readability and my ability to reason about the code base in a significant way. Changing this in create_network will be very hard to verify / test and will have many side effects.\n\nHow about an alternative:\nDo either an app-level or DB-level random, much like what we do with MAC addresses. This way the retry logic should work even with repeatable read. Selecting the first makes no sense anyway as it\u0027s the most contentious way imaginable.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"5a034ae927986475cfc40dcc87f5f820611c0c12","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_02c07829","line":8,"in_reply_to":"5a890539_27174656","updated":"2014-11-18 20:09:33.000000000","message":"a example is perhaps clearer:\n\n  https://review.openstack.org/135406","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6225f94be64d58e7a64c411592f3bfe1995c37ff","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_8ab5757f","line":8,"in_reply_to":"5a890539_473aa899","updated":"2014-11-18 11:24:10.000000000","message":"Please note that this fixes common logic of allocating \"tunnel\" IDs.\nNot only gre/vxlan, which indeed could be configured large, but also vlan, which ranges could be quite small.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"05ee379a70aa2712cabc6c70eaedda1b74e69f08","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_cd607703","line":8,"in_reply_to":"5a890539_4d98071c","updated":"2014-11-18 11:45:39.000000000","message":"Is there a working solution? I thought you needed to move it to the create_network parent transaction first?","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5b699af1fe890d65979b4c983c965c89b3950fc8","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_5098a01b","line":8,"in_reply_to":"5a890539_503a6099","updated":"2014-11-18 12:06:37.000000000","message":"\u003e The rest of your comment is unrelated to what I wrote since the segments are already in the DB, they\u0027re not created here so you could in fact still hit the same issue IIUC.\n\nThat\u0027s just not correct.\nThe patch fixes particular issue in the logic that allocates IDs, if some other code will be accessing/changing those IDs that might introduce issues, but that\u0027s not a reason to not fixing what is broken right now.\n\nAnd I\u0027m quite surprised to see people advocating \"randomized\" solution that is not fixing the problem instead of fixing the logic in robust way.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"e490a59b4f3af41172085762765fe5f7b6e68680","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_9b286934","line":8,"in_reply_to":"5a890539_70959c31","updated":"2014-11-18 12:19:58.000000000","message":"The advantage of randomizing the segment ID is that we keep all of the transaction levels in Neutron the same. If we start solving issues like this on a piece by piece basis, changing the transaction levels in random places, I can\u0027t know what transaction level a subtransaction I\u0027m looking at is using without examining the entire call chain. It\u0027ll make debugging, maintaining and reasoning of the code extremely difficult.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"df52aac1e638f1de5e47db3a872cca80fa163eb0","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_ad5a4bef","line":8,"in_reply_to":"5a890539_8ab5757f","updated":"2014-11-18 11:34:47.000000000","message":"Nevertheless, taking the first is obviously contentious, while taking a random segment is several orders of magnitude less so.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"830a759fa53321a0886afd1be1356308c9ff0544","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_bbfa8572","line":8,"in_reply_to":"5a890539_9b286934","updated":"2014-11-18 12:27:51.000000000","message":"Well, I\u0027m fine with changing the default level project wise, it just needs to be investigated.\nRight now there are efforts to get rid of locking what mysql/galera doesn\u0027t support. \nRemoval introduces the need of retries, which rely on weaker isolation level (in fact, the only reason to keep transactions then is simplicity of rollback operations) then default one for mysql (repeatable read).\n\nFor postgres the default one is \u0027read committed\u0027, so it\u0027s already different from mysql. Btw, doesn\u0027t it confuse you?\nMysql and postgres have subtle differences that are already fixed here in there in the neutron code, and there are still places where those differences are not fixed still. \nWe don\u0027t have enough concurrent API tests (we don\u0027t have then upstream at all) to test each and every operation, and that\u0027s why I\u0027d prefer to apply different isolation level \u0027locally\u0027, e.g. to solve particular issue.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"81cd9c90ee830e453a88cf0daee8cc086145f4f2","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_4d98071c","line":8,"in_reply_to":"5a890539_ad5a4bef","updated":"2014-11-18 11:41:42.000000000","message":"right, that what i pointed out above: we making the issue less probable and depending on configuration. \nIt\u0027s clearly not the right way to go, especially if there is a appropriate working solution.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"162db30c2a1a889bdd1da8fed8c1f70b3fbbae3c","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_bbe9a5e7","line":8,"in_reply_to":"5a890539_b0e9c4b8","updated":"2014-11-18 12:21:25.000000000","message":"\u003e Obviously because it depends on correct logic and not on probability.\n\nOnly if the DB is actually supplying you READ UNCOMMITTED otherwise you\u0027re still reading the same old data always..","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ae4866e516ec3ac2b74dda09b39528e888e14aec","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_27174656","line":8,"in_reply_to":"5a890539_b30e2939","updated":"2014-11-18 20:03:42.000000000","message":"Currently we need to select an unallocated segment and attempts to allocate it (there comes the troubles) because you cannot directly update the first unallocated segment:\n\n  model_query(...).filter(allocated\u003dFalse).limit(1).update({\u0027allocated\u0027\u003dTrue})\n\nbecause we won\u0027t be able to select the one we just allocated!\n\n\nAn alternative approach is to tag the segment during allocation. Typically the column allocated can be replaced by a column reservation_id with the convention reservation_id \u003d\u003d 0 \u003c\u003d\u003e allocated \u003d\u003d False. Such approach allows to find the segment after the update:\n\n reservation_id \u003d uuidutils.generate_uuid()\n model_query(...).filter(reservation_id\u003d0).limit(1).update({\u0027reservation_id\u0027\u003dreservation_id}))\n model_query(...).filter(reservation_id\u003dreservation_id).first()\n\nbut it implies to update gre/vxlan/vlan db models :s","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"ff15fa09d2be2c21fbb8197c399aab01fa59b73c","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_1b1ab9c5","line":8,"in_reply_to":"5a890539_bbe9a5e7","updated":"2014-11-18 12:29:05.000000000","message":"\u003e Only if the DB is actually supplying you READ UNCOMMITTED otherwise you\u0027re still reading the same old data always\n\nWe need \u0027READ COMMITTED\u0027, not \u0027READ UNCOMMITTED\u0027","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"99c67023a4bb44d63617e20816735c1c70b09dc9","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_b30e2939","line":8,"in_reply_to":"5a890539_bbfa8572","updated":"2014-11-18 15:10:44.000000000","message":"I\u0027m not endorsing either proposed solution at this point.  I want to examine the drawbacks and strengths in both.\n\nRandom will be fine as long as the available space is sparsely consumed.  As soon as the space is not sparsely consumed then it will be terrible.  Won\u0027t this be the case for VLAN ids?\n\nWe can\u0027t exactly compare this to hash collisions because with hash collisions, the cost of a collision doesn\u0027t increase as dramatically.  In fact, collisions are expected and the performance degradation is more gradual.  Here the cost of a collision is a complete reset and retry.  If collisions are likely because the ids are mostly consumed then this cost is amplified more drastically.\n\nI\u0027m not sure we can ignore small configured ranges in tunnel types.  People configuring their ranges are not likely to consider the need for a sparsely allocated range.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"5546305086dd2d2b3d69546277a78b8d0f4d1025","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_f0650ce1","line":8,"in_reply_to":"5a890539_cd607703","updated":"2014-11-18 11:52:27.000000000","message":"\u003e right, that what i pointed out above: we making the issue less probable and depending on configuration. It\u0027s clearly not the right way to go, especially if there is a appropriate working solution.\n\nHow is your proposed solution better?\n\nIt does the same thing only not as well as random..","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"e6d22692161bd6a9a41145ab5f60caebc15dda80","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_70959c31","line":8,"in_reply_to":"5a890539_cd607703","updated":"2014-11-18 12:02:49.000000000","message":"This fix was tested by the same test that revealed the issue and is proved to be working.\n\nIf you take a look at patchset history, you\u0027ll see I\u0027ve moved changing isolation level more closely to the point where it is actually needed.\nIt\u0027s fine because the statements are really in one transaction.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"af2cf6b981ff283fa059b55bc95aa3e214ea424f","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_473aa899","line":8,"in_reply_to":"5a890539_e73c75ca","updated":"2014-11-18 10:41:26.000000000","message":"\u003e On the randomization: it is masking the problem by making it slightly less possible. In this particular case it may not help at all, if configured tunnel id range is small.\n\nThat\u0027s the understatement of the year! The tunnel ID range can be arbitrarily large, and the chance for two servers to generate the same segmentation ID can be shown to be non-significant (It\u0027s the same math for hash collisions).","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"e6ae89cfa377b7ac641777f235a225da2e7ac23c","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_503a6099","line":8,"in_reply_to":"5a890539_f0650ce1","updated":"2014-11-18 11:55:42.000000000","message":"\u003e -1 \"read committed\" is actually weaker then \"repeatable read\" and it\u0027s not safe to apply it project-wise until we sure it would be fine. There are some places in the code that issue queries for the same objects being under transaction. At the same time, applying it for create operations is safe, because until the object is created and tx is committed, no one knows that object exists and can concurrently access it.\n\nYes it\u0027s weaker but the DB doesn\u0027t necessarily guarantee you\u0027ll get it.\nThe rest of your comment is unrelated to what I wrote since the segments are already in the DB, they\u0027re not created here so you could in fact still hit the same issue IIUC.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"e6d22692161bd6a9a41145ab5f60caebc15dda80","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_b0e9c4b8","line":8,"in_reply_to":"5a890539_f0650ce1","updated":"2014-11-18 12:02:49.000000000","message":"\u003e How is your proposed solution better?\n\nObviously because it depends on correct logic and not on probability.\n\n\u003e It does the same thing only not as well as random..\n\nBut if we think more carefully...","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"bd09f81670fe2d4d2084a553fbe3a51bb3d86743","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_f1b27792","line":8,"in_reply_to":"5a890539_f1b19747","updated":"2014-11-18 09:28:57.000000000","message":"+1\n\nAlso bear in mind that isolation level is just a minimum guaranteed level, so it some DB engines it theoretically might be that READ COMMITTED \u003d\u003d REPEATABLE READ so this solution wouldn\u0027t actually help.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"15a70b716eae55e65d269d198c9987c55c67c828","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-17 12:13:37 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change transaction isolation so retry logic could work properly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Lower isolation level from REPEATABLE READ to READ COMMITTED."},{"line_number":10,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":11,"context_line":"while doing the same query."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_e73c75ca","line":8,"in_reply_to":"5a890539_f1b27792","updated":"2014-11-18 10:10:46.000000000","message":"-1\n\"read committed\" is actually weaker then \"repeatable read\" and it\u0027s not safe  to apply it project-wise until we sure it would be fine.\nThere are some places in the code that issue queries for the same objects being under transaction.\nAt the same time, applying it for create operations is safe, because until the object is created and tx is committed, no one knows that object exists and can concurrently access it.\n\nOn the randomization: it is masking the problem by making it slightly less possible. In this particular case it may not help at all, if configured tunnel id range is small.\n\nThis patch fixes the problem revealed by concurrent API tests, so I already tested it and verified that the solution works.\nOn \u0027side-effects\u0027, see above: it\u0027s safe for create operations, on update operations it might not be that safe, and that\u0027s the reason to apply isolation level for particular operation and not project-wise.\n\nI hope you get my reasoning now.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"60a2cfe55bf4e034ded1d58ab7ef04f0a4aaeb22","unresolved":false,"context_lines":[{"line_number":10,"context_line":"all connections."},{"line_number":11,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":12,"context_line":"while doing the same query."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I6b9d9212c37fe028566e0df4a3dfa51f284ce6e9"},{"line_number":15,"context_line":"Closes-Bug: #1382064"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3a961159_e9710045","line":13,"updated":"2014-12-11 14:31:07.000000000","message":"Maybe DocImpact should be added. I think it would be better to document that the isolation level is different than the default.","commit_id":"30330436f06720a09e78e9a91528e2994a1a24e5"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"72ad619b2413a3e540e5417328a88e1610cab5ea","unresolved":false,"context_lines":[{"line_number":10,"context_line":"all connections."},{"line_number":11,"context_line":"This allows retry logic to see changes done in other connections"},{"line_number":12,"context_line":"while doing the same query."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I6b9d9212c37fe028566e0df4a3dfa51f284ce6e9"},{"line_number":15,"context_line":"Closes-Bug: #1382064"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3a961159_7f413ea8","line":13,"in_reply_to":"3a961159_e9710045","updated":"2014-12-11 15:29:32.000000000","message":"agree.","commit_id":"30330436f06720a09e78e9a91528e2994a1a24e5"}],"neutron/db/api.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"bad51163dd00e7cac689a6b224fa5de44a5f22b3","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from oslo.config import cfg"},{"line_number":17,"context_line":"from oslo.db.sqlalchemy import session"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"_FACADE \u003d None"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_a02322bd","line":19,"updated":"2014-12-15 20:53:16.000000000","message":"This change appears unrelated.","commit_id":"faee48e041db1dac6274dbd0c47b1959102bd9f9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"55d482594b06f5ec3be3160634991ebde394fef9","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from oslo.config import cfg"},{"line_number":17,"context_line":"from oslo.db.sqlalchemy import session"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"_FACADE \u003d None"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_fbc86658","line":19,"in_reply_to":"3a961159_a02322bd","updated":"2014-12-19 13:28:17.000000000","message":"Done","commit_id":"faee48e041db1dac6274dbd0c47b1959102bd9f9"}],"neutron/db/sqlalchemyutils.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4d8905c77e0c1e959199a9bb1aa6cd6bd568d185","unresolved":false,"context_lines":[{"line_number":110,"context_line":""},{"line_number":111,"context_line":"def set_current_transaction_isolation_level(session, level):"},{"line_number":112,"context_line":"    try:"},{"line_number":113,"context_line":"        session.connection().execution_options("},{"line_number":114,"context_line":"            isolation_level\u003d\"READ COMMITTED\")"},{"line_number":115,"context_line":"    except exc.ArgumentError:"},{"line_number":116,"context_line":"        # don\u0027t care about sqlite"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_bd0b79d4","line":113,"updated":"2014-11-17 16:46:04.000000000","message":"the level is that reset to the default configured one once transaction is committed.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"756de3b4c1b48f20704f789b3b4fdf7066d47b2d","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        session.connection().execution_options("},{"line_number":114,"context_line":"            isolation_level\u003d\"READ COMMITTED\")"},{"line_number":115,"context_line":"    except exc.ArgumentError:"},{"line_number":116,"context_line":"        # don\u0027t care about sqlite"},{"line_number":117,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_6d3ec8db","line":116,"updated":"2014-11-17 13:20:54.000000000","message":"we should it\u0027s really sqlite dialect?","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"1707121616705f07976a74699eef3e0a1c1b51ba","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        session.connection().execution_options("},{"line_number":114,"context_line":"            isolation_level\u003d\"READ COMMITTED\")"},{"line_number":115,"context_line":"    except exc.ArgumentError:"},{"line_number":116,"context_line":"        # don\u0027t care about sqlite"},{"line_number":117,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_3de5c908","line":116,"in_reply_to":"5a890539_3d706971","updated":"2014-11-17 16:48:13.000000000","message":"The \"check\" word was missing. :s\n\nWe should log a warning in such case as it impacts the allocation logic.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"a02d4334c72efbff71ee6722b50671b3b4042f9b","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        session.connection().execution_options("},{"line_number":114,"context_line":"            isolation_level\u003d\"READ COMMITTED\")"},{"line_number":115,"context_line":"    except exc.ArgumentError:"},{"line_number":116,"context_line":"        # don\u0027t care about sqlite"},{"line_number":117,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_0f7c4e71","line":116,"in_reply_to":"5a890539_3de5c908","updated":"2014-11-17 17:59:16.000000000","message":"At first I thought we need to check for exact engine name (like sqlite).\nBut then I realized that changing to particular isolation level might not be supported by some of db backends.\nSince we only test mysql and postgres (to a certain extent) we can\u0027t say for sure.\nSo while those backends are not tested - just go with default level whatever it is and pretend that nothing happened.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4d8905c77e0c1e959199a9bb1aa6cd6bd568d185","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        session.connection().execution_options("},{"line_number":114,"context_line":"            isolation_level\u003d\"READ COMMITTED\")"},{"line_number":115,"context_line":"    except exc.ArgumentError:"},{"line_number":116,"context_line":"        # don\u0027t care about sqlite"},{"line_number":117,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_3d706971","line":116,"in_reply_to":"5a890539_6d3ec8db","updated":"2014-11-17 16:46:04.000000000","message":"not sure i understand your comment.\nI think if we for some reason can\u0027t switch the isolation level - it\u0027s fine to go with the default one.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"}],"neutron/plugins/ml2/drivers/helpers.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"487e7f6c354714cab14a8cd809ca4447520b04c7","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        for attempt in range(1, DB_MAX_RETRIES + 1):"},{"line_number":108,"context_line":"            with session.begin(subtransactions\u003dTrue):"},{"line_number":109,"context_line":"                alloc \u003d (session.query(self.model)."},{"line_number":110,"context_line":"                         filter_by(allocated\u003dFalse, **filters).first())"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"                if not alloc:"},{"line_number":113,"context_line":"                    # No resource available"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_63e78ae5","line":110,"updated":"2014-10-18 08:38:02.000000000","message":"I don\u0027t see any catch here, so is this really doing what is supposed to do? With no test I am not sure how we can validate this does what is is supposed to do...let alone the fact that this retry is plainly terrible.","commit_id":"d1e44c26ce39d2f546c4fc4b5525fcfa205aacba"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5f635193b815148ca948ecb8ed0294c772f71cc2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        for attempt in range(1, DB_MAX_RETRIES + 1):"},{"line_number":108,"context_line":"            with session.begin(subtransactions\u003dTrue):"},{"line_number":109,"context_line":"                alloc \u003d (session.query(self.model)."},{"line_number":110,"context_line":"                         filter_by(allocated\u003dFalse, **filters).first())"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"                if not alloc:"},{"line_number":113,"context_line":"                    # No resource available"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_df5e10e9","line":110,"in_reply_to":"9aa7fdbe_3e6f2c94","updated":"2014-10-21 10:22:30.000000000","message":"got it, thanks","commit_id":"d1e44c26ce39d2f546c4fc4b5525fcfa205aacba"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"bbb211abe590e99ce59d22366057d53878be61b2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        for attempt in range(1, DB_MAX_RETRIES + 1):"},{"line_number":108,"context_line":"            with session.begin(subtransactions\u003dTrue):"},{"line_number":109,"context_line":"                alloc \u003d (session.query(self.model)."},{"line_number":110,"context_line":"                         filter_by(allocated\u003dFalse, **filters).first())"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"                if not alloc:"},{"line_number":113,"context_line":"                    # No resource available"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_83ed4e8e","line":110,"in_reply_to":"9aa7fdbe_63e78ae5","updated":"2014-10-18 09:42:50.000000000","message":"The scenario that could test that is really integration only (the issue itself happens during rally run), so I doubt we can do unit test here.\n\nThe issue here is that retries are done within 1 transaction, with certain transaction isolation level (REPEATABLE READ, default for mysql) that leads to the same row is fetched, despite of concurrent updates.\n\nSo the fix here is that we restart the transaction to give a chance to see update results in select query.","commit_id":"d1e44c26ce39d2f546c4fc4b5525fcfa205aacba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"69d6cb5dee4f946179c69d7326e04a51393b01e4","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        for attempt in range(1, DB_MAX_RETRIES + 1):"},{"line_number":108,"context_line":"            with session.begin(subtransactions\u003dTrue):"},{"line_number":109,"context_line":"                alloc \u003d (session.query(self.model)."},{"line_number":110,"context_line":"                         filter_by(allocated\u003dFalse, **filters).first())"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"                if not alloc:"},{"line_number":113,"context_line":"                    # No resource available"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_c40f5c2d","line":110,"in_reply_to":"9aa7fdbe_83ed4e8e","updated":"2014-10-18 20:36:32.000000000","message":"Sorry about the catch, I got confused between first() and one(). \n\nThat aside, you can unit test this by ensuring that first()\u0027s side effects are a tuple of different results. So in practice, and if you wanted too, this can be tested.","commit_id":"d1e44c26ce39d2f546c4fc4b5525fcfa205aacba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"372327b47eca5adc6cb05e5306c6027708b77052","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        for attempt in range(1, DB_MAX_RETRIES + 1):"},{"line_number":108,"context_line":"            with session.begin(subtransactions\u003dTrue):"},{"line_number":109,"context_line":"                alloc \u003d (session.query(self.model)."},{"line_number":110,"context_line":"                         filter_by(allocated\u003dFalse, **filters).first())"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"                if not alloc:"},{"line_number":113,"context_line":"                    # No resource available"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_3e6f2c94","line":110,"in_reply_to":"9aa7fdbe_87a0ecf5","updated":"2014-10-20 22:50:52.000000000","message":"Look at:\n\nneutron/tests/unit/ml2/test_helpers.py\n\naround the testcase:\n\ntest_allocate_partial_segment_first_attempt_fails\n\nI see no unit test that covers multiple runs because of the fact that first() returns the same value. Agreed that this would only give us certain assurance that the code is correct, that said that would be better than no coverage around this case at all.","commit_id":"d1e44c26ce39d2f546c4fc4b5525fcfa205aacba"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"076abf0a4bee379c3bf1b63955d6be94e1758ab1","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        for attempt in range(1, DB_MAX_RETRIES + 1):"},{"line_number":108,"context_line":"            with session.begin(subtransactions\u003dTrue):"},{"line_number":109,"context_line":"                alloc \u003d (session.query(self.model)."},{"line_number":110,"context_line":"                         filter_by(allocated\u003dFalse, **filters).first())"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"                if not alloc:"},{"line_number":113,"context_line":"                    # No resource available"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_87a0ecf5","line":110,"in_reply_to":"9aa7fdbe_c40f5c2d","updated":"2014-10-20 08:33:20.000000000","message":"sorry for my ignorance, could you describe your idea about the unit test in more details?\nthanks","commit_id":"d1e44c26ce39d2f546c4fc4b5525fcfa205aacba"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"99c67023a4bb44d63617e20816735c1c70b09dc9","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            # Selected segment can be allocated before update by someone else,"},{"line_number":113,"context_line":"            # We retry until update success or DB_MAX_ATTEMPTS attempts"},{"line_number":114,"context_line":"            for attempt in range(1, DB_MAX_ATTEMPTS + 1):"},{"line_number":115,"context_line":"                alloc \u003d select.first()"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"                if not alloc:"},{"line_number":118,"context_line":"                    # No resource available"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_c91dc210","line":115,"updated":"2014-11-18 15:10:44.000000000","message":"Another proposal to add to the mix:  What if we query, say, the N first available ids instead of just the first and randomly choose 1-N.  We\u0027ll approximate the same linear allocation we have today but this should alleviate some of the pressure.","commit_id":"ddde6bb0f478c18fb5962144eee17b23cdb6fdd1"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b7e00e84f263563d58bd3d08abede6bc2a5eb164","unresolved":false,"context_lines":[{"line_number":491,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, net_data)"},{"line_number":492,"context_line":"        session \u003d context.session"},{"line_number":493,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":494,"context_line":"            session.connection().execution_options("},{"line_number":495,"context_line":"                isolation_level\u003d\"READ COMMITTED\")"},{"line_number":496,"context_line":"            self._ensure_default_security_group(context, tenant_id)"},{"line_number":497,"context_line":"            result \u003d super(Ml2Plugin, self).create_network(context, network)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_4a1f566c","line":494,"updated":"2014-11-14 17:41:36.000000000","message":"do you think we have to reset the isolation to the default value at the end of the method?","commit_id":"f0f4a46632aa6b8a1003b6110ebb83de7adcaa49"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"29a8d4cc695d8d76df730854dd98d8d7b615f02c","unresolved":false,"context_lines":[{"line_number":491,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, net_data)"},{"line_number":492,"context_line":"        session \u003d context.session"},{"line_number":493,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":494,"context_line":"            session.connection().execution_options("},{"line_number":495,"context_line":"                isolation_level\u003d\"READ COMMITTED\")"},{"line_number":496,"context_line":"            self._ensure_default_security_group(context, tenant_id)"},{"line_number":497,"context_line":"            result \u003d super(Ml2Plugin, self).create_network(context, network)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_c0d967f4","line":494,"in_reply_to":"5a890539_4a1f566c","updated":"2014-11-14 18:39:29.000000000","message":"as far as i understand sqlalchemy code, it is done automatically when transaction is committed: it is reset to default level, specified at engine creation","commit_id":"f0f4a46632aa6b8a1003b6110ebb83de7adcaa49"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"dc87221e7fdc50d6a0ab203d63647bb27d4d13d0","unresolved":false,"context_lines":[{"line_number":494,"context_line":"        session \u003d context.session"},{"line_number":495,"context_line":"        with contextlib.nested("},{"line_number":496,"context_line":"            session.begin(subtransactions\u003dTrue),"},{"line_number":497,"context_line":"            sqla.set_mysql_tx_isolation_level(session, \"READ COMMITTED\")"},{"line_number":498,"context_line":"        ):"},{"line_number":499,"context_line":"            self._ensure_default_security_group(context, tenant_id)"},{"line_number":500,"context_line":"            result \u003d super(Ml2Plugin, self).create_network(context, network)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_0cdf28d7","line":497,"updated":"2014-12-21 07:08:04.000000000","message":"Much cleaner, thank you.","commit_id":"c91ec470f0a6720ecd0f35b5fdccc346145d5043"}],"neutron/tests/functional/db/test_sqla_utils.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"90ac2877a1bdc30b827f954c96c016265b8c9333","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                              self.get_engine().url,"},{"line_number":34,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def get_engine(self):"},{"line_number":37,"context_line":"        return self.engine"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def test_set_tx_iso_level_changes_back_and_forth_mysql(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_c8b60525","line":36,"updated":"2015-01-14 23:55:58.000000000","message":"This function is only called once - consider inlining.","commit_id":"9b6d927f0c00eac7512c0442ec7f59870733494d"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6a67b61ecc980536e3f154ba71fe65f139d2b0b0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                              self.get_engine().url,"},{"line_number":34,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def get_engine(self):"},{"line_number":37,"context_line":"        return self.engine"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def test_set_tx_iso_level_changes_back_and_forth_mysql(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_c0a17296","line":36,"in_reply_to":"3a961159_c8b60525","updated":"2015-01-15 07:15:47.000000000","message":"Done","commit_id":"9b6d927f0c00eac7512c0442ec7f59870733494d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"90ac2877a1bdc30b827f954c96c016265b8c9333","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def get_engine(self):"},{"line_number":37,"context_line":"        return self.engine"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def test_set_tx_iso_level_changes_back_and_forth_mysql(self):"},{"line_number":40,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":41,"context_line":"        with contextlib.nested("},{"line_number":42,"context_line":"            ctx.session.begin(subtransactions\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_e8b901ed","line":39,"updated":"2015-01-14 23:55:58.000000000","message":"I\u0027m concerned that this test as written may not pass in an environment that has set the default isolation level to \u0027READ COMMITTED\u0027.  Consider ensuring that the test can pass in any environment.\n\nt1 \u003d utils.get_isolation_level() # this could encapsulate lines 52-54 and be part of sqla utils\nt2 \u003d \u0027REPEATABLE-READ\u0027 if t1 \u003d\u003d \u0027READ_COMMITTED\u0027 else \u0027READ_COMMITTED\u0027\nwith utils.set_tx_isolation_level(t2):\n  ..\nt3 \u003d utils.get_isolation_level()\nself.assertEqual(t1, t3)","commit_id":"9b6d927f0c00eac7512c0442ec7f59870733494d"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6a67b61ecc980536e3f154ba71fe65f139d2b0b0","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def get_engine(self):"},{"line_number":37,"context_line":"        return self.engine"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def test_set_tx_iso_level_changes_back_and_forth_mysql(self):"},{"line_number":40,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":41,"context_line":"        with contextlib.nested("},{"line_number":42,"context_line":"            ctx.session.begin(subtransactions\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_e0774e39","line":39,"in_reply_to":"3a961159_e8b901ed","updated":"2015-01-15 07:15:47.000000000","message":"Ok.\nThe assumption was that repeatable-read is the default (it\u0027s db-level default)","commit_id":"9b6d927f0c00eac7512c0442ec7f59870733494d"}]}
