)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"17ff576ff44210d8635f987d9aef77b08d7f18c0","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2017-10-25 13:43:43 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"nova-manage cell_v2 verify_instance returns a valid instance mapping"},{"line_number":8,"context_line":"even after the instance is deleted/archived"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"This patch aims at deleting the records of the archived instances"},{"line_number":11,"context_line":"from the instance_mappings table in the API database immediately"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f4b6375_2295a233","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":4},"updated":"2017-10-25 17:26:06.000000000","message":"need to fix this","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"04f31016553ed4148336c9923675d72abed3e8ec","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2017-10-25 13:43:43 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"nova-manage cell_v2 verify_instance returns a valid instance mapping"},{"line_number":8,"context_line":"even after the instance is deleted/archived"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"This patch aims at deleting the records of the archived instances"},{"line_number":11,"context_line":"from the instance_mappings table in the API database immediately"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f4b6375_f65d0879","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":4},"in_reply_to":"3f4b6375_2295a233","updated":"2017-10-25 19:54:41.000000000","message":"Length you mean right? Yeah.","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"668f2e2cff59d9e4ae606e17ee1e63ddec9880d1","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2017-10-25 13:43:43 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"nova-manage cell_v2 verify_instance returns a valid instance mapping"},{"line_number":8,"context_line":"even after the instance is deleted/archived"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"This patch aims at deleting the records of the archived instances"},{"line_number":11,"context_line":"from the instance_mappings table in the API database immediately"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f4b6375_060c2cea","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":4},"in_reply_to":"3f4b6375_f65d0879","updated":"2017-11-02 13:50:04.000000000","message":"Done","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a8677f61225452d41fd10f0c62282bf0736045ee","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Surya Seetharaman \u003csuryaseetharaman.9@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-11-17 16:31:07 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"instance_mapping/request_spec records exist even after the instances are archived"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch aims at deleting the records of the archived instances from"},{"line_number":10,"context_line":"the instance_mappings and request specs tables in the API database"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1f485f77_3ac4a0f4","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":81},"updated":"2017-11-17 16:21:04.000000000","message":"summary lines should be 50 chars or less. How about this instead?\n\n cleanup mapping/reqspec after archive instance","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"578a0c67f754cdb9f94f38d5a0c14f5d269934b1","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Surya Seetharaman \u003csuryaseetharaman.9@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-11-17 16:31:07 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"instance_mapping/request_spec records exist even after the instances are archived"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch aims at deleting the records of the archived instances from"},{"line_number":10,"context_line":"the instance_mappings and request specs tables in the API database"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"ff82abbf_363ec229","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":81},"in_reply_to":"1f485f77_3ac4a0f4","updated":"2017-11-20 21:13:12.000000000","message":"Yes, Will change this, thanks!","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a8677f61225452d41fd10f0c62282bf0736045ee","unresolved":false,"context_lines":[{"line_number":7,"context_line":"instance_mapping/request_spec records exist even after the instances are archived"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch aims at deleting the records of the archived instances from"},{"line_number":10,"context_line":"the instance_mappings and request specs tables in the API database"},{"line_number":11,"context_line":"immediately following their archival from instances to shadow_instances"},{"line_number":12,"context_line":"table. So upon running the \"nova-manage db archive_deleted_rows\" command,"},{"line_number":13,"context_line":"the records of the archived instances will be automatically removed from"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1f485f77_1ab7a488","line":10,"range":{"start_line":10,"start_character":26,"end_line":10,"end_character":39},"updated":"2017-11-17 16:21:04.000000000","message":"request_specs","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"578a0c67f754cdb9f94f38d5a0c14f5d269934b1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"instance_mapping/request_spec records exist even after the instances are archived"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch aims at deleting the records of the archived instances from"},{"line_number":10,"context_line":"the instance_mappings and request specs tables in the API database"},{"line_number":11,"context_line":"immediately following their archival from instances to shadow_instances"},{"line_number":12,"context_line":"table. So upon running the \"nova-manage db archive_deleted_rows\" command,"},{"line_number":13,"context_line":"the records of the archived instances will be automatically removed from"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"ff82abbf_f647fabb","line":10,"range":{"start_line":10,"start_character":26,"end_line":10,"end_character":39},"in_reply_to":"1f485f77_1ab7a488","updated":"2017-11-20 21:13:12.000000000","message":"Will change this.","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"}],"doc/source/cli/nova-manage.rst":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a8677f61225452d41fd10f0c62282bf0736045ee","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    mapping is missing (see the ``map_cell_and_hosts`` command if you are"},{"line_number":174,"context_line":"    upgrading from a cells v1 environment, and the ``simple_cell_setup`` if"},{"line_number":175,"context_line":"    you are upgrading from a non-cells v1 environment), 3 if it is a deleted"},{"line_number":176,"context_line":"    instance which has instance mapping , and 4 if it is an archived instance"},{"line_number":177,"context_line":"    which still has an instance mapping."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"``nova-manage cell_v2 create_cell [--name \u003ccell_name\u003e] [--transport-url \u003ctransport_url\u003e] [--database_connection \u003cdatabase_connection\u003e] [--verbose]``"}],"source_content_type":"text/x-rst","patch_set":6,"id":"1f485f77_fa6e08fe","line":176,"range":{"start_line":176,"start_character":39,"end_line":176,"end_character":40},"updated":"2017-11-17 16:21:04.000000000","message":"empty space here for some reason.","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"578a0c67f754cdb9f94f38d5a0c14f5d269934b1","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    mapping is missing (see the ``map_cell_and_hosts`` command if you are"},{"line_number":174,"context_line":"    upgrading from a cells v1 environment, and the ``simple_cell_setup`` if"},{"line_number":175,"context_line":"    you are upgrading from a non-cells v1 environment), 3 if it is a deleted"},{"line_number":176,"context_line":"    instance which has instance mapping , and 4 if it is an archived instance"},{"line_number":177,"context_line":"    which still has an instance mapping."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"``nova-manage cell_v2 create_cell [--name \u003ccell_name\u003e] [--transport-url \u003ctransport_url\u003e] [--database_connection \u003cdatabase_connection\u003e] [--verbose]``"}],"source_content_type":"text/x-rst","patch_set":6,"id":"1f485f77_bde40a0e","line":176,"range":{"start_line":176,"start_character":39,"end_line":176,"end_character":40},"in_reply_to":"1f485f77_fa6e08fe","updated":"2017-11-20 21:13:12.000000000","message":"My bad,","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"}],"nova/cmd/manage.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f245ebcc30ace76c3fc8318662bced236dd43b7","unresolved":false,"context_lines":[{"line_number":790,"context_line":"                for uuid in deleted_instance_uuids:"},{"line_number":791,"context_line":"                    instance_mapping \u003d objects.InstanceMapping.\\"},{"line_number":792,"context_line":"                        get_by_instance_uuid(ctxt, uuid)"},{"line_number":793,"context_line":"                    instance_mapping.destroy()"},{"line_number":794,"context_line":"                    table_to_rows_archived[\u0027instance_mappings\u0027] +\u003d 1"},{"line_number":795,"context_line":"                    request_spec \u003d objects.RequestSpec.\\"},{"line_number":796,"context_line":"                        get_by_instance_uuid(ctxt, uuid)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_f2445a1d","line":793,"updated":"2017-11-14 15:33:06.000000000","message":"Any reason not to just add a bulk-delete method to InstanceMapping that takes the list of uuids? That would be a lot faster I think.","commit_id":"18535336970dfa59b7637ca2885f07f431126ef2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f245ebcc30ace76c3fc8318662bced236dd43b7","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                    table_to_rows_archived[\u0027instance_mappings\u0027] +\u003d 1"},{"line_number":795,"context_line":"                    request_spec \u003d objects.RequestSpec.\\"},{"line_number":796,"context_line":"                        get_by_instance_uuid(ctxt, uuid)"},{"line_number":797,"context_line":"                    request_spec.destroy()"},{"line_number":798,"context_line":"                    table_to_rows_archived[\u0027request_specs\u0027] +\u003d 1"},{"line_number":799,"context_line":"            if not until_complete:"},{"line_number":800,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_d24b9e28","line":797,"updated":"2017-11-14 15:33:06.000000000","message":"Same here.","commit_id":"18535336970dfa59b7637ca2885f07f431126ef2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f245ebcc30ace76c3fc8318662bced236dd43b7","unresolved":false,"context_lines":[{"line_number":1634,"context_line":"        else:"},{"line_number":1635,"context_line":"            with context.target_cell(ctxt, mapping.cell_mapping) as cctxt:"},{"line_number":1636,"context_line":"                try:"},{"line_number":1637,"context_line":"                    objects.Instance.get_by_uuid(cctxt, uuid)"},{"line_number":1638,"context_line":"                except exception.InstanceNotFound:"},{"line_number":1639,"context_line":"                    say(\u0027The instance with uuid %s has been deleted.\u0027"},{"line_number":1640,"context_line":"                        % uuid)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_12101601","line":1637,"updated":"2017-11-14 15:33:06.000000000","message":"How about we use a read_deleted\u003dyes context here and differentiate between deleted\u003dN (deleted in the cell, ready for archive) and InstanceNotFound which means that the instance has been archived but we missed deleting the mapping?\n\nRight now if someone has archived an instance already, they will still have an InstanceMapping for it. Thus, this command will tell them to run archive_deleted_rows to clean that up, but will never clear the condition.","commit_id":"18535336970dfa59b7637ca2885f07f431126ef2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a8677f61225452d41fd10f0c62282bf0736045ee","unresolved":false,"context_lines":[{"line_number":1632,"context_line":"        else:"},{"line_number":1633,"context_line":"            with context.target_cell(ctxt, mapping.cell_mapping) as cctxt:"},{"line_number":1634,"context_line":"                try:"},{"line_number":1635,"context_line":"                    instance \u003d objects.Instance.get_by_uuid(cctxt.elevated("},{"line_number":1636,"context_line":"                                                read_deleted\u003d\u0027yes\u0027), uuid)"},{"line_number":1637,"context_line":"                    if instance:"},{"line_number":1638,"context_line":"                        say(\u0027The instance with uuid %s has been deleted.\u0027"},{"line_number":1639,"context_line":"                            % uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_da10ec59","line":1636,"range":{"start_line":1635,"start_character":20,"end_line":1636,"end_character":74},"updated":"2017-11-17 16:21:04.000000000","message":"just a little style nit... the above would be easier to read like so:\n\n el_ctx \u003d cctxt.elevated(read_deleted\u003d\u0027yes\u0027)\n instance \u003d objects.Instance.get_by_uuid(el_ctx, uuid)","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"578a0c67f754cdb9f94f38d5a0c14f5d269934b1","unresolved":false,"context_lines":[{"line_number":1632,"context_line":"        else:"},{"line_number":1633,"context_line":"            with context.target_cell(ctxt, mapping.cell_mapping) as cctxt:"},{"line_number":1634,"context_line":"                try:"},{"line_number":1635,"context_line":"                    instance \u003d objects.Instance.get_by_uuid(cctxt.elevated("},{"line_number":1636,"context_line":"                                                read_deleted\u003d\u0027yes\u0027), uuid)"},{"line_number":1637,"context_line":"                    if instance:"},{"line_number":1638,"context_line":"                        say(\u0027The instance with uuid %s has been deleted.\u0027"},{"line_number":1639,"context_line":"                            % uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_ddd22628","line":1636,"range":{"start_line":1635,"start_character":20,"end_line":1636,"end_character":74},"in_reply_to":"1f485f77_da10ec59","updated":"2017-11-20 21:13:12.000000000","message":"Will do,","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"04f31016553ed4148336c9923675d72abed3e8ec","unresolved":false,"context_lines":[{"line_number":66,"context_line":"from nova.compute import vm_states"},{"line_number":67,"context_line":"import nova.conf"},{"line_number":68,"context_line":"import nova.context"},{"line_number":69,"context_line":"from nova.db.sqlalchemy import api_models"},{"line_number":70,"context_line":"from nova.db.sqlalchemy import models"},{"line_number":71,"context_line":"from nova import exception"},{"line_number":72,"context_line":"from nova.i18n import _"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_16342449","line":69,"updated":"2017-10-25 19:54:41.000000000","message":"This is kinda ugly because it\u0027s importing schema from one database to the api for another :/","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"668f2e2cff59d9e4ae606e17ee1e63ddec9880d1","unresolved":false,"context_lines":[{"line_number":66,"context_line":"from nova.compute import vm_states"},{"line_number":67,"context_line":"import nova.conf"},{"line_number":68,"context_line":"import nova.context"},{"line_number":69,"context_line":"from nova.db.sqlalchemy import api_models"},{"line_number":70,"context_line":"from nova.db.sqlalchemy import models"},{"line_number":71,"context_line":"from nova import exception"},{"line_number":72,"context_line":"from nova.i18n import _"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_86513cdc","line":69,"in_reply_to":"3f4b6375_16342449","updated":"2017-11-02 13:50:04.000000000","message":"Fixed this.","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"04f31016553ed4148336c9923675d72abed3e8ec","unresolved":false,"context_lines":[{"line_number":6582,"context_line":"                where(table.c.deleted !\u003d table.c.deleted.default.arg).\\"},{"line_number":6583,"context_line":"                order_by(column).limit(max_rows)"},{"line_number":6584,"context_line":"        result_select \u003d conn.execute(deleted_instances)"},{"line_number":6585,"context_line":"        rows \u003d result_select.fetchall()"},{"line_number":6586,"context_line":""},{"line_number":6587,"context_line":"    try:"},{"line_number":6588,"context_line":"        # Group the insert and delete in a transaction."}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_d6fc4c71","line":6585,"updated":"2017-10-25 19:54:41.000000000","message":"We have to be absolutely sure that this group matches the things we\u0027re going to delete below, right? Otherwise we\u0027ll destroy mappings for things we didn\u0027t archive. Maybe we could re-use the query_delete from above?","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"668f2e2cff59d9e4ae606e17ee1e63ddec9880d1","unresolved":false,"context_lines":[{"line_number":6582,"context_line":"                where(table.c.deleted !\u003d table.c.deleted.default.arg).\\"},{"line_number":6583,"context_line":"                order_by(column).limit(max_rows)"},{"line_number":6584,"context_line":"        result_select \u003d conn.execute(deleted_instances)"},{"line_number":6585,"context_line":"        rows \u003d result_select.fetchall()"},{"line_number":6586,"context_line":""},{"line_number":6587,"context_line":"    try:"},{"line_number":6588,"context_line":"        # Group the insert and delete in a transaction."}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_266608c3","line":6585,"in_reply_to":"3f4b6375_d6fc4c71","updated":"2017-11-02 13:50:04.000000000","message":"Done","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"04f31016553ed4148336c9923675d72abed3e8ec","unresolved":false,"context_lines":[{"line_number":6616,"context_line":"                delete_statement \u003d DeleteFromSelect(instance_mappings,"},{"line_number":6617,"context_line":"                        instance_mapping, instance_mappings.c.instance_uuid)"},{"line_number":6618,"context_line":"                result_delete \u003d conn.execute(delete_statement)"},{"line_number":6619,"context_line":"        conn.close()"},{"line_number":6620,"context_line":""},{"line_number":6621,"context_line":"    if ((max_rows is None or rows_archived \u003c max_rows)"},{"line_number":6622,"context_line":"            and \u0027instance_uuid\u0027 in columns):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_b66af016","line":6619,"updated":"2017-10-25 19:54:41.000000000","message":"This too is somewhat of a layering violation. I was kinda thinking we\u0027d return a list of archived uuids from this method up to nova-manage and then have it go and nuke the mappings.","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"668f2e2cff59d9e4ae606e17ee1e63ddec9880d1","unresolved":false,"context_lines":[{"line_number":6616,"context_line":"                delete_statement \u003d DeleteFromSelect(instance_mappings,"},{"line_number":6617,"context_line":"                        instance_mapping, instance_mappings.c.instance_uuid)"},{"line_number":6618,"context_line":"                result_delete \u003d conn.execute(delete_statement)"},{"line_number":6619,"context_line":"        conn.close()"},{"line_number":6620,"context_line":""},{"line_number":6621,"context_line":"    if ((max_rows is None or rows_archived \u003c max_rows)"},{"line_number":6622,"context_line":"            and \u0027instance_uuid\u0027 in columns):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_a671d878","line":6619,"in_reply_to":"3f4b6375_b66af016","updated":"2017-11-02 13:50:04.000000000","message":"Done","commit_id":"3c21709ab637e77e252a8262a0cfba1515c71021"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9f245ebcc30ace76c3fc8318662bced236dd43b7","unresolved":false,"context_lines":[{"line_number":6588,"context_line":""},{"line_number":6589,"context_line":"    try:"},{"line_number":6590,"context_line":"        # Group the insert and delete in a transaction."},{"line_number":6591,"context_line":"        with conn.begin():"},{"line_number":6592,"context_line":"            conn.execute(insert)"},{"line_number":6593,"context_line":"            result_delete \u003d conn.execute(delete_statement)"},{"line_number":6594,"context_line":"        rows_archived \u003d result_delete.rowcount"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_b29ee251","line":6591,"updated":"2017-11-14 15:33:06.000000000","message":"Since this is the beginning of the transaction, couldn\u0027t we end up with a different list of uuids in the list than what we actually deleted? Maybe for the instances table we should delete from the list we collected first instead of running the normal delete_statement ?\n\nMaybe we should see if Jay has any SQL tricks for getting the result of a delete statement or something.","commit_id":"18535336970dfa59b7637ca2885f07f431126ef2"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"318fd991baeaf3b2bf85296902b609aa996ded52","unresolved":false,"context_lines":[{"line_number":6588,"context_line":""},{"line_number":6589,"context_line":"    try:"},{"line_number":6590,"context_line":"        # Group the insert and delete in a transaction."},{"line_number":6591,"context_line":"        with conn.begin():"},{"line_number":6592,"context_line":"            conn.execute(insert)"},{"line_number":6593,"context_line":"            result_delete \u003d conn.execute(delete_statement)"},{"line_number":6594,"context_line":"        rows_archived \u003d result_delete.rowcount"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_9578702a","line":6591,"in_reply_to":"1f485f77_b29ee251","updated":"2017-11-14 16:06:57.000000000","message":"Yes, you are right about the integrity issue with regards to us ending up with a different list of uuids than what we actually deleted, the same problem also exists between the list of records inserted into the shadow tables and the list archived - we had a bug reported ; https://bugs.launchpad.net/nova/+bug/1727266\n\nMaybe we need to first query for the list of records whose deleted flag is set; use that list to insert into the shadow tables, archive from the actual tables and also return the same list for deleting the instance_mappings and request specs ?","commit_id":"18535336970dfa59b7637ca2885f07f431126ef2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8a8a86178ab76fcf24426c24fea3159b2ea42555","unresolved":false,"context_lines":[{"line_number":6612,"context_line":"        rows_archived +\u003d extra"},{"line_number":6613,"context_line":""},{"line_number":6614,"context_line":"    if tablename \u003d\u003d \"instances\":"},{"line_number":6615,"context_line":"        return rows_archived, deleted_instance_uuids"},{"line_number":6616,"context_line":"    return rows_archived"},{"line_number":6617,"context_line":""},{"line_number":6618,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_1d057514","line":6615,"updated":"2017-11-16 22:09:28.000000000","message":"It\u0027s rather icky to have a different return type here depending on the table name. How about always returning an empty list and matching tuple for the else case here?","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"32dab6c720363cc2db835698e43c2d22db07d66c","unresolved":false,"context_lines":[{"line_number":6612,"context_line":"        rows_archived +\u003d extra"},{"line_number":6613,"context_line":""},{"line_number":6614,"context_line":"    if tablename \u003d\u003d \"instances\":"},{"line_number":6615,"context_line":"        return rows_archived, deleted_instance_uuids"},{"line_number":6616,"context_line":"    return rows_archived"},{"line_number":6617,"context_line":""},{"line_number":6618,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_f5b98078","line":6615,"in_reply_to":"1f485f77_1d057514","updated":"2017-11-17 15:35:00.000000000","message":"Done","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8a8a86178ab76fcf24426c24fea3159b2ea42555","unresolved":false,"context_lines":[{"line_number":6652,"context_line":"                tablename, max_rows\u003dmax_rows - total_rows_archived)"},{"line_number":6653,"context_line":"        else:"},{"line_number":6654,"context_line":"            rows_archived \u003d _archive_deleted_rows_for_table("},{"line_number":6655,"context_line":"                tablename, max_rows\u003dmax_rows - total_rows_archived)"},{"line_number":6656,"context_line":"        total_rows_archived +\u003d rows_archived"},{"line_number":6657,"context_line":"        # Only report results for tables that had updates."},{"line_number":6658,"context_line":"        if rows_archived:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_b8054f13","line":6655,"updated":"2017-11-16 22:09:28.000000000","message":"That way we won\u0027t need this conditional.","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"32dab6c720363cc2db835698e43c2d22db07d66c","unresolved":false,"context_lines":[{"line_number":6652,"context_line":"                tablename, max_rows\u003dmax_rows - total_rows_archived)"},{"line_number":6653,"context_line":"        else:"},{"line_number":6654,"context_line":"            rows_archived \u003d _archive_deleted_rows_for_table("},{"line_number":6655,"context_line":"                tablename, max_rows\u003dmax_rows - total_rows_archived)"},{"line_number":6656,"context_line":"        total_rows_archived +\u003d rows_archived"},{"line_number":6657,"context_line":"        # Only report results for tables that had updates."},{"line_number":6658,"context_line":"        if rows_archived:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_35c4b8f4","line":6655,"in_reply_to":"1f485f77_b8054f13","updated":"2017-11-17 15:35:00.000000000","message":"Done","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a8677f61225452d41fd10f0c62282bf0736045ee","unresolved":false,"context_lines":[{"line_number":6495,"context_line":"        return 0"},{"line_number":6496,"context_line":""},{"line_number":6497,"context_line":""},{"line_number":6498,"context_line":"def _archive_deleted_rows_for_table(tablename, max_rows):"},{"line_number":6499,"context_line":"    \"\"\"Move up to max_rows rows from one tables to the corresponding"},{"line_number":6500,"context_line":"    shadow table."},{"line_number":6501,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_1d59defc","line":6498,"range":{"start_line":6498,"start_character":0,"end_line":6498,"end_character":35},"updated":"2017-11-17 16:21:04.000000000","message":"ugh, this method is crazy long, overly-complicated due to the genericness it\u0027s trying to achieve... but, not for you to fix in this particular patch. :)","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"578a0c67f754cdb9f94f38d5a0c14f5d269934b1","unresolved":false,"context_lines":[{"line_number":6495,"context_line":"        return 0"},{"line_number":6496,"context_line":""},{"line_number":6497,"context_line":""},{"line_number":6498,"context_line":"def _archive_deleted_rows_for_table(tablename, max_rows):"},{"line_number":6499,"context_line":"    \"\"\"Move up to max_rows rows from one tables to the corresponding"},{"line_number":6500,"context_line":"    shadow table."},{"line_number":6501,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_fd5de278","line":6498,"range":{"start_line":6498,"start_character":0,"end_line":6498,"end_character":35},"in_reply_to":"1f485f77_1d59defc","updated":"2017-11-20 21:13:12.000000000","message":"oh okay,,:D","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a8677f61225452d41fd10f0c62282bf0736045ee","unresolved":false,"context_lines":[{"line_number":6582,"context_line":"        rows \u003d conn.execute(query_delete).fetchall()"},{"line_number":6583,"context_line":"        for row in rows:"},{"line_number":6584,"context_line":"            instance_id \u003d row[\u0027id\u0027]"},{"line_number":6585,"context_line":"            [(uuid, ), ] \u003d conn.execute(sql.select([table.c.uuid])."},{"line_number":6586,"context_line":"                        where(table.c.id \u003d\u003d instance_id)).fetchall()"},{"line_number":6587,"context_line":"            deleted_instance_uuids.append(uuid)"},{"line_number":6588,"context_line":""},{"line_number":6589,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_1da43e07","line":6586,"range":{"start_line":6585,"start_character":12,"end_line":6586,"end_character":68},"updated":"2017-11-17 16:21:04.000000000","message":"there\u0027s no need to do N queries like this (one for each instance ID returned in the query_delete result). Instead, simply add a column to the query_delete selection:\n\n query_delete \u003d query_delete.select([table.c.id, table.c.uuid])\n\nand then grab the deleted instance UUIDs all at once:\n\n rows \u003d conn.execute(query_delete).fetchall()\n deleted_instance_uuids \u003d [r[1] for r in rows]","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"578a0c67f754cdb9f94f38d5a0c14f5d269934b1","unresolved":false,"context_lines":[{"line_number":6582,"context_line":"        rows \u003d conn.execute(query_delete).fetchall()"},{"line_number":6583,"context_line":"        for row in rows:"},{"line_number":6584,"context_line":"            instance_id \u003d row[\u0027id\u0027]"},{"line_number":6585,"context_line":"            [(uuid, ), ] \u003d conn.execute(sql.select([table.c.uuid])."},{"line_number":6586,"context_line":"                        where(table.c.id \u003d\u003d instance_id)).fetchall()"},{"line_number":6587,"context_line":"            deleted_instance_uuids.append(uuid)"},{"line_number":6588,"context_line":""},{"line_number":6589,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_5d099693","line":6586,"range":{"start_line":6585,"start_character":12,"end_line":6586,"end_character":68},"in_reply_to":"1f485f77_1da43e07","updated":"2017-11-20 21:13:12.000000000","message":"Thank you very much for this pointer, I was myself looking for a simpler way to do this by reusing the above query_delete. :) .\n\nHowever \"query_delete \u003d query_delete.select([table.c.id, table.c.uuid])\" - this sql statement gives me an error, I am looking into the sql alchemy documentation to see how I can do this exactly.","commit_id":"b9311518c98ffe930b570a0142e23da11996fb8c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80670641d0cfd1709fe1eab937e14f94e0409678","unresolved":false,"context_lines":[{"line_number":6579,"context_line":"    # the instances table. Basically the uuids of the archived instances"},{"line_number":6580,"context_line":"    # are queried and returned."},{"line_number":6581,"context_line":"    if tablename \u003d\u003d \"instances\":"},{"line_number":6582,"context_line":"        query_delete \u003d query_delete.column(table.c.uuid)"},{"line_number":6583,"context_line":"        rows \u003d conn.execute(query_delete).fetchall()"},{"line_number":6584,"context_line":"        deleted_instance_uuids \u003d [r[1] for r in rows]"},{"line_number":6585,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_0ac334ef","line":6582,"range":{"start_line":6582,"start_character":23,"end_line":6582,"end_character":56},"updated":"2017-11-21 15:44:55.000000000","message":"ah, yes, that\u0027s the way to update the column projections in the query. good work. :)","commit_id":"32fd58813f8247641a6b574b5f01528b29d48b76"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"09af49692757dbafb810761fc21321a2e3f7f26d","unresolved":false,"context_lines":[{"line_number":6587,"context_line":"        # Group the insert and delete in a transaction."},{"line_number":6588,"context_line":"        with conn.begin():"},{"line_number":6589,"context_line":"            conn.execute(insert)"},{"line_number":6590,"context_line":"            if tablename \u003d\u003d \"instances\":"},{"line_number":6591,"context_line":"                delete_statement \u003d table.delete().where(table.c.uuid.in_("},{"line_number":6592,"context_line":"                                                deleted_instance_uuids))"},{"line_number":6593,"context_line":"            result_delete \u003d conn.execute(delete_statement)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_e0738ce6","line":6590,"updated":"2017-11-21 17:38:48.000000000","message":"We could probably dispense with this line and just update delete_statement after L6584 right?","commit_id":"32fd58813f8247641a6b574b5f01528b29d48b76"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"498d4d463ec287753606ad4ddee9b36ccc502795","unresolved":false,"context_lines":[{"line_number":6587,"context_line":"        # Group the insert and delete in a transaction."},{"line_number":6588,"context_line":"        with conn.begin():"},{"line_number":6589,"context_line":"            conn.execute(insert)"},{"line_number":6590,"context_line":"            if tablename \u003d\u003d \"instances\":"},{"line_number":6591,"context_line":"                delete_statement \u003d table.delete().where(table.c.uuid.in_("},{"line_number":6592,"context_line":"                                                deleted_instance_uuids))"},{"line_number":6593,"context_line":"            result_delete \u003d conn.execute(delete_statement)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_c921d0b6","line":6590,"in_reply_to":"ff82abbf_e0738ce6","updated":"2017-11-21 21:30:28.000000000","message":"Oh yes, I ended up putting an additional \"if\" for no reason, sorry! Anyways I have this atomicity bug - https://bugs.launchpad.net/nova/+bug/1727266 during which I will also clean this up,","commit_id":"32fd58813f8247641a6b574b5f01528b29d48b76"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"09af49692757dbafb810761fc21321a2e3f7f26d","unresolved":false,"context_lines":[{"line_number":6642,"context_line":"                tablename.startswith(_SHADOW_TABLE_PREFIX)):"},{"line_number":6643,"context_line":"            continue"},{"line_number":6644,"context_line":"        rows_archived,\\"},{"line_number":6645,"context_line":"        deleted_instance_uuid \u003d _archive_deleted_rows_for_table("},{"line_number":6646,"context_line":"                tablename, max_rows\u003dmax_rows - total_rows_archived)"},{"line_number":6647,"context_line":"        total_rows_archived +\u003d rows_archived"},{"line_number":6648,"context_line":"        if tablename \u003d\u003d \u0027instances\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_0046b07d","line":6645,"updated":"2017-11-21 17:38:48.000000000","message":"I think this backslash continuation is not very nova-y in terms of style. However, this file is a disaster of such things, so I\u0027ll let it slide :)","commit_id":"32fd58813f8247641a6b574b5f01528b29d48b76"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"498d4d463ec287753606ad4ddee9b36ccc502795","unresolved":false,"context_lines":[{"line_number":6642,"context_line":"                tablename.startswith(_SHADOW_TABLE_PREFIX)):"},{"line_number":6643,"context_line":"            continue"},{"line_number":6644,"context_line":"        rows_archived,\\"},{"line_number":6645,"context_line":"        deleted_instance_uuid \u003d _archive_deleted_rows_for_table("},{"line_number":6646,"context_line":"                tablename, max_rows\u003dmax_rows - total_rows_archived)"},{"line_number":6647,"context_line":"        total_rows_archived +\u003d rows_archived"},{"line_number":6648,"context_line":"        if tablename \u003d\u003d \u0027instances\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_ac3b3acf","line":6645,"in_reply_to":"ff82abbf_0046b07d","updated":"2017-11-21 21:30:28.000000000","message":"Yea , maybe I can try to clean up the file once more when I deal with the atomicity bug.","commit_id":"32fd58813f8247641a6b574b5f01528b29d48b76"}],"nova/objects/instance_mapping.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8a8a86178ab76fcf24426c24fea3159b2ea42555","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                delete(synchronize_session\u003dFalse)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    @classmethod"},{"line_number":142,"context_line":"    def destroy_bulk(cls, context, instance_uuids):"},{"line_number":143,"context_line":"        return cls._destroy_bulk_in_db(context, instance_uuids)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_9806131c","line":142,"updated":"2017-11-16 22:09:28.000000000","message":"This should probably be on InstanceMappingList at least","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"32dab6c720363cc2db835698e43c2d22db07d66c","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                delete(synchronize_session\u003dFalse)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    @classmethod"},{"line_number":142,"context_line":"    def destroy_bulk(cls, context, instance_uuids):"},{"line_number":143,"context_line":"        return cls._destroy_bulk_in_db(context, instance_uuids)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_f5474076","line":142,"in_reply_to":"1f485f77_9806131c","updated":"2017-11-17 15:35:00.000000000","message":"Done","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"}],"nova/objects/request_spec.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8a8a86178ab76fcf24426c24fea3159b2ea42555","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                delete(synchronize_session\u003dFalse)"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":"    @classmethod"},{"line_number":530,"context_line":"    def destroy_bulk(cls, context, instance_uuids):"},{"line_number":531,"context_line":"        return cls._destroy_bulk_in_db(context, instance_uuids)"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"    def reset_forced_destinations(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_58141b44","line":530,"updated":"2017-11-16 22:09:28.000000000","message":"We don\u0027t have a RequestSpecList, so this is the best place I suppose.","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"32dab6c720363cc2db835698e43c2d22db07d66c","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                delete(synchronize_session\u003dFalse)"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":"    @classmethod"},{"line_number":530,"context_line":"    def destroy_bulk(cls, context, instance_uuids):"},{"line_number":531,"context_line":"        return cls._destroy_bulk_in_db(context, instance_uuids)"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"    def reset_forced_destinations(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f485f77_d5b44482","line":530,"in_reply_to":"1f485f77_58141b44","updated":"2017-11-17 15:35:00.000000000","message":"Yup,","commit_id":"997f1025b17e6401504e1dc178449bd4fab103da"}]}
