)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"60bdaadbd154d62993eae2a28d796b59f064b8ee","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zhiguo.li \u003czhiguo.lee@foxmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-09-15 09:32:52 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix NoneType error when \u0027access_mapping\u0027 is None"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the return value of connection.execute().first() is None, an NoneType"},{"line_number":10,"context_line":"error will occur in code \u0027access_mapping[\u0027state\u0027]\u0027."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f2577a7_01499e2f","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":48},"updated":"2017-09-15 15:11:20.000000000","message":"DB migration: fix NoneType error ...","commit_id":"8dee0d7850bda77fc4e5407482fc3add10759e0d"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"60bdaadbd154d62993eae2a28d796b59f064b8ee","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix NoneType error when \u0027access_mapping\u0027 is None"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the return value of connection.execute().first() is None, an NoneType"},{"line_number":10,"context_line":"error will occur in code \u0027access_mapping[\u0027state\u0027]\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch add the code the filter the NoneType case to avoid the program"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f2577a7_e151f2da","line":9,"range":{"start_line":9,"start_character":61,"end_line":9,"end_character":72},"updated":"2017-09-15 15:11:20.000000000","message":"nit: a NoneType error ...","commit_id":"8dee0d7850bda77fc4e5407482fc3add10759e0d"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"60bdaadbd154d62993eae2a28d796b59f064b8ee","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If the return value of connection.execute().first() is None, an NoneType"},{"line_number":10,"context_line":"error will occur in code \u0027access_mapping[\u0027state\u0027]\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch add the code the filter the NoneType case to avoid the program"},{"line_number":13,"context_line":"throws this exception."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If3700e7a18cbd8ae496b8c503c95cf6723485679"},{"line_number":16,"context_line":"Closes-Bug: 1717392"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f2577a7_e16a127f","line":13,"range":{"start_line":12,"start_character":0,"end_line":13,"end_character":22},"updated":"2017-09-15 15:11:20.000000000","message":"Suggest: This patch adds code to filter the NoneType case and avoid throwing this exception.","commit_id":"8dee0d7850bda77fc4e5407482fc3add10759e0d"},{"author":{"_account_id":25977,"name":"zhiguo.li","email":"zhiguo.lee@foxmail.com","username":"zhiguo.li"},"change_message_id":"e570805f5dc72d4999e0a8afe8ff286277273e1f","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If the return value of connection.execute().first() is None, an NoneType"},{"line_number":10,"context_line":"error will occur in code \u0027access_mapping[\u0027state\u0027]\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch add the code the filter the NoneType case to avoid the program"},{"line_number":13,"context_line":"throws this exception."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If3700e7a18cbd8ae496b8c503c95cf6723485679"},{"line_number":16,"context_line":"Closes-Bug: 1717392"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f2577a7_9b9cc40e","line":13,"range":{"start_line":12,"start_character":0,"end_line":13,"end_character":22},"in_reply_to":"5f2577a7_e16a127f","updated":"2017-09-19 03:26:43.000000000","message":"Thanks you for all your suggestions.","commit_id":"8dee0d7850bda77fc4e5407482fc3add10759e0d"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"e567285b4ed272e2ea9cff67d0322408849720f4","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If the return value of connection.execute().first() is None, a NoneType"},{"line_number":10,"context_line":"error will occur in code \u0027access_mapping[\u0027state\u0027]\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch adds code the filter the NoneType case to avoid throwing"},{"line_number":13,"context_line":"this exception."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If3700e7a18cbd8ae496b8c503c95cf6723485679"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5f2577a7_69b94513","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":44},"updated":"2017-09-18 13:34:45.000000000","message":"This patch adds code to filter the NoneType case ...","commit_id":"8f2ed160070f0a10b54ba9ac3f8186710e06b306"},{"author":{"_account_id":25977,"name":"zhiguo.li","email":"zhiguo.lee@foxmail.com","username":"zhiguo.li"},"change_message_id":"e570805f5dc72d4999e0a8afe8ff286277273e1f","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If the return value of connection.execute().first() is None, a NoneType"},{"line_number":10,"context_line":"error will occur in code \u0027access_mapping[\u0027state\u0027]\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch adds code the filter the NoneType case to avoid throwing"},{"line_number":13,"context_line":"this exception."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If3700e7a18cbd8ae496b8c503c95cf6723485679"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1f2f7f8d_6efeaf06","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":44},"in_reply_to":"5f2577a7_69b94513","updated":"2017-09-19 03:26:43.000000000","message":"Hello,Tom. I have uploaded the data with attachment \"Beginning state of the database.xlsx\". You can refer to #2 comment at https://bugs.launchpad.net/manila/+bug/1717392. Thanks a lot.","commit_id":"8f2ed160070f0a10b54ba9ac3f8186710e06b306"}],"manila/db/migrations/alembic/versions/579c267fbb4d_add_share_instances_access_map.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"6f09a32531800f4357307850c5da7a768f498f67","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                instance_access_table.c.access_id \u003d\u003d access_rule[\u0027id\u0027])"},{"line_number":97,"context_line":"        ).first()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if access_mapping is not None:"},{"line_number":100,"context_line":"            op.execute("},{"line_number":101,"context_line":"                access_table.update().where("},{"line_number":102,"context_line":"                    access_table.c.id \u003d\u003d access_rule[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f2577a7_b8d8a67a","line":99,"range":{"start_line":99,"start_character":8,"end_line":99,"end_character":38},"updated":"2017-09-18 00:11:02.000000000","message":"Reasonable check to add, \n\nHow did you encounter this bug?\nWhat was the beginning state of the database? Did you have shares that were in \"error\" state?","commit_id":"8dee0d7850bda77fc4e5407482fc3add10759e0d"},{"author":{"_account_id":25977,"name":"zhiguo.li","email":"zhiguo.lee@foxmail.com","username":"zhiguo.li"},"change_message_id":"e570805f5dc72d4999e0a8afe8ff286277273e1f","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                instance_access_table.c.access_id \u003d\u003d access_rule[\u0027id\u0027])"},{"line_number":97,"context_line":"        ).first()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if access_mapping is not None:"},{"line_number":100,"context_line":"            op.execute("},{"line_number":101,"context_line":"                access_table.update().where("},{"line_number":102,"context_line":"                    access_table.c.id \u003d\u003d access_rule[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f2577a7_5b053c45","line":99,"range":{"start_line":99,"start_character":8,"end_line":99,"end_character":38},"in_reply_to":"5f2577a7_b8d8a67a","updated":"2017-09-19 03:26:43.000000000","message":"I have uploaded the data. You can refer to #2 comment at https://bugs.launchpad.net/manila/+bug/1717392. Thanks a lot.","commit_id":"8dee0d7850bda77fc4e5407482fc3add10759e0d"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"7071bc5e811f498834fe4ec35c9465bbfde3f562","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    instance_access_table \u003d utils.load_table(\u0027share_instance_access_map\u0027,"},{"line_number":90,"context_line":"                                             connection)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    for access_rule in connection.execute(access_table.select()):"},{"line_number":93,"context_line":"        access_mapping \u003d connection.execute("},{"line_number":94,"context_line":"            instance_access_table.select().where("},{"line_number":95,"context_line":"                instance_access_table.c.deleted \u003d\u003d \"False\").where("},{"line_number":96,"context_line":"                instance_access_table.c.access_id \u003d\u003d access_rule[\u0027id\u0027])"},{"line_number":97,"context_line":"        ).first()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if access_mapping is not None:"},{"line_number":100,"context_line":"            op.execute("}],"source_content_type":"text/x-python","patch_set":3,"id":"bf57530f_42b73688","line":97,"range":{"start_line":92,"start_character":0,"end_line":97,"end_character":17},"updated":"2017-09-20 03:36:47.000000000","message":"Thanks for uploading the Database state to the Launchpad bug:\n\nhttps://bugs.launchpad.net/manila/+bug/1717392\n\nI see where the bug is, this looks like a badly written downgrade, that was not caught by our unit tests. On Line 92, we\u0027re looking through the share_access_map for ANY/ALL rows (don\u0027t care if deleted), while on line 95, we\u0027re looking at Share instance access table rows that are NOT DELETED. That\u0027s a problem! When a share access map entry is deleted, the share instance access map entry will be deleted too! So, our query line 93-97 will return None for every deleted share access mapping.\n\nOuch.\n\nSo, I think we ought to fix this the right way:\n\n  share_access_rules \u003d connection.execute(\n                access_table.select().where(access_table.c.deleted \u003d\u003d \"False\")\n\n  for access_rule in share_access_rules:\n     # Insert lines 93-97..","commit_id":"ed6b1c584a02865325a9c07b375bb5d6dcc05821"},{"author":{"_account_id":25977,"name":"zhiguo.li","email":"zhiguo.lee@foxmail.com","username":"zhiguo.li"},"change_message_id":"252ab5f157faa23e07c77d76652b9ee3bcb959dd","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    instance_access_table \u003d utils.load_table(\u0027share_instance_access_map\u0027,"},{"line_number":90,"context_line":"                                             connection)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    for access_rule in connection.execute(access_table.select()):"},{"line_number":93,"context_line":"        access_mapping \u003d connection.execute("},{"line_number":94,"context_line":"            instance_access_table.select().where("},{"line_number":95,"context_line":"                instance_access_table.c.deleted \u003d\u003d \"False\").where("},{"line_number":96,"context_line":"                instance_access_table.c.access_id \u003d\u003d access_rule[\u0027id\u0027])"},{"line_number":97,"context_line":"        ).first()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if access_mapping is not None:"},{"line_number":100,"context_line":"            op.execute("}],"source_content_type":"text/x-python","patch_set":3,"id":"bf57530f_72d68552","line":97,"range":{"start_line":92,"start_character":0,"end_line":97,"end_character":17},"in_reply_to":"bf57530f_42b73688","updated":"2017-10-23 01:02:56.000000000","message":"Hello, Goutham. Your understanding about the bug is right, and your solution may improve the run time in some cases. Thanks.","commit_id":"ed6b1c584a02865325a9c07b375bb5d6dcc05821"}]}
