)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d286d7f1acacb67f2c48d9fe074a4ba88d7efe1b","unresolved":false,"context_lines":[{"line_number":6081,"context_line":""},{"line_number":6082,"context_line":"    try:"},{"line_number":6083,"context_line":"        # Group the insert and delete in a transaction."},{"line_number":6084,"context_line":"        with conn.begin():"},{"line_number":6085,"context_line":"            conn.execute(insert)"},{"line_number":6086,"context_line":"            if tablename \u003d\u003d \"instances\":"},{"line_number":6087,"context_line":"                delete_statement \u003d table.delete().where(table.c.uuid.in_("}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_0d213db5","side":"PARENT","line":6084,"updated":"2018-01-10 19:27:19.000000000","message":"I would have thought that this would ensure a consistent view between the insert and the delete within, but I guess not?","commit_id":"4fd671459494da8c20cba960c77d5a0a31d5e0eb"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b46d7f7f1582b62d05dc060153f0b1f69239ea93","unresolved":false,"context_lines":[{"line_number":6067,"context_line":"    if records:"},{"line_number":6068,"context_line":"        insert \u003d shadow_table.insert(inline\u003dTrue).\\"},{"line_number":6069,"context_line":"                from_select(columns, sql.select([table], column.in_(records)))"},{"line_number":6070,"context_line":"        delete \u003d table.delete().where(column.in_(records))"},{"line_number":6071,"context_line":"        # NOTE(tssurya): In order to facilitate the deletion of records from"},{"line_number":6072,"context_line":"        # instance_mappings and request_specs tables in the nova_api DB, the"},{"line_number":6073,"context_line":"        # rows of deleted instances from the instances table are stored prior"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_3bb79089","line":6070,"updated":"2018-01-10 22:41:45.000000000","message":"Note to self: what\u0027s different here is that it does the select only once instead of twice, and uses the result to construct the delete statement (as is mentioned in the commit message). That way we can\u0027t get two different results for two separate identical select statements.\n\nI also don\u0027t get why the conn.begin() context manager doesn\u0027t guarantee the old way of two selects happen in one transaction, but I think this change makes sense.","commit_id":"6b9d84c926893fd5e9114767d15436c090074388"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d286d7f1acacb67f2c48d9fe074a4ba88d7efe1b","unresolved":false,"context_lines":[{"line_number":8995,"context_line":"        main_rows \u003d self.conn.execute(qiim).fetchall()"},{"line_number":8996,"context_line":"        shadow_rows \u003d self.conn.execute(qsiim).fetchall()"},{"line_number":8997,"context_line":"        # Verify the insertions into shadow is same as deletions from main"},{"line_number":8998,"context_line":"        self.assertEqual(len(shadow_rows), len(rows) - len(main_rows))"},{"line_number":8999,"context_line":""},{"line_number":9000,"context_line":"    def _check_sqlite_version_less_than_3_7(self):"},{"line_number":9001,"context_line":"        # SQLite doesn\u0027t enforce foreign key constraints without a pragma."}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_ad060920","line":8998,"updated":"2018-01-10 19:27:19.000000000","message":"This wouldn\u0027t have failed before your change right? Since you didn\u0027t force a race in some way? It\u0027s not a big deal because I dunno how we\u0027d really do that without being super fake about it, but I just want to make sure I\u0027m not missing any other magic here (which should be in a comment if so).","commit_id":"6b9d84c926893fd5e9114767d15436c090074388"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"7df1603dbd054892a9c7a0421c90f1bf737e9ad4","unresolved":false,"context_lines":[{"line_number":8995,"context_line":"        main_rows \u003d self.conn.execute(qiim).fetchall()"},{"line_number":8996,"context_line":"        shadow_rows \u003d self.conn.execute(qsiim).fetchall()"},{"line_number":8997,"context_line":"        # Verify the insertions into shadow is same as deletions from main"},{"line_number":8998,"context_line":"        self.assertEqual(len(shadow_rows), len(rows) - len(main_rows))"},{"line_number":8999,"context_line":""},{"line_number":9000,"context_line":"    def _check_sqlite_version_less_than_3_7(self):"},{"line_number":9001,"context_line":"        # SQLite doesn\u0027t enforce foreign key constraints without a pragma."}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_d1749938","line":8998,"in_reply_to":"7f96bb07_ad060920","updated":"2018-01-17 14:56:36.000000000","message":"No it wouldn\u0027t have :)","commit_id":"6b9d84c926893fd5e9114767d15436c090074388"}]}
