)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f4a7811ff75acfd04c3c0abec910b22253931c55","unresolved":false,"context_lines":[{"line_number":17,"context_line":"the api_db and then archieve rows across all cells."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Id16c3d91d9ce5db9ffd125b59fffbfedf4a6843d"},{"line_number":20,"context_line":"closes-bugs: #1719487"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3f4b6375_c6f09e6a","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":6},"updated":"2017-10-20 10:10:24.000000000","message":"Closes  \u003d\u003d\u003e to update bugzilla","commit_id":"7dd868618d7f202a62923661d6283b567b691713"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f128cdac3c9645e848f231b883fea48eb380074f","unresolved":false,"context_lines":[{"line_number":17,"context_line":"the api_db and then archieve rows across all cells."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Id16c3d91d9ce5db9ffd125b59fffbfedf4a6843d"},{"line_number":20,"context_line":"closes-bugs: #1719487"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3f4b6375_29518263","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":6},"in_reply_to":"3f4b6375_c6f09e6a","updated":"2017-10-20 12:55:53.000000000","message":"Should be:\n\nCloses-Bug: #1719487","commit_id":"7dd868618d7f202a62923661d6283b567b691713"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"983f5f570c2dc1426af002d66f90330ca37fd633","unresolved":false,"context_lines":[{"line_number":12,"context_line":"And the command can only archive rows in cell0 DB as"},{"line_number":13,"context_line":"it only reads the nova.conf"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch added codes that provides --all-cells parameter"},{"line_number":16,"context_line":"to the command and read info for all cells from"},{"line_number":17,"context_line":"the api_db and then archieve rows across all cells."},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"ff82abbf_4de25aa2","line":15,"range":{"start_line":15,"start_character":21,"end_line":15,"end_character":22},"updated":"2017-11-24 15:28:22.000000000","message":"code","commit_id":"4a26cf998b2b6c1e1419898b3d8e5fabfd02279d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"983f5f570c2dc1426af002d66f90330ca37fd633","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch added codes that provides --all-cells parameter"},{"line_number":16,"context_line":"to the command and read info for all cells from"},{"line_number":17,"context_line":"the api_db and then archieve rows across all cells."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Id16c3d91d9ce5db9ffd125b59fffbfedf4a6843d"},{"line_number":20,"context_line":"closes-bugs: #1719487"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"ff82abbf_add9a6f3","line":17,"range":{"start_line":17,"start_character":20,"end_line":17,"end_character":28},"updated":"2017-11-24 15:28:22.000000000","message":"nit: archive","commit_id":"4a26cf998b2b6c1e1419898b3d8e5fabfd02279d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"983f5f570c2dc1426af002d66f90330ca37fd633","unresolved":false,"context_lines":[{"line_number":17,"context_line":"the api_db and then archieve rows across all cells."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Id16c3d91d9ce5db9ffd125b59fffbfedf4a6843d"},{"line_number":20,"context_line":"closes-bugs: #1719487"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"ff82abbf_4d749afe","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":21},"updated":"2017-11-24 15:28:22.000000000","message":"It should be Closes-Bug:","commit_id":"4a26cf998b2b6c1e1419898b3d8e5fabfd02279d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4348223041c68cba6fbbcfe6f3c20355b866745a","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The archive_deleted_rows cmd depend on DB connection"},{"line_number":10,"context_line":"config from config file, and when applying super-conductor"},{"line_number":11,"context_line":"mode, there are serval config files for different cells."},{"line_number":12,"context_line":"And the command can only archive rows in cell0 DB as"},{"line_number":13,"context_line":"it only reads the nova.conf"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"3fa0c359_12a2b19b","line":11,"range":{"start_line":11,"start_character":16,"end_line":11,"end_character":22},"updated":"2018-02-05 10:15:32.000000000","message":"several","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"2f2af97168eb2934ef62a35825869117be8e27b3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The archive_deleted_rows cmd depend on DB connection"},{"line_number":10,"context_line":"config from config file, and when applying super-conductor"},{"line_number":11,"context_line":"mode, there are serval config files for different cells."},{"line_number":12,"context_line":"And the command can only archive rows in cell0 DB as"},{"line_number":13,"context_line":"it only reads the nova.conf"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"3fa0c359_2dc8b253","line":11,"range":{"start_line":11,"start_character":16,"end_line":11,"end_character":22},"in_reply_to":"3fa0c359_12a2b19b","updated":"2018-02-05 10:54:26.000000000","message":"Done","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4348223041c68cba6fbbcfe6f3c20355b866745a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"The archive_deleted_rows cmd depend on DB connection"},{"line_number":10,"context_line":"config from config file, and when applying super-conductor"},{"line_number":11,"context_line":"mode, there are serval config files for different cells."},{"line_number":12,"context_line":"And the command can only archive rows in cell0 DB as"},{"line_number":13,"context_line":"it only reads the nova.conf"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch added code that provides --all-cells parameter"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"3fa0c359_52b119e1","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":3},"updated":"2018-02-05 10:15:32.000000000","message":"If so,","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"2f2af97168eb2934ef62a35825869117be8e27b3","unresolved":false,"context_lines":[{"line_number":9,"context_line":"The archive_deleted_rows cmd depend on DB connection"},{"line_number":10,"context_line":"config from config file, and when applying super-conductor"},{"line_number":11,"context_line":"mode, there are serval config files for different cells."},{"line_number":12,"context_line":"And the command can only archive rows in cell0 DB as"},{"line_number":13,"context_line":"it only reads the nova.conf"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch added code that provides --all-cells parameter"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"3fa0c359_edc16a30","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":3},"in_reply_to":"3fa0c359_52b119e1","updated":"2018-02-05 10:54:26.000000000","message":"Done","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":7,"context_line":"nova-manage db archive_deleted_rows is not multi-cell aware"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The archive_deleted_rows cmd depend on DB connection"},{"line_number":10,"context_line":"config from config file, and when applying super-conductor"},{"line_number":11,"context_line":"mode, there are several config files for different cells."},{"line_number":12,"context_line":"If so, the command can only archive rows in cell0 DB as"},{"line_number":13,"context_line":"it only reads the nova.conf"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":60,"id":"dfbec78f_da061a87","line":11,"range":{"start_line":10,"start_character":43,"end_line":11,"end_character":4},"updated":"2019-05-10 13:18:30.000000000","message":"okay you mean when running from the global service nodes like nova-api.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":12,"context_line":"If so, the command can only archive rows in cell0 DB as"},{"line_number":13,"context_line":"it only reads the nova.conf"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch added code that provides --all-cells parameter"},{"line_number":16,"context_line":"to the command and read info for all cells from"},{"line_number":17,"context_line":"the api_db and then archive rows across all cells."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Id16c3d91d9ce5db9ffd125b59fffbfedf4a6843d"},{"line_number":20,"context_line":"Closes-Bug: #1719487"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":60,"id":"dfbec78f_1a5a724e","line":17,"range":{"start_line":15,"start_character":0,"end_line":17,"end_character":49},"updated":"2019-05-10 13:18:30.000000000","message":"While I agree this is an overkill for large deployments to iterate over all cells in one go, I also think its a good idea to have this all-cells feature from my past experience of maintaining this tool\u0027s cron job because when running it from all the individual cells in case two cron jobs happen to run simultaneously in any cells only one of the cron jobs gets the lock on the api_database to delete the instance_mappings/request_specs/instance_group_members. This means the cell which didn\u0027t get the lock would have already reaped the cell level rows leaving behind orphaned records in the api_database. Anyways this is a different problem because I added a bulk destroy instead of doing them one by one. I have opened a bug 1828535 for this, but this feature can also help overcome that bug if all the cells are visited in a loop.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe155cf1312cd8b53d2868ef94fefa9b54a297ec","unresolved":false,"context_lines":[{"line_number":15,"context_line":"This patch added code that provides --all-cells parameter"},{"line_number":16,"context_line":"to the command and read info for all cells from"},{"line_number":17,"context_line":"the api_db and then archive rows across all cells."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Id16c3d91d9ce5db9ffd125b59fffbfedf4a6843d"},{"line_number":20,"context_line":"Closes-Bug: #1719487"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":67,"id":"7faddb67_c00ed4e2","line":18,"updated":"2019-08-20 14:50:14.000000000","message":"I think at this point you should definitely have this in here:\n\nCo-Authored-By: melanie witt \u003cmelwittt@gmail.com\u003e","commit_id":"a571313928ec7e005ff39d896383e25e7a5c9bc9"}],"doc/source/cli/nova-manage.rst":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"220198f9b229fc10bc44d7131daa93f78660fbcd","unresolved":false,"context_lines":[{"line_number":63,"context_line":"``nova-manage db archive_deleted_rows [--max_rows \u003cnumber\u003e] [--verbose] [--until-complete] [--all-cells]``"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    --verbose will print the results of the archive operation for any tables"},{"line_number":67,"context_line":"    that were changed. Specifying --until-complete to continuously run the"},{"line_number":68,"context_line":"    process until no more rows are available for archiving. Specifying"},{"line_number":69,"context_line":"    --all-cells to run the process across all cells."}],"source_content_type":"text/x-rst","patch_set":24,"id":"df87a7cf_c12099b3","line":66,"range":{"start_line":66,"start_character":4,"end_line":66,"end_character":13},"updated":"2017-12-06 10:18:04.000000000","message":"As a follow-up, can you mark these as ``literals`` like in the above command, please","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6d7149cd0d0bce643f2fe1598aabceda1afea293","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    --verbose will print the results of the archive operation for any tables"},{"line_number":67,"context_line":"    that were changed. Specifying --until-complete to continuously run the"},{"line_number":68,"context_line":"    process until no more rows are available for archiving. Specifying"},{"line_number":69,"context_line":"    --all-cells to run the process across all cells."},{"line_number":70,"context_line":""}],"source_content_type":"text/x-rst","patch_set":24,"id":"df87a7cf_ade78412","line":67,"range":{"start_line":67,"start_character":23,"end_line":67,"end_character":33},"updated":"2017-12-06 12:33:52.000000000","message":"Specify","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6d7149cd0d0bce643f2fe1598aabceda1afea293","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    --verbose will print the results of the archive operation for any tables"},{"line_number":67,"context_line":"    that were changed. Specifying --until-complete to continuously run the"},{"line_number":68,"context_line":"    process until no more rows are available for archiving. Specifying"},{"line_number":69,"context_line":"    --all-cells to run the process across all cells."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"}],"source_content_type":"text/x-rst","patch_set":24,"id":"df87a7cf_6df17ccd","line":68,"range":{"start_line":68,"start_character":60,"end_line":68,"end_character":70},"updated":"2017-12-06 12:33:52.000000000","message":"Specify","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0bc6f04f9c404242271afd78e4ef45cac984915b","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    ``--verbose`` will print the results of the archive operation for any"},{"line_number":67,"context_line":"    tables that were changed. Specify ``--until-complete`` to continuously"},{"line_number":68,"context_line":"    run the process until no more rows are available for archiving. Specify"},{"line_number":69,"context_line":"    ``--all-cells`` to run the process across all cells."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-rst","patch_set":29,"id":"5f93b717_1967bebf","line":69,"range":{"start_line":68,"start_character":68,"end_line":69,"end_character":56},"updated":"2018-01-30 09:20:25.000000000","message":"If specified ``--all-cells``, it also required pointing to a config file include the API database configs","commit_id":"c805e9d6991c88415f44e62ec1af29b204fe6c68"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"6ed62b7c16cb550c9b4080062b36d3f5e698f171","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    ``--verbose`` will print the results of the archive operation for any"},{"line_number":67,"context_line":"    tables that were changed. Specify ``--until-complete`` to continuously"},{"line_number":68,"context_line":"    run the process until no more rows are available for archiving. Specify"},{"line_number":69,"context_line":"    ``--all-cells`` to run the process across all cells."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-rst","patch_set":29,"id":"5f93b717_d1283898","line":69,"range":{"start_line":68,"start_character":68,"end_line":69,"end_character":56},"in_reply_to":"5f93b717_1967bebf","updated":"2018-01-31 01:45:27.000000000","message":"Done","commit_id":"c805e9d6991c88415f44e62ec1af29b204fe6c68"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"31d94112758d85de76ede8bcd4a1445a6ff8cf8a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    ``--verbose`` will print the results of the archive operation for any"},{"line_number":67,"context_line":"    tables that were changed. Specify ``--until-complete`` to continuously"},{"line_number":68,"context_line":"    run the process until no more rows are available for archiving. Specify"},{"line_number":69,"context_line":"    ``--all-cells`` to run the process across all cells."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-rst","patch_set":29,"id":"5f93b717_d26a5b7f","line":69,"range":{"start_line":68,"start_character":68,"end_line":69,"end_character":56},"in_reply_to":"5f93b717_d1283898","updated":"2018-01-31 21:16:56.000000000","message":"Missing description for \"--max_rows\", could you maybe add that too ?","commit_id":"c805e9d6991c88415f44e62ec1af29b204fe6c68"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"e76e10007ca18ca3c6bc9426ff0db9c85eb91b86","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    determined by ``[database]/connection`` in the configuration file passed to"},{"line_number":61,"context_line":"    nova-manage."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"``nova-manage db archive_deleted_rows [--max_rows \u003cnumber\u003e] [--verbose] [--until-complete] [--max_rows] [--all-cells]``"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    ``--verbose`` will print the results of the archive operation for any"}],"source_content_type":"text/x-rst","patch_set":30,"id":"3fa0c359_635ed1e7","line":63,"range":{"start_line":63,"start_character":91,"end_line":63,"end_character":103},"updated":"2018-02-05 06:18:37.000000000","message":"It is duplicate. Remove it.","commit_id":"0267b57e15f64875cc6bfbbbfb9b0a16b6563368"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"2aab590f8422382bc8a3046f13e2868ecef3ca75","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    determined by ``[database]/connection`` in the configuration file passed to"},{"line_number":61,"context_line":"    nova-manage."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"``nova-manage db archive_deleted_rows [--max_rows \u003cnumber\u003e] [--verbose] [--until-complete] [--max_rows] [--all-cells]``"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Specifying"},{"line_number":66,"context_line":"    ``--verbose`` will print the results of the archive operation for any"}],"source_content_type":"text/x-rst","patch_set":30,"id":"3fa0c359_d7abdb72","line":63,"range":{"start_line":63,"start_character":91,"end_line":63,"end_character":103},"in_reply_to":"3fa0c359_635ed1e7","updated":"2018-02-05 09:37:08.000000000","message":"Oops bad rebase","commit_id":"0267b57e15f64875cc6bfbbbfb9b0a16b6563368"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4348223041c68cba6fbbcfe6f3c20355b866745a","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        If specifying ``--all-cells`` it is required to have a config file"},{"line_number":75,"context_line":"        include the API database configs on the node that is executing this"},{"line_number":76,"context_line":"        command."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-rst","patch_set":31,"id":"3fa0c359_52983969","line":76,"updated":"2018-02-05 10:15:32.000000000","message":"the problem is that we said a lot of times that the operators should use \"nova-manage db\" by a node close to the DB they want to modify.\nIf we now have a CLI that could work for any node, then we should make sure that if for example you try to run the same, you wouldn\u0027t get an exception.","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    tables that were changed. Specifying ``--until-complete`` will make the"},{"line_number":68,"context_line":"    command run continuously until all deleted rows are archived. Use the"},{"line_number":69,"context_line":"    ``--max_rows`` option, which defaults to 1000, as a batch size for each"},{"line_number":70,"context_line":"    iteration. Specify ``--all-cells`` to run the process across all cells."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    .. note::"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-rst","patch_set":36,"id":"ff6b8bd7_f0392441","line":70,"range":{"start_line":70,"start_character":15,"end_line":70,"end_character":22},"updated":"2018-03-06 19:30:14.000000000","message":"This should use the same tense as the other instances here (and in the rest of the file -- i.e. \"specifying\")","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    tables that were changed. Specifying ``--until-complete`` will make the"},{"line_number":68,"context_line":"    command run continuously until all deleted rows are archived. Use the"},{"line_number":69,"context_line":"    ``--max_rows`` option, which defaults to 1000, as a batch size for each"},{"line_number":70,"context_line":"    iteration. Specify ``--all-cells`` to run the process across all cells."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    .. note::"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-rst","patch_set":36,"id":"df7087c5_22cbf4a5","line":70,"range":{"start_line":70,"start_character":15,"end_line":70,"end_character":22},"in_reply_to":"ff6b8bd7_f0392441","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    .. note::"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        If specifying ``--all-cells`` it is required to have a config file"},{"line_number":75,"context_line":"        include the API database configs on the node that is executing this"},{"line_number":76,"context_line":"        command."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"}],"source_content_type":"text/x-rst","patch_set":36,"id":"ff6b8bd7_b03bac36","line":75,"range":{"start_line":75,"start_character":33,"end_line":75,"end_character":40},"updated":"2018-03-06 19:30:14.000000000","message":"config","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        If specifying ``--all-cells`` it is required to have a config file"},{"line_number":75,"context_line":"        include the API database configs on the node that is executing this"},{"line_number":76,"context_line":"        command."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-rst","patch_set":36,"id":"ff6b8bd7_b0240c0f","line":76,"updated":"2018-03-06 19:30:14.000000000","message":"This is a bit clumsy, especially since you can provide a config file on the command line. Maybe just change this to \"your config file must have API DB connection information.\"","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        If specifying ``--all-cells`` it is required to have a config file"},{"line_number":75,"context_line":"        include the API database configs on the node that is executing this"},{"line_number":76,"context_line":"        command."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"``nova-manage db null_instance_uuid_scan [--delete]``"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-rst","patch_set":36,"id":"df7087c5_e2497c32","line":76,"in_reply_to":"ff6b8bd7_b0240c0f","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"``nova-manage db archive_deleted_rows [--max_rows \u003cnumber\u003e] [--verbose] [--until-complete]``"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Note that the"},{"line_number":66,"context_line":"    corresponding rows in the instance_mappings and request_specs tables of the"},{"line_number":67,"context_line":"    API database are purged when instance records are archived. Specifying"},{"line_number":68,"context_line":"    --verbose will print the results of the archive operation for any tables that"},{"line_number":69,"context_line":"    were changed. Specifying --until-complete will make the command run"},{"line_number":70,"context_line":"    continuously until all deleted rows are archived. Use the --max_rows option,"}],"source_content_type":"text/x-rst","patch_set":40,"id":"df7087c5_2c3ad935","side":"PARENT","line":67,"range":{"start_line":65,"start_character":63,"end_line":67,"end_character":63},"updated":"2018-03-08 17:46:04.000000000","message":"You\u0027re regressing this, which merged underneath you","commit_id":"a4f926b8e117d6183b0bc9753b16ae7342f41277"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    will cause a `full` DB purge to be completed after archival. If a date"},{"line_number":73,"context_line":"    range is desired for the purge, then run ``nova-manage db purge --before"},{"line_number":74,"context_line":"    \u003cdate\u003e`` manually after archiving is complete. Specifying --all-cells will"},{"line_number":75,"context_line":"    cause the process to run against all cell databases. For --all-cells to work,"},{"line_number":76,"context_line":"    the api database connection information must be configured."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"``nova-manage db purge [--all] [--before \u003cdate\u003e] [--verbose] [--all-cells]``"},{"line_number":79,"context_line":"    Delete rows from shadow tables. Specifying ``--all`` will delete all data from"}],"source_content_type":"text/x-rst","patch_set":60,"id":"dfbec78f_1af4b285","line":76,"range":{"start_line":75,"start_character":57,"end_line":76,"end_character":62},"updated":"2019-05-10 13:18:30.000000000","message":"I think this command in general needs ``CONF.api_database.connection`` to work as specified in L65 (else its a return code of 3). So either this part can be restructured or removed.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":48,"context_line":"``nova-manage db version``"},{"line_number":49,"context_line":"    Print the current main database version."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"``nova-manage db sync [--version \u003cversion\u003e] [--local_cell]``"},{"line_number":52,"context_line":"    Upgrade the main database schema up to the most recent version or"},{"line_number":53,"context_line":"    ``--version`` if specified. By default, this command will also attempt to"},{"line_number":54,"context_line":"    upgrade the schema for the cell0 database if it is mapped (see the"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_729e9d6a","line":51,"range":{"start_line":51,"start_character":44,"end_line":51,"end_character":58},"updated":"2019-08-07 21:14:05.000000000","message":"--all-cells is a bit of a conflict with this, though it\u0027s a different behavior.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"59e346121ae50c3962d0ab86625917de789edb4a","unresolved":false,"context_lines":[{"line_number":48,"context_line":"``nova-manage db version``"},{"line_number":49,"context_line":"    Print the current main database version."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"``nova-manage db sync [--version \u003cversion\u003e] [--local_cell]``"},{"line_number":52,"context_line":"    Upgrade the main database schema up to the most recent version or"},{"line_number":53,"context_line":"    ``--version`` if specified. By default, this command will also attempt to"},{"line_number":54,"context_line":"    upgrade the schema for the cell0 database if it is mapped (see the"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_99f03d69","line":51,"range":{"start_line":51,"start_character":44,"end_line":51,"end_character":58},"in_reply_to":"7faddb67_4b001503","updated":"2019-08-21 18:49:29.000000000","message":"I meant as a pattern for doing local-only or fanout type option naming for the various commands.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":48,"context_line":"``nova-manage db version``"},{"line_number":49,"context_line":"    Print the current main database version."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"``nova-manage db sync [--version \u003cversion\u003e] [--local_cell]``"},{"line_number":52,"context_line":"    Upgrade the main database schema up to the most recent version or"},{"line_number":53,"context_line":"    ``--version`` if specified. By default, this command will also attempt to"},{"line_number":54,"context_line":"    upgrade the schema for the cell0 database if it is mapped (see the"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_4b001503","line":51,"range":{"start_line":51,"start_character":44,"end_line":51,"end_character":58},"in_reply_to":"7faddb67_729e9d6a","updated":"2019-08-15 20:31:39.000000000","message":"Sorry, I don\u0027t understand what you mean here. I would think --local_cell doesn\u0027t conflict because it\u0027s on the \u0027sync\u0027 command, a different command?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a63b5c6cdb0cadbf7bb1612e9b02b1ba32c9a238","unresolved":false,"context_lines":[{"line_number":48,"context_line":"``nova-manage db version``"},{"line_number":49,"context_line":"    Print the current main database version."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"``nova-manage db sync [--version \u003cversion\u003e] [--local_cell]``"},{"line_number":52,"context_line":"    Upgrade the main database schema up to the most recent version or"},{"line_number":53,"context_line":"    ``--version`` if specified. By default, this command will also attempt to"},{"line_number":54,"context_line":"    upgrade the schema for the cell0 database if it is mapped (see the"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_f7f9357f","line":51,"range":{"start_line":51,"start_character":44,"end_line":51,"end_character":58},"in_reply_to":"7faddb67_99f03d69","updated":"2019-08-22 00:49:39.000000000","message":"I see. Yeah, it does feel backward from --all-cells. I note that we already have --all-cells on the purge command, so we kinda went in a different direction prior to this change.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    Move deleted rows from production tables to shadow tables. Note that the"},{"line_number":66,"context_line":"    corresponding rows in the ``instance_mappings``, ``request_specs`` and"},{"line_number":67,"context_line":"    ``instance_group_member`` tables of the API database are purged when"},{"line_number":68,"context_line":"    instance records are archived and thus, ``CONF.api_database.connection`` is"},{"line_number":69,"context_line":"    required in the config file. Specifying ``--verbose`` will print the results"},{"line_number":70,"context_line":"    of the archive operation for any tables that were changed. Specifying"},{"line_number":71,"context_line":"    ``--until-complete`` will make the command run continuously until all"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_f2912d55","line":68,"range":{"start_line":68,"start_character":46,"end_line":68,"end_character":74},"updated":"2019-08-07 21:14:05.000000000","message":"Ugh, unrelated but this should be:\n\n``[api_database]/connection``\n\n\"CONF\" is a variable in code.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    records in other tables related to those instances. Specifying ``--purge``"},{"line_number":77,"context_line":"    will cause a `full` DB purge to be completed after archival. If a date"},{"line_number":78,"context_line":"    range is desired for the purge, then run ``nova-manage db purge --before"},{"line_number":79,"context_line":"    \u003cdate\u003e`` manually after archiving is complete. Specifying --all-cells will"},{"line_number":80,"context_line":"    cause the process to run against all cell databases."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"``nova-manage db purge [--all] [--before \u003cdate\u003e] [--verbose] [--all-cells]``"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_92a319b2","line":79,"range":{"start_line":79,"start_character":62,"end_line":79,"end_character":73},"updated":"2019-08-07 21:14:05.000000000","message":"``--all-cells``","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    records in other tables related to those instances. Specifying ``--purge``"},{"line_number":77,"context_line":"    will cause a `full` DB purge to be completed after archival. If a date"},{"line_number":78,"context_line":"    range is desired for the purge, then run ``nova-manage db purge --before"},{"line_number":79,"context_line":"    \u003cdate\u003e`` manually after archiving is complete. Specifying --all-cells will"},{"line_number":80,"context_line":"    cause the process to run against all cell databases."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"``nova-manage db purge [--all] [--before \u003cdate\u003e] [--verbose] [--all-cells]``"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_1d526414","line":79,"range":{"start_line":79,"start_character":62,"end_line":79,"end_character":73},"in_reply_to":"7faddb67_92a319b2","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    will cause a `full` DB purge to be completed after archival. If a date"},{"line_number":78,"context_line":"    range is desired for the purge, then run ``nova-manage db purge --before"},{"line_number":79,"context_line":"    \u003cdate\u003e`` manually after archiving is complete. Specifying --all-cells will"},{"line_number":80,"context_line":"    cause the process to run against all cell databases."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"``nova-manage db purge [--all] [--before \u003cdate\u003e] [--verbose] [--all-cells]``"},{"line_number":83,"context_line":"    Delete rows from shadow tables. Specifying ``--all`` will delete all data from"}],"source_content_type":"text/x-rst","patch_set":65,"id":"7faddb67_328105fd","line":80,"updated":"2019-08-07 21:14:05.000000000","message":"(note to self) Given we already say above that the API DB config is required we don\u0027t need to mention it again here.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"}],"nova/cmd/manage.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"220198f9b229fc10bc44d7131daa93f78660fbcd","unresolved":false,"context_lines":[{"line_number":724,"context_line":"        print(migration.db_version())"},{"line_number":725,"context_line":""},{"line_number":726,"context_line":"    @args(\u0027--all-cells\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027all_cells\u0027,"},{"line_number":727,"context_line":"          default\u003dFalse,"},{"line_number":728,"context_line":"          help\u003d\u0027Run command across all cells.\u0027)"},{"line_number":729,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":730,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000.\u0027)"}],"source_content_type":"text/x-python","patch_set":24,"id":"df87a7cf_a10eb538","line":727,"range":{"start_line":727,"start_character":0,"end_line":727,"end_character":24},"updated":"2017-12-06 10:18:04.000000000","message":"nit: I saw a patch from mriedem recently that removed this. Perhaps it\u0027s not necessary? In any case, that patch also set \u0027dest\u0027 and you\u0027ve done that here so nothing serious","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"220198f9b229fc10bc44d7131daa93f78660fbcd","unresolved":false,"context_lines":[{"line_number":766,"context_line":"        for cell_mapping in cell_mappings:"},{"line_number":767,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"                while True:"},{"line_number":770,"context_line":"                    try:"},{"line_number":771,"context_line":"                        run, deleted_instance_uuids \u003d db.archive_deleted_rows("},{"line_number":772,"context_line":"                            max_rows, cctxt)"},{"line_number":773,"context_line":"                    except KeyboardInterrupt:"},{"line_number":774,"context_line":"                        run \u003d {}"},{"line_number":775,"context_line":"                        if until_complete and verbose:"},{"line_number":776,"context_line":"                            print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":777,"context_line":"                            break"},{"line_number":778,"context_line":"                    for k, v in run.items():"},{"line_number":779,"context_line":"                        table_to_rows_archived.setdefault(k, 0)"},{"line_number":780,"context_line":"                        table_to_rows_archived[k] +\u003d v"},{"line_number":781,"context_line":"                    if deleted_instance_uuids:"},{"line_number":782,"context_line":"                        table_to_rows_archived.setdefault("},{"line_number":783,"context_line":"                            \u0027instance_mappings\u0027, 0)"},{"line_number":784,"context_line":"                        table_to_rows_archived.setdefault("},{"line_number":785,"context_line":"                            \u0027request_specs\u0027, 0)"},{"line_number":786,"context_line":"                        ctxt \u003d context.get_admin_context()"},{"line_number":787,"context_line":"                        deleted_mappings \u003d \\"},{"line_number":788,"context_line":"                            objects.InstanceMappingList.destroy_bulk("},{"line_number":789,"context_line":"                                ctxt, deleted_instance_uuids)"},{"line_number":790,"context_line":"                        table_to_rows_archived[\u0027instance_mappings\u0027] +\u003d \\"},{"line_number":791,"context_line":"                            deleted_mappings"},{"line_number":792,"context_line":"                        deleted_specs \u003d objects.RequestSpec.destroy_bulk("},{"line_number":793,"context_line":"                            ctxt, deleted_instance_uuids)"},{"line_number":794,"context_line":"                        table_to_rows_archived[\u0027request_specs\u0027] +\u003d \\"},{"line_number":795,"context_line":"                            deleted_specs"},{"line_number":796,"context_line":"                    if not until_complete:"},{"line_number":797,"context_line":"                        break"},{"line_number":798,"context_line":"                    elif not run:"},{"line_number":799,"context_line":"                        if verbose:"},{"line_number":800,"context_line":"                            print(\u0027.\u0027 + _(\u0027complete\u0027))  # noqa"},{"line_number":801,"context_line":"                        break"},{"line_number":802,"context_line":"                    if verbose:"},{"line_number":803,"context_line":"                        sys.stdout.write(\u0027.\u0027)"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        if verbose:"},{"line_number":806,"context_line":"            if table_to_rows_archived:"}],"source_content_type":"text/x-python","patch_set":24,"id":"df87a7cf_d457f901","line":803,"range":{"start_line":769,"start_character":0,"end_line":803,"end_character":45},"updated":"2017-12-06 10:18:04.000000000","message":"This thing could do with being dedented somehow (possibly by taking it out to its own function?), but that\u0027s a trivial cleanup for later","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"940b48448b6b188e0592c3c3fa2eb3ceb01f04ce","unresolved":false,"context_lines":[{"line_number":766,"context_line":"        for cell_mapping in cell_mappings:"},{"line_number":767,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"                while True:"},{"line_number":770,"context_line":"                    try:"},{"line_number":771,"context_line":"                        run, deleted_instance_uuids \u003d db.archive_deleted_rows("},{"line_number":772,"context_line":"                            max_rows, cctxt)"},{"line_number":773,"context_line":"                    except KeyboardInterrupt:"},{"line_number":774,"context_line":"                        run \u003d {}"},{"line_number":775,"context_line":"                        if until_complete and verbose:"},{"line_number":776,"context_line":"                            print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":777,"context_line":"                            break"},{"line_number":778,"context_line":"                    for k, v in run.items():"},{"line_number":779,"context_line":"                        table_to_rows_archived.setdefault(k, 0)"},{"line_number":780,"context_line":"                        table_to_rows_archived[k] +\u003d v"},{"line_number":781,"context_line":"                    if deleted_instance_uuids:"},{"line_number":782,"context_line":"                        table_to_rows_archived.setdefault("},{"line_number":783,"context_line":"                            \u0027instance_mappings\u0027, 0)"},{"line_number":784,"context_line":"                        table_to_rows_archived.setdefault("},{"line_number":785,"context_line":"                            \u0027request_specs\u0027, 0)"},{"line_number":786,"context_line":"                        ctxt \u003d context.get_admin_context()"},{"line_number":787,"context_line":"                        deleted_mappings \u003d \\"},{"line_number":788,"context_line":"                            objects.InstanceMappingList.destroy_bulk("},{"line_number":789,"context_line":"                                ctxt, deleted_instance_uuids)"},{"line_number":790,"context_line":"                        table_to_rows_archived[\u0027instance_mappings\u0027] +\u003d \\"},{"line_number":791,"context_line":"                            deleted_mappings"},{"line_number":792,"context_line":"                        deleted_specs \u003d objects.RequestSpec.destroy_bulk("},{"line_number":793,"context_line":"                            ctxt, deleted_instance_uuids)"},{"line_number":794,"context_line":"                        table_to_rows_archived[\u0027request_specs\u0027] +\u003d \\"},{"line_number":795,"context_line":"                            deleted_specs"},{"line_number":796,"context_line":"                    if not until_complete:"},{"line_number":797,"context_line":"                        break"},{"line_number":798,"context_line":"                    elif not run:"},{"line_number":799,"context_line":"                        if verbose:"},{"line_number":800,"context_line":"                            print(\u0027.\u0027 + _(\u0027complete\u0027))  # noqa"},{"line_number":801,"context_line":"                        break"},{"line_number":802,"context_line":"                    if verbose:"},{"line_number":803,"context_line":"                        sys.stdout.write(\u0027.\u0027)"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        if verbose:"},{"line_number":806,"context_line":"            if table_to_rows_archived:"}],"source_content_type":"text/x-python","patch_set":24,"id":"df87a7cf_1400eaaa","line":803,"range":{"start_line":769,"start_character":0,"end_line":803,"end_character":45},"in_reply_to":"df87a7cf_0dba30dd","updated":"2017-12-07 01:45:49.000000000","message":"Done","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6d7149cd0d0bce643f2fe1598aabceda1afea293","unresolved":false,"context_lines":[{"line_number":766,"context_line":"        for cell_mapping in cell_mappings:"},{"line_number":767,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"                while True:"},{"line_number":770,"context_line":"                    try:"},{"line_number":771,"context_line":"                        run, deleted_instance_uuids \u003d db.archive_deleted_rows("},{"line_number":772,"context_line":"                            max_rows, cctxt)"},{"line_number":773,"context_line":"                    except KeyboardInterrupt:"},{"line_number":774,"context_line":"                        run \u003d {}"},{"line_number":775,"context_line":"                        if until_complete and verbose:"},{"line_number":776,"context_line":"                            print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":777,"context_line":"                            break"},{"line_number":778,"context_line":"                    for k, v in run.items():"},{"line_number":779,"context_line":"                        table_to_rows_archived.setdefault(k, 0)"},{"line_number":780,"context_line":"                        table_to_rows_archived[k] +\u003d v"},{"line_number":781,"context_line":"                    if deleted_instance_uuids:"},{"line_number":782,"context_line":"                        table_to_rows_archived.setdefault("},{"line_number":783,"context_line":"                            \u0027instance_mappings\u0027, 0)"},{"line_number":784,"context_line":"                        table_to_rows_archived.setdefault("},{"line_number":785,"context_line":"                            \u0027request_specs\u0027, 0)"},{"line_number":786,"context_line":"                        ctxt \u003d context.get_admin_context()"},{"line_number":787,"context_line":"                        deleted_mappings \u003d \\"},{"line_number":788,"context_line":"                            objects.InstanceMappingList.destroy_bulk("},{"line_number":789,"context_line":"                                ctxt, deleted_instance_uuids)"},{"line_number":790,"context_line":"                        table_to_rows_archived[\u0027instance_mappings\u0027] +\u003d \\"},{"line_number":791,"context_line":"                            deleted_mappings"},{"line_number":792,"context_line":"                        deleted_specs \u003d objects.RequestSpec.destroy_bulk("},{"line_number":793,"context_line":"                            ctxt, deleted_instance_uuids)"},{"line_number":794,"context_line":"                        table_to_rows_archived[\u0027request_specs\u0027] +\u003d \\"},{"line_number":795,"context_line":"                            deleted_specs"},{"line_number":796,"context_line":"                    if not until_complete:"},{"line_number":797,"context_line":"                        break"},{"line_number":798,"context_line":"                    elif not run:"},{"line_number":799,"context_line":"                        if verbose:"},{"line_number":800,"context_line":"                            print(\u0027.\u0027 + _(\u0027complete\u0027))  # noqa"},{"line_number":801,"context_line":"                        break"},{"line_number":802,"context_line":"                    if verbose:"},{"line_number":803,"context_line":"                        sys.stdout.write(\u0027.\u0027)"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        if verbose:"},{"line_number":806,"context_line":"            if table_to_rows_archived:"}],"source_content_type":"text/x-python","patch_set":24,"id":"df87a7cf_0dba30dd","line":803,"range":{"start_line":769,"start_character":0,"end_line":803,"end_character":45},"in_reply_to":"df87a7cf_d457f901","updated":"2017-12-06 12:33:52.000000000","message":"+1 on extracting to own method","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0bc6f04f9c404242271afd78e4ef45cac984915b","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        if all_cells:"},{"line_number":524,"context_line":"            cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":525,"context_line":"        else:"},{"line_number":526,"context_line":"            cell_mappings \u003d [objects.CellMapping.get_by_uuid("},{"line_number":527,"context_line":"                ctxt, objects.CellMapping.CELL0_UUID)]"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":"        def do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":530,"context_line":"                       cctxt, max_rows, until_complete, verbose):"}],"source_content_type":"text/x-python","patch_set":29,"id":"5f93b717_79c7e297","line":527,"range":{"start_line":526,"start_character":12,"end_line":527,"end_character":54},"updated":"2018-01-30 09:20:25.000000000","message":"This looks like changing the old behavior. It isn\u0027t only cleanup cell0, it is always read nova.conf as default. If the nova.conf pointed other cells, it also works.","commit_id":"c805e9d6991c88415f44e62ec1af29b204fe6c68"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"cb8dc1a5fb5df5bb0d8007df5a91090cb865951d","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        if all_cells:"},{"line_number":524,"context_line":"            cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":525,"context_line":"        else:"},{"line_number":526,"context_line":"            cell_mappings \u003d [objects.CellMapping.get_by_uuid("},{"line_number":527,"context_line":"                ctxt, objects.CellMapping.CELL0_UUID)]"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":"        def do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":530,"context_line":"                       cctxt, max_rows, until_complete, verbose):"}],"source_content_type":"text/x-python","patch_set":29,"id":"5f93b717_31387cec","line":527,"range":{"start_line":526,"start_character":12,"end_line":527,"end_character":54},"in_reply_to":"5f93b717_79c7e297","updated":"2018-01-31 01:44:29.000000000","message":"Emm seems correct.","commit_id":"c805e9d6991c88415f44e62ec1af29b204fe6c68"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4348223041c68cba6fbbcfe6f3c20355b866745a","unresolved":false,"context_lines":[{"line_number":561,"context_line":"        if all_cells:"},{"line_number":562,"context_line":"            cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":563,"context_line":"            for cell_mapping in cell_mappings:"},{"line_number":564,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":565,"context_line":"                    do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":566,"context_line":"                               cctxt, max_rows, until_complete, verbose)"},{"line_number":567,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa0c359_b28e5d2c","line":564,"updated":"2018-02-05 10:15:32.000000000","message":"well, if you run that from a child cell node, then you would have a problem, right?\nI\u0027d love to make sure that if you\u0027re calling that method form a child node, you wouldn\u0027t have an exception.","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"2f2af97168eb2934ef62a35825869117be8e27b3","unresolved":false,"context_lines":[{"line_number":561,"context_line":"        if all_cells:"},{"line_number":562,"context_line":"            cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":563,"context_line":"            for cell_mapping in cell_mappings:"},{"line_number":564,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":565,"context_line":"                    do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":566,"context_line":"                               cctxt, max_rows, until_complete, verbose)"},{"line_number":567,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa0c359_2df67291","line":564,"in_reply_to":"3fa0c359_b28e5d2c","updated":"2018-02-05 10:54:26.000000000","message":"Hmm that makes sense.","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            sys.stdout.write(_(\u0027Archiving\u0027) + \u0027..\u0027)  # noqa"},{"line_number":513,"context_line":"        ctxt \u003d context.RequestContext()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        def do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":516,"context_line":"                       cctxt, max_rows, until_complete, verbose):"},{"line_number":517,"context_line":"            while True:"},{"line_number":518,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":36,"id":"ff6b8bd7_307ebce4","line":515,"updated":"2018-03-06 19:30:14.000000000","message":"Can you move this out to a method peer to archive_deleted_rows()? It\u0027s already too long and this increases the nesting level so much that you have to wrap things below.","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            sys.stdout.write(_(\u0027Archiving\u0027) + \u0027..\u0027)  # noqa"},{"line_number":513,"context_line":"        ctxt \u003d context.RequestContext()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        def do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":516,"context_line":"                       cctxt, max_rows, until_complete, verbose):"},{"line_number":517,"context_line":"            while True:"},{"line_number":518,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":36,"id":"df7087c5_42baa8de","line":515,"in_reply_to":"ff6b8bd7_307ebce4","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":518,"context_line":"                try:"},{"line_number":519,"context_line":"                    run, deleted_instance_uuids \u003d db.archive_deleted_rows("},{"line_number":520,"context_line":"                        cctxt, max_rows)"},{"line_number":521,"context_line":"                except KeyboardInterrupt:"},{"line_number":522,"context_line":"                    run \u003d {}"},{"line_number":523,"context_line":"                    if until_complete and verbose:"},{"line_number":524,"context_line":"                        print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"}],"source_content_type":"text/x-python","patch_set":36,"id":"ff6b8bd7_30679c50","line":521,"updated":"2018-03-06 19:30:14.000000000","message":"This is the wrong place to catch this now. Hitting C-c will stop the inner loop, but continue looping over cells.","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":518,"context_line":"                try:"},{"line_number":519,"context_line":"                    run, deleted_instance_uuids \u003d db.archive_deleted_rows("},{"line_number":520,"context_line":"                        cctxt, max_rows)"},{"line_number":521,"context_line":"                except KeyboardInterrupt:"},{"line_number":522,"context_line":"                    run \u003d {}"},{"line_number":523,"context_line":"                    if until_complete and verbose:"},{"line_number":524,"context_line":"                        print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"}],"source_content_type":"text/x-python","patch_set":36,"id":"df7087c5_02ccb087","line":521,"in_reply_to":"ff6b8bd7_30679c50","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":556,"context_line":"            except db_exc.CantStartEngineError:"},{"line_number":557,"context_line":"                print(_(\u0027Failed to connect to get cell mappings, \u0027"},{"line_number":558,"context_line":"                        \u0027fall back to archive local DB only.\u0027))"},{"line_number":559,"context_line":"                cell_mappings \u003d None"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        if all_cells and cell_mappings:"}],"source_content_type":"text/x-python","patch_set":36,"id":"ff6b8bd7_90da28e7","line":558,"updated":"2018-03-06 19:30:14.000000000","message":"Is this really the right behavior? If I specified --all-cells and didn\u0027t provide a config file with the right info, I might\u0027ve specified one with a local DB other than what I expected. I think we should fail here and not fall back.","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":556,"context_line":"            except db_exc.CantStartEngineError:"},{"line_number":557,"context_line":"                print(_(\u0027Failed to connect to get cell mappings, \u0027"},{"line_number":558,"context_line":"                        \u0027fall back to archive local DB only.\u0027))"},{"line_number":559,"context_line":"                cell_mappings \u003d None"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        if all_cells and cell_mappings:"}],"source_content_type":"text/x-python","patch_set":36,"id":"df7087c5_c2c5585d","line":558,"in_reply_to":"ff6b8bd7_90da28e7","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":556,"context_line":"            except db_exc.CantStartEngineError:"},{"line_number":557,"context_line":"                print(_(\u0027Failed to connect to get cell mappings, \u0027"},{"line_number":558,"context_line":"                        \u0027fall back to archive local DB only.\u0027))"},{"line_number":559,"context_line":"                cell_mappings \u003d None"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        if all_cells and cell_mappings:"},{"line_number":562,"context_line":"            for cell_mapping in cell_mappings:"}],"source_content_type":"text/x-python","patch_set":36,"id":"ff6b8bd7_10c7f814","line":559,"updated":"2018-03-06 19:30:14.000000000","message":"This only gets set if all_cells is true. You short-circuit below and avoid hitting a NameError, but this is a bad practice that can be easy to trip over. Just set cell_mappings\u003dNone explicitly on L552.","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":556,"context_line":"            except db_exc.CantStartEngineError:"},{"line_number":557,"context_line":"                print(_(\u0027Failed to connect to get cell mappings, \u0027"},{"line_number":558,"context_line":"                        \u0027fall back to archive local DB only.\u0027))"},{"line_number":559,"context_line":"                cell_mappings \u003d None"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        if all_cells and cell_mappings:"},{"line_number":562,"context_line":"            for cell_mapping in cell_mappings:"}],"source_content_type":"text/x-python","patch_set":36,"id":"df7087c5_82a520b8","line":559,"in_reply_to":"ff6b8bd7_10c7f814","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":562,"context_line":"            for cell_mapping in cell_mappings:"},{"line_number":563,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":564,"context_line":"                    do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":565,"context_line":"                               cctxt, max_rows, until_complete, verbose)"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"        else:"},{"line_number":568,"context_line":"            do_archive(table_to_rows_archived, deleted_instance_uuids,"}],"source_content_type":"text/x-python","patch_set":36,"id":"ff6b8bd7_50fd7038","line":565,"updated":"2018-03-06 19:30:14.000000000","message":"This makes max_rows mean \"max rows from any one cell\" which is very different from the meaning before this patch and the meaning if --all-cells is not specified. I think you should do the math here and deduct the number we got from each cell from the total, and quit when we go over that limit.","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":562,"context_line":"            for cell_mapping in cell_mappings:"},{"line_number":563,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":564,"context_line":"                    do_archive(table_to_rows_archived, deleted_instance_uuids,"},{"line_number":565,"context_line":"                               cctxt, max_rows, until_complete, verbose)"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"        else:"},{"line_number":568,"context_line":"            do_archive(table_to_rows_archived, deleted_instance_uuids,"}],"source_content_type":"text/x-python","patch_set":36,"id":"df7087c5_22aa1485","line":565,"in_reply_to":"ff6b8bd7_50fd7038","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3d5330f35fa7ba63a820ff0c0e9bcf4f3d1d220","unresolved":false,"context_lines":[{"line_number":537,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":538,"context_line":"                    try:"},{"line_number":539,"context_line":"                        rows_archived \u003d self._do_archive("},{"line_number":540,"context_line":"                            table_to_rows_archived,"},{"line_number":541,"context_line":"                            deleted_instance_uuids,"},{"line_number":542,"context_line":"                            cctxt, max_rows_to_archive,"},{"line_number":543,"context_line":"                            until_complete,"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_28c5ea3c","line":540,"updated":"2018-03-08 14:57:56.000000000","message":"This nesting is getting really deep, and this method is now really complex. It would be better to unify as much of it as possible.\n\ntarget_cell() will do nothing if the cell_mapping you pass is None. So how about you make the main body of this always iterate over cells, and if not --all-cells, then set the cell_mappings \u003d [None] ? That way you\u0027ll get a much simpler flow through this without having to duplicate so much. For example:\n\n if all_cells:\n     cell_mappings \u003d objects.CellMappingList.get_all(ctxt)\n else:\n     cell_mappings \u003d [None]\n\n for cell_mapping in cell_mappings:\n     with context.target_cell(ctxt, cell_mapping) as cctxt:\n         self._do_archive(cctxt, ...)\n\nThat should work for both cases, DRYing this up, and reducing your indent level to something quite a bit less crazy.","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"c957e830037f57547cb72d3684918c4679bb8ead","unresolved":false,"context_lines":[{"line_number":537,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":538,"context_line":"                    try:"},{"line_number":539,"context_line":"                        rows_archived \u003d self._do_archive("},{"line_number":540,"context_line":"                            table_to_rows_archived,"},{"line_number":541,"context_line":"                            deleted_instance_uuids,"},{"line_number":542,"context_line":"                            cctxt, max_rows_to_archive,"},{"line_number":543,"context_line":"                            until_complete,"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_63946545","line":540,"in_reply_to":"df7087c5_28c5ea3c","updated":"2018-03-08 15:20:05.000000000","message":"If cell_mapping is None, mq_connection and db_connection will be set to None, will that be a problem?","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5fb7c36cf62e449fe1eaadcc76cc08018ef05d63","unresolved":false,"context_lines":[{"line_number":537,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":538,"context_line":"                    try:"},{"line_number":539,"context_line":"                        rows_archived \u003d self._do_archive("},{"line_number":540,"context_line":"                            table_to_rows_archived,"},{"line_number":541,"context_line":"                            deleted_instance_uuids,"},{"line_number":542,"context_line":"                            cctxt, max_rows_to_archive,"},{"line_number":543,"context_line":"                            until_complete,"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_23218dfc","line":540,"in_reply_to":"df7087c5_63946545","updated":"2018-03-08 15:28:00.000000000","message":"According to my reading here:\nhttps://github.com/openstack/nova/blob/3a3b0f09db318faf1a1ea711a73bb365cab8b233/nova/context.py#L376","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3d5330f35fa7ba63a820ff0c0e9bcf4f3d1d220","unresolved":false,"context_lines":[{"line_number":546,"context_line":"                        interrupt \u003d True"},{"line_number":547,"context_line":"                        if until_complete and verbose:"},{"line_number":548,"context_line":"                            print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":549,"context_line":"                            break"},{"line_number":550,"context_line":"                    total_rows_archived +\u003d rows_archived"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_6873e281","line":549,"range":{"start_line":549,"start_character":28,"end_line":549,"end_character":33},"updated":"2018-03-08 14:57:56.000000000","message":"This needs to run regardless of if verbose, right? Otherwise if --verbose was not set, then we won\u0027t exit here on C-c.","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"c957e830037f57547cb72d3684918c4679bb8ead","unresolved":false,"context_lines":[{"line_number":546,"context_line":"                        interrupt \u003d True"},{"line_number":547,"context_line":"                        if until_complete and verbose:"},{"line_number":548,"context_line":"                            print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":549,"context_line":"                            break"},{"line_number":550,"context_line":"                    total_rows_archived +\u003d rows_archived"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_e3e87517","line":549,"range":{"start_line":549,"start_character":28,"end_line":549,"end_character":33},"in_reply_to":"df7087c5_6873e281","updated":"2018-03-08 15:20:05.000000000","message":"yeah, you are right","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3d5330f35fa7ba63a820ff0c0e9bcf4f3d1d220","unresolved":false,"context_lines":[{"line_number":557,"context_line":"            except KeyboardInterrupt:"},{"line_number":558,"context_line":"                interrupt \u003d True"},{"line_number":559,"context_line":"                if until_complete and verbose:"},{"line_number":560,"context_line":"                    print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":"        if until_complete and verbose and not interrupt:"},{"line_number":563,"context_line":"            print(\u0027.\u0027 + _(\u0027complete\u0027))  # noqa"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_a80edae2","line":560,"updated":"2018-03-08 14:57:56.000000000","message":"Why not just do this below if interrupt, and if not, print \"complete\" ?","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"c957e830037f57547cb72d3684918c4679bb8ead","unresolved":false,"context_lines":[{"line_number":557,"context_line":"            except KeyboardInterrupt:"},{"line_number":558,"context_line":"                interrupt \u003d True"},{"line_number":559,"context_line":"                if until_complete and verbose:"},{"line_number":560,"context_line":"                    print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":"        if until_complete and verbose and not interrupt:"},{"line_number":563,"context_line":"            print(\u0027.\u0027 + _(\u0027complete\u0027))  # noqa"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_e3d15559","line":560,"in_reply_to":"df7087c5_a80edae2","updated":"2018-03-08 15:20:05.000000000","message":"Done","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3d5330f35fa7ba63a820ff0c0e9bcf4f3d1d220","unresolved":false,"context_lines":[{"line_number":574,"context_line":"    def _do_archive(self, table_to_rows_archived, deleted_instance_uuids,"},{"line_number":575,"context_line":"                    cctxt, max_rows, until_complete, verbose,"},{"line_number":576,"context_line":"                    cell_name\u003dNone):"},{"line_number":577,"context_line":"            while True:"},{"line_number":578,"context_line":"                try:"},{"line_number":579,"context_line":"                    run, deleted_instance_uuids, total_rows_archived \u003d \\"},{"line_number":580,"context_line":"                        db.archive_deleted_rows(cctxt, max_rows)"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_683e822a","line":577,"updated":"2018-03-08 14:57:56.000000000","message":"This is too much indent.","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"19a5928f1ca2c03b0efd5325a16d743bc2268b50","unresolved":false,"context_lines":[{"line_number":574,"context_line":"    def _do_archive(self, table_to_rows_archived, deleted_instance_uuids,"},{"line_number":575,"context_line":"                    cctxt, max_rows, until_complete, verbose,"},{"line_number":576,"context_line":"                    cell_name\u003dNone):"},{"line_number":577,"context_line":"            while True:"},{"line_number":578,"context_line":"                try:"},{"line_number":579,"context_line":"                    run, deleted_instance_uuids, total_rows_archived \u003d \\"},{"line_number":580,"context_line":"                        db.archive_deleted_rows(cctxt, max_rows)"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_032248a5","line":577,"in_reply_to":"df7087c5_23542dca","updated":"2018-03-08 15:40:57.000000000","message":"Oh, got your point","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"c957e830037f57547cb72d3684918c4679bb8ead","unresolved":false,"context_lines":[{"line_number":574,"context_line":"    def _do_archive(self, table_to_rows_archived, deleted_instance_uuids,"},{"line_number":575,"context_line":"                    cctxt, max_rows, until_complete, verbose,"},{"line_number":576,"context_line":"                    cell_name\u003dNone):"},{"line_number":577,"context_line":"            while True:"},{"line_number":578,"context_line":"                try:"},{"line_number":579,"context_line":"                    run, deleted_instance_uuids, total_rows_archived \u003d \\"},{"line_number":580,"context_line":"                        db.archive_deleted_rows(cctxt, max_rows)"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_23542dca","line":577,"in_reply_to":"df7087c5_683e822a","updated":"2018-03-08 15:20:05.000000000","message":"but how can we clean this up?","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3d5330f35fa7ba63a820ff0c0e9bcf4f3d1d220","unresolved":false,"context_lines":[{"line_number":580,"context_line":"                        db.archive_deleted_rows(cctxt, max_rows)"},{"line_number":581,"context_line":"                except KeyboardInterrupt:"},{"line_number":582,"context_line":"                    run \u003d {}"},{"line_number":583,"context_line":"                    if until_complete and verbose:"},{"line_number":584,"context_line":"                        raise KeyboardInterrupt"},{"line_number":585,"context_line":"                for k, v in run.items():"},{"line_number":586,"context_line":"                    if cell_name:"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_e861323b","line":583,"updated":"2018-03-08 14:57:56.000000000","message":"Why? Don\u0027t you want to just let this bubble up?","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"c957e830037f57547cb72d3684918c4679bb8ead","unresolved":false,"context_lines":[{"line_number":580,"context_line":"                        db.archive_deleted_rows(cctxt, max_rows)"},{"line_number":581,"context_line":"                except KeyboardInterrupt:"},{"line_number":582,"context_line":"                    run \u003d {}"},{"line_number":583,"context_line":"                    if until_complete and verbose:"},{"line_number":584,"context_line":"                        raise KeyboardInterrupt"},{"line_number":585,"context_line":"                for k, v in run.items():"},{"line_number":586,"context_line":"                    if cell_name:"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_e33635b5","line":583,"in_reply_to":"df7087c5_e861323b","updated":"2018-03-08 15:20:05.000000000","message":"Done","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3d5330f35fa7ba63a820ff0c0e9bcf4f3d1d220","unresolved":false,"context_lines":[{"line_number":596,"context_line":"                    deleted_mappings \u003d \\"},{"line_number":597,"context_line":"                        objects.InstanceMappingList.destroy_bulk("},{"line_number":598,"context_line":"                            ctxt, deleted_instance_uuids)"},{"line_number":599,"context_line":"                    table_to_rows_archived[\u0027instance_mappings\u0027] +\u003d \\"},{"line_number":600,"context_line":"                        deleted_mappings"},{"line_number":601,"context_line":"                    deleted_specs \u003d objects.RequestSpec.destroy_bulk("},{"line_number":602,"context_line":"                        ctxt, deleted_instance_uuids)"}],"source_content_type":"text/x-python","patch_set":39,"id":"df7087c5_e8c61217","line":599,"updated":"2018-03-08 14:57:56.000000000","message":"Hopefully reducing the indent above will help avoid silly things like this :)","commit_id":"510422ebaa7f8341a6426ba7054500e5a52c5b01"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":521,"context_line":"            except db_exc.CantStartEngineError:"},{"line_number":522,"context_line":"                print(_(\u0027Failed to connect to get cell mappings, \u0027"},{"line_number":523,"context_line":"                        \u0027please check your config file to make sure \u0027"},{"line_number":524,"context_line":"                        \u0027API DB connection information are included, \u0027"},{"line_number":525,"context_line":"                        \u0027or try again without --all-cells.\u0027))"},{"line_number":526,"context_line":"                return 3"},{"line_number":527,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_4c1aad7d","line":524,"range":{"start_line":524,"start_character":55,"end_line":524,"end_character":58},"updated":"2018-03-08 17:46:04.000000000","message":"\"is\"","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"38fad3f72365176a081b0f0a792b1c68289cab82","unresolved":false,"context_lines":[{"line_number":521,"context_line":"            except db_exc.CantStartEngineError:"},{"line_number":522,"context_line":"                print(_(\u0027Failed to connect to get cell mappings, \u0027"},{"line_number":523,"context_line":"                        \u0027please check your config file to make sure \u0027"},{"line_number":524,"context_line":"                        \u0027API DB connection information are included, \u0027"},{"line_number":525,"context_line":"                        \u0027or try again without --all-cells.\u0027))"},{"line_number":526,"context_line":"                return 3"},{"line_number":527,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_fb1250b1","line":524,"range":{"start_line":524,"start_character":55,"end_line":524,"end_character":58},"in_reply_to":"df7087c5_4c1aad7d","updated":"2018-03-14 08:17:05.000000000","message":"Done","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":530,"context_line":"        for cell_mapping in cell_mappings:"},{"line_number":531,"context_line":"            # NOTE(Kevin_Zheng): No need to calculate limit for each"},{"line_number":532,"context_line":"            # cell if until_complete\u003dTrue"},{"line_number":533,"context_line":"            if until_complete:"},{"line_number":534,"context_line":"                max_rows_to_archive \u003d max_rows"},{"line_number":535,"context_line":"            elif not until_complete and max_rows \u003e total_rows_archived:"},{"line_number":536,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":537,"context_line":"            else:"},{"line_number":538,"context_line":"                break"},{"line_number":539,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":540,"context_line":"                cell_name \u003d cell_mapping.name if cell_mapping else None"},{"line_number":541,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_f7e6eee8","line":538,"range":{"start_line":533,"start_character":0,"end_line":538,"end_character":21},"updated":"2018-03-08 17:46:04.000000000","message":"I think we probably need test coverage for these different cases. I was about to comment that the else case wasn\u0027t enough, although I think it is actually okay. However, if there was a test for it I wouldn\u0027t have had to wonder :)","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"38fad3f72365176a081b0f0a792b1c68289cab82","unresolved":false,"context_lines":[{"line_number":530,"context_line":"        for cell_mapping in cell_mappings:"},{"line_number":531,"context_line":"            # NOTE(Kevin_Zheng): No need to calculate limit for each"},{"line_number":532,"context_line":"            # cell if until_complete\u003dTrue"},{"line_number":533,"context_line":"            if until_complete:"},{"line_number":534,"context_line":"                max_rows_to_archive \u003d max_rows"},{"line_number":535,"context_line":"            elif not until_complete and max_rows \u003e total_rows_archived:"},{"line_number":536,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":537,"context_line":"            else:"},{"line_number":538,"context_line":"                break"},{"line_number":539,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":540,"context_line":"                cell_name \u003d cell_mapping.name if cell_mapping else None"},{"line_number":541,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_3b19a8d6","line":538,"range":{"start_line":533,"start_character":0,"end_line":538,"end_character":21},"in_reply_to":"df7087c5_f7e6eee8","updated":"2018-03-14 08:17:05.000000000","message":"Done","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                        verbose, cell_name)"},{"line_number":548,"context_line":"                except KeyboardInterrupt:"},{"line_number":549,"context_line":"                    interrupt \u003d True"},{"line_number":550,"context_line":"                    if until_complete:"},{"line_number":551,"context_line":"                        break"},{"line_number":552,"context_line":"                total_rows_archived +\u003d rows_archived"},{"line_number":553,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_17d12255","line":550,"updated":"2018-03-08 17:46:04.000000000","message":"If we\u0027re doing cell1 and the user does C-c, we want to stop and not process cell2, cell3. If you only break if we\u0027re running --until-complete, we\u0027ll continue processing the next cell, right?\n\nThis case isn\u0027t tested and really should be as I think it would shake this problem out.","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"38fad3f72365176a081b0f0a792b1c68289cab82","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                        verbose, cell_name)"},{"line_number":548,"context_line":"                except KeyboardInterrupt:"},{"line_number":549,"context_line":"                    interrupt \u003d True"},{"line_number":550,"context_line":"                    if until_complete:"},{"line_number":551,"context_line":"                        break"},{"line_number":552,"context_line":"                total_rows_archived +\u003d rows_archived"},{"line_number":553,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_1b14e49f","line":550,"in_reply_to":"df7087c5_17d12255","updated":"2018-03-14 08:17:05.000000000","message":"Done","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":574,"context_line":"                db.archive_deleted_rows(cctxt, max_rows)"},{"line_number":575,"context_line":"            for k, v in run.items():"},{"line_number":576,"context_line":"                if cell_name:"},{"line_number":577,"context_line":"                    k \u003d cell_name + \u0027.\u0027 + k"},{"line_number":578,"context_line":"                table_to_rows_archived.setdefault(k, 0)"},{"line_number":579,"context_line":"                table_to_rows_archived[k] +\u003d v"},{"line_number":580,"context_line":"            if deleted_instance_uuids:"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_f7dcae47","line":577,"updated":"2018-03-08 17:46:04.000000000","message":"So this is cool, because it scopes each table to the cell so you can tell how much from each was archived. However, I think that since this is a dict, you\u0027ll get a very confusing output with cells and tables interspersed so it\u0027s hard to read. Presumably we can tell the table to print sorted by the table name so it looks right?","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"8e09c9261a704ce5d639831e0e75076c4b9722b4","unresolved":false,"context_lines":[{"line_number":574,"context_line":"                db.archive_deleted_rows(cctxt, max_rows)"},{"line_number":575,"context_line":"            for k, v in run.items():"},{"line_number":576,"context_line":"                if cell_name:"},{"line_number":577,"context_line":"                    k \u003d cell_name + \u0027.\u0027 + k"},{"line_number":578,"context_line":"                table_to_rows_archived.setdefault(k, 0)"},{"line_number":579,"context_line":"                table_to_rows_archived[k] +\u003d v"},{"line_number":580,"context_line":"            if deleted_instance_uuids:"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_5bf01cca","line":577,"in_reply_to":"df7087c5_f7dcae47","updated":"2018-03-09 03:02:16.000000000","message":"Yeah, that also came to my mind when I done it.","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9e84f0340c8aecac40f1b31d938569a56aab3a6d","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        if table_to_rows_archived and purge:"},{"line_number":572,"context_line":"            if verbose:"},{"line_number":573,"context_line":"                print(_(\u0027Rows were archived, running purge...\u0027))"},{"line_number":574,"context_line":"            self.purge(purge_all\u003dTrue, verbose\u003dverbose, all_cells\u003dall_cells)"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":577,"context_line":"        return int(bool(table_to_rows_archived))"}],"source_content_type":"text/x-python","patch_set":41,"id":"df7087c5_0fa4a256","line":574,"range":{"start_line":574,"start_character":56,"end_line":574,"end_character":75},"updated":"2018-03-08 23:06:09.000000000","message":"Note I\u0027m passing your flag through to purge so that archive --all-cells will also purge --all cells :)","commit_id":"99512fea8eebada7a6824d7601d767272ce099c3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"00ca238b400e9954f82821a4ce9f869d754a5879","unresolved":false,"context_lines":[{"line_number":600,"context_line":"                    ctxt, deleted_instance_uuids)"},{"line_number":601,"context_line":"                table_to_rows_archived["},{"line_number":602,"context_line":"                    \u0027API_DB.request_specs\u0027] +\u003d deleted_specs"},{"line_number":603,"context_line":"            if not until_complete:"},{"line_number":604,"context_line":"                break"},{"line_number":605,"context_line":"            elif not run:"},{"line_number":606,"context_line":"                break"},{"line_number":607,"context_line":"            if verbose:"},{"line_number":608,"context_line":"                sys.stdout.write(\u0027.\u0027)"},{"line_number":609,"context_line":"        return total_rows_archived"}],"source_content_type":"text/x-python","patch_set":52,"id":"5f7c97a3_d0b95dec","line":606,"range":{"start_line":603,"start_character":12,"end_line":606,"end_character":21},"updated":"2018-06-19 06:25:45.000000000","message":"how about \u0027if not until_compele or not run\u0027?","commit_id":"7f4d1b0336c57385e298c8a39862272e3d0ae836"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"cee2750151badf07339738a114409ed82d9e3d42","unresolved":false,"context_lines":[{"line_number":600,"context_line":"                    ctxt, deleted_instance_uuids)"},{"line_number":601,"context_line":"                table_to_rows_archived["},{"line_number":602,"context_line":"                    \u0027API_DB.request_specs\u0027] +\u003d deleted_specs"},{"line_number":603,"context_line":"            if not until_complete:"},{"line_number":604,"context_line":"                break"},{"line_number":605,"context_line":"            elif not run:"},{"line_number":606,"context_line":"                break"},{"line_number":607,"context_line":"            if verbose:"},{"line_number":608,"context_line":"                sys.stdout.write(\u0027.\u0027)"},{"line_number":609,"context_line":"        return total_rows_archived"}],"source_content_type":"text/x-python","patch_set":52,"id":"5f7c97a3_4bda7c79","line":606,"range":{"start_line":603,"start_character":12,"end_line":606,"end_character":21},"in_reply_to":"5f7c97a3_d0b95dec","updated":"2018-06-19 06:43:19.000000000","message":"Done","commit_id":"7f4d1b0336c57385e298c8a39862272e3d0ae836"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"166354de92f37f67578019e3cfa43827a1106341","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                    ctxt, deleted_instance_uuids)"},{"line_number":625,"context_line":"                table_to_rows_archived["},{"line_number":626,"context_line":"                    \u0027API_DB.request_specs\u0027] +\u003d deleted_specs"},{"line_number":627,"context_line":"            if not until_complete or run:"},{"line_number":628,"context_line":"                break"},{"line_number":629,"context_line":"            if verbose:"},{"line_number":630,"context_line":"                sys.stdout.write(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":53,"id":"5f7c97a3_e524d010","line":627,"range":{"start_line":627,"start_character":34,"end_line":627,"end_character":40},"updated":"2018-06-19 11:43:56.000000000","message":"not run","commit_id":"bf1a6e42f669a190deb17b2306769d9d273cd073"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"585cc1b4a23ed9f0882e7900841e961ec1a779c0","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                    ctxt, deleted_instance_uuids)"},{"line_number":625,"context_line":"                table_to_rows_archived["},{"line_number":626,"context_line":"                    \u0027API_DB.request_specs\u0027] +\u003d deleted_specs"},{"line_number":627,"context_line":"            if not until_complete or run:"},{"line_number":628,"context_line":"                break"},{"line_number":629,"context_line":"            if verbose:"},{"line_number":630,"context_line":"                sys.stdout.write(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":53,"id":"5f7c97a3_08679cec","line":627,"range":{"start_line":627,"start_character":34,"end_line":627,"end_character":40},"in_reply_to":"5f7c97a3_e524d010","updated":"2018-06-19 15:11:46.000000000","message":"oops","commit_id":"bf1a6e42f669a190deb17b2306769d9d273cd073"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        deleted_instance_uuids \u003d []"},{"line_number":541,"context_line":"        if until_complete and verbose:"},{"line_number":542,"context_line":"            sys.stdout.write(_(\u0027Archiving\u0027) + \u0027..\u0027)  # noqa"},{"line_number":543,"context_line":"        ctxt \u003d context.RequestContext()"},{"line_number":544,"context_line":""},{"line_number":545,"context_line":"        interrupt \u003d False"},{"line_number":546,"context_line":""}],"source_content_type":"text/x-python","patch_set":60,"id":"dfbec78f_5a3f8a24","line":543,"range":{"start_line":543,"start_character":8,"end_line":543,"end_character":39},"updated":"2019-05-10 13:18:30.000000000","message":"why are we not reusing the admin context here from L526 for archiving?","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5c3f9971c07ee175a60b0f21c61858df560acf56","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        deleted_instance_uuids \u003d []"},{"line_number":541,"context_line":"        if until_complete and verbose:"},{"line_number":542,"context_line":"            sys.stdout.write(_(\u0027Archiving\u0027) + \u0027..\u0027)  # noqa"},{"line_number":543,"context_line":"        ctxt \u003d context.RequestContext()"},{"line_number":544,"context_line":""},{"line_number":545,"context_line":"        interrupt \u003d False"},{"line_number":546,"context_line":""}],"source_content_type":"text/x-python","patch_set":60,"id":"7faddb67_7e8b1967","line":543,"range":{"start_line":543,"start_character":8,"end_line":543,"end_character":39},"in_reply_to":"dfbec78f_5a3f8a24","updated":"2019-07-19 00:48:59.000000000","message":"Done","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":555,"context_line":"            # NOTE(Kevin_Zheng): No need to calculate limit for each"},{"line_number":556,"context_line":"            # cell if until_complete\u003dTrue"},{"line_number":557,"context_line":"            if until_complete:"},{"line_number":558,"context_line":"                max_rows_to_archive \u003d max_rows"},{"line_number":559,"context_line":"            elif not until_complete and max_rows \u003e total_rows_archived:"},{"line_number":560,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":561,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":60,"id":"dfbec78f_3d189073","line":558,"range":{"start_line":558,"start_character":16,"end_line":558,"end_character":35},"updated":"2019-05-10 13:18:30.000000000","message":"okay so in this case max_rows will either be 1000 or anything that is specified by the user for the max_rows right? So shouldn\u0027t we be still calculating the limit to control the batch_size for each iteration ? Or is the \"each iteration\" now restricted to per cell and not global ?","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5c3f9971c07ee175a60b0f21c61858df560acf56","unresolved":false,"context_lines":[{"line_number":555,"context_line":"            # NOTE(Kevin_Zheng): No need to calculate limit for each"},{"line_number":556,"context_line":"            # cell if until_complete\u003dTrue"},{"line_number":557,"context_line":"            if until_complete:"},{"line_number":558,"context_line":"                max_rows_to_archive \u003d max_rows"},{"line_number":559,"context_line":"            elif not until_complete and max_rows \u003e total_rows_archived:"},{"line_number":560,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":561,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":60,"id":"7faddb67_1eca251a","line":558,"range":{"start_line":558,"start_character":16,"end_line":558,"end_character":35},"in_reply_to":"dfbec78f_3d189073","updated":"2019-07-19 00:48:59.000000000","message":"Yeah, I\u0027m not sure of the logic behind this and why it depends on whether until_complete\u003dTrue. I\u0027ll try changing this to calculate the batch each iteration. I would guess that a person running this command will think \"max_rows\" means max total, not max per cell.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":560,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":561,"context_line":"            else:"},{"line_number":562,"context_line":"                break"},{"line_number":563,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":564,"context_line":"                cell_name \u003d cell_mapping.name if cell_mapping else None"},{"line_number":565,"context_line":"                try:"},{"line_number":566,"context_line":"                    rows_archived \u003d self._do_archive("}],"source_content_type":"text/x-python","patch_set":60,"id":"dfbec78f_d87942fc","line":563,"range":{"start_line":563,"start_character":43,"end_line":563,"end_character":55},"updated":"2019-05-10 13:18:30.000000000","message":"so if all-cells is False then we would target a \"None\" cell_mapping that would go here (https://github.com/openstack/nova/blob/71b11292fb6c37b3854ba1bbfc00c729b4b5ecf4/nova/context.py#L384) and set db, mq and cell_uuid to None in the cctxt","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            else:"},{"line_number":562,"context_line":"                break"},{"line_number":563,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":564,"context_line":"                cell_name \u003d cell_mapping.name if cell_mapping else None"},{"line_number":565,"context_line":"                try:"},{"line_number":566,"context_line":"                    rows_archived \u003d self._do_archive("},{"line_number":567,"context_line":"                        table_to_rows_archived,"}],"source_content_type":"text/x-python","patch_set":60,"id":"dfbec78f_58db12ec","line":564,"range":{"start_line":564,"start_character":62,"end_line":564,"end_character":71},"updated":"2019-05-10 13:18:30.000000000","message":"hence this logic for the all-cells-False case ? would be useful to leave a comment.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5c3f9971c07ee175a60b0f21c61858df560acf56","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            else:"},{"line_number":562,"context_line":"                break"},{"line_number":563,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":564,"context_line":"                cell_name \u003d cell_mapping.name if cell_mapping else None"},{"line_number":565,"context_line":"                try:"},{"line_number":566,"context_line":"                    rows_archived \u003d self._do_archive("},{"line_number":567,"context_line":"                        table_to_rows_archived,"}],"source_content_type":"text/x-python","patch_set":60,"id":"7faddb67_3e9b6118","line":564,"range":{"start_line":564,"start_character":62,"end_line":564,"end_character":71},"in_reply_to":"dfbec78f_58db12ec","updated":"2019-07-19 00:48:59.000000000","message":"Done","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":475,"context_line":"        \"\"\"Print the current database version.\"\"\""},{"line_number":476,"context_line":"        print(migration.db_version())"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"    @args(\u0027--all-cells\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027all_cells\u0027,"},{"line_number":479,"context_line":"          default\u003dFalse, help\u003d\u0027Run command across all cells.\u0027)"},{"line_number":480,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":481,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000. \u0027"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_72b53dd0","line":478,"updated":"2019-08-07 21:14:05.000000000","message":"Typically new args should go at the bottom of the list, and align with the kwargs order (I see that --before broke this). Not that it really matters to the functioning of the command, so this is mostly a nit.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":475,"context_line":"        \"\"\"Print the current database version.\"\"\""},{"line_number":476,"context_line":"        print(migration.db_version())"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"    @args(\u0027--all-cells\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027all_cells\u0027,"},{"line_number":479,"context_line":"          default\u003dFalse, help\u003d\u0027Run command across all cells.\u0027)"},{"line_number":480,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":481,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000. \u0027"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_bd523011","line":478,"in_reply_to":"7faddb67_72b53dd0","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":519,"context_line":"            # NOTE(tssurya): This check has been added to validate if the API"},{"line_number":520,"context_line":"            # DB is reachable or not as this is essential for purging the"},{"line_number":521,"context_line":"            # related API database records of the deleted instances."},{"line_number":522,"context_line":"            cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":523,"context_line":"        except db_exc.CantStartEngineError:"},{"line_number":524,"context_line":"            print(_(\u0027Failed to connect to API DB so aborting this archival \u0027"},{"line_number":525,"context_line":"                    \u0027attempt. Please check your config file to make sure that \u0027"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_14ce365b","line":522,"updated":"2019-08-07 21:14:05.000000000","message":"Should we be filtering out disabled cells? What if you know you have 1 or 2 out of 70 cells that are disabled because the cell DB is down and you want to iterate and archive all cells but don\u0027t want to hit failures because a couple are down?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":519,"context_line":"            # NOTE(tssurya): This check has been added to validate if the API"},{"line_number":520,"context_line":"            # DB is reachable or not as this is essential for purging the"},{"line_number":521,"context_line":"            # related API database records of the deleted instances."},{"line_number":522,"context_line":"            cell_mappings \u003d objects.CellMappingList.get_all(ctxt)"},{"line_number":523,"context_line":"        except db_exc.CantStartEngineError:"},{"line_number":524,"context_line":"            print(_(\u0027Failed to connect to API DB so aborting this archival \u0027"},{"line_number":525,"context_line":"                    \u0027attempt. Please check your config file to make sure that \u0027"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_7d6918bc","line":522,"in_reply_to":"7faddb67_14ce365b","updated":"2019-08-15 20:31:39.000000000","message":"I\u0027d think we wouldn\u0027t want to assume a cell DB is inaccessible a skip an archive attempt because an operator has disabled a cell from scheduling. Because if we do, then operators could get put in a position where they would have to enable a cell just to archive its old records. Instead, I would think we just try to archive and skip cells that we aren\u0027t able to connect to?\n\n(later) I asked about this on IRC today [1] and tssurya and dansmith both agreed that we shouldn\u0027t skip disabled cells and to instead skip/warn for unreachable cells. I put it as a TODO in this patch.\n\n[1] http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-08-15.log.html#t2019-08-15T15:59:30","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d28e06a98cb8c36457e5a189e6f2eb13e10e7dc","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        except db_exc.CantStartEngineError:"},{"line_number":524,"context_line":"            print(_(\u0027Failed to connect to API DB so aborting this archival \u0027"},{"line_number":525,"context_line":"                    \u0027attempt. Please check your config file to make sure that \u0027"},{"line_number":526,"context_line":"                    \u0027CONF.api_database.connection is set and run this \u0027"},{"line_number":527,"context_line":"                    \u0027command again.\u0027))"},{"line_number":528,"context_line":"            return 3"},{"line_number":529,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_74020a72","line":526,"range":{"start_line":526,"start_character":21,"end_line":526,"end_character":25},"updated":"2019-08-07 21:15:23.000000000","message":"As mentioned in the test that hits this, and this is unrelated to your patch, but we shouldn\u0027t expose this in a user-facing message to users, it\u0027s a variable in code, not something an operator would understand. I can push a separate patch.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":544,"context_line":"        interrupt \u003d False"},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"        if all_cells:"},{"line_number":547,"context_line":"            # Sort first by table, then by cell name:"},{"line_number":548,"context_line":"            # +--------------------------------+-------------------------+"},{"line_number":549,"context_line":"            # | Table                          | Number of Rows Archived |"},{"line_number":550,"context_line":"            # +--------------------------------+-------------------------+"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_922d59ff","line":547,"updated":"2019-08-07 21:14:05.000000000","message":"This actually seems a bit confusing, at least to me, in practice:\n\nhttp://logs.openstack.org/40/672840/4/check/nova-next/cdf7ae5/job-output.txt.gz#_2019-07-26_17_05_52_401033\n\nIn that job output we\u0027re continuing to call the command until we get 0 back, so you can see the archive hitting cell0, then cell1, and then cell1 and the API DB stuff.\n\nIt seems cleaner to me to sort by cell and then table since we\u0027re iterating over cells first and tables second, right?\n\nWhat is below in the comment looks nice when there aren\u0027t that many things to archive, but in a real world scenario there are a lot and it gets messy as seen in the nova-next output.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":544,"context_line":"        interrupt \u003d False"},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"        if all_cells:"},{"line_number":547,"context_line":"            # Sort first by table, then by cell name:"},{"line_number":548,"context_line":"            # +--------------------------------+-------------------------+"},{"line_number":549,"context_line":"            # | Table                          | Number of Rows Archived |"},{"line_number":550,"context_line":"            # +--------------------------------+-------------------------+"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_7daef8e7","line":547,"in_reply_to":"7faddb67_922d59ff","updated":"2019-08-15 20:31:39.000000000","message":"Hm, yeah, I see what you mean in the gate run output. I agree that in this example, it does look nice to see it sorted by table so we can clearly see the same table is getting archived among all cells. Whereas if we sorted by cell first, it would be harder to determine whether all our block_device_mapping are being archived, for example.\n\nBut in the gate run, it does look quite jumbled. So maybe it would be overall better to sort by cell name first.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":559,"context_line":"            def sort_func(item):"},{"line_number":560,"context_line":"                cell_name, table \u003d item[0].split(\u0027.\u0027)"},{"line_number":561,"context_line":"                return table, cell_name"},{"line_number":562,"context_line":"            print_sort_key \u003d sort_func"},{"line_number":563,"context_line":"        else:"},{"line_number":564,"context_line":"            cell_mappings \u003d [None]"},{"line_number":565,"context_line":"            print_sort_key \u003d None"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_5454aefe","line":562,"range":{"start_line":562,"start_character":12,"end_line":562,"end_character":26},"updated":"2019-08-07 21:14:05.000000000","message":"nit: Should this be called print_sort_func?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":559,"context_line":"            def sort_func(item):"},{"line_number":560,"context_line":"                cell_name, table \u003d item[0].split(\u0027.\u0027)"},{"line_number":561,"context_line":"                return table, cell_name"},{"line_number":562,"context_line":"            print_sort_key \u003d sort_func"},{"line_number":563,"context_line":"        else:"},{"line_number":564,"context_line":"            cell_mappings \u003d [None]"},{"line_number":565,"context_line":"            print_sort_key \u003d None"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_1d890474","line":562,"range":{"start_line":562,"start_character":12,"end_line":562,"end_character":26},"in_reply_to":"7faddb67_5454aefe","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        total_rows_archived \u003d 0"},{"line_number":567,"context_line":"        for cell_mapping in cell_mappings:"},{"line_number":568,"context_line":"            if max_rows \u003e total_rows_archived:"},{"line_number":569,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":570,"context_line":"            else:"},{"line_number":571,"context_line":"                break"},{"line_number":572,"context_line":"            # If all_cells\u003dFalse, cell_mapping is None"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_921c7978","line":569,"updated":"2019-08-07 21:14:05.000000000","message":"Hmm, OK, so this is new. Let\u0027s say I\u0027m running with --all-cells and --until-complete, but haven\u0027t specified --max_rows, so by default it\u0027s going to archive in batches of 1000 until there is nothing more to archive.\n\nNow let\u0027s say I have these cells with number of archive-able records:\n\n* cell0: 500\n* cell1: 2000\n* cell2: 1500\n\nThat means I\u0027d have something like this for max_rows_to_archive, right?\n\n* cell0: single pass, archive 500 records, so max_rows_to_archive\u003d1000-500\u003d500.\n\n* cell1: it\u0027s going to iterate 4 times in batches of 500, right? Rather than 2 iterations of 1000?\n\n* cell2: since max_rows (1000) is not greater than total_rows_archived at this point (2500), max_rows_to_archive would still be 500 and we\u0027d iterate 3 times to archive cell2.\n\nI was wondering if we had a bug before with --max_rows and --until-complete, but we wouldn\u0027t because --until-complete means keep going until there is nothing more, which it still is, but the batch size is potentially different now.\n\nIt seems the logic here is trying to account for the case that --until-complete is *not* specified so we don\u0027t want to go over --max_rows when doing --all-cells, but shouldn\u0027t this logic not apply in the --until-complete case?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        total_rows_archived \u003d 0"},{"line_number":567,"context_line":"        for cell_mapping in cell_mappings:"},{"line_number":568,"context_line":"            if max_rows \u003e total_rows_archived:"},{"line_number":569,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":570,"context_line":"            else:"},{"line_number":571,"context_line":"                break"},{"line_number":572,"context_line":"            # If all_cells\u003dFalse, cell_mapping is None"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_9df5f4cd","line":569,"in_reply_to":"7faddb67_921c7978","updated":"2019-08-15 20:31:39.000000000","message":"Thanks for pointing this out. I had removed the until_complete condition based on comments on PS60, not realizing what Kevin\u0027s code comment was getting at. He wrote, \"No need to calculate limit for each cell if until_complete\u003dTrue\" but I didn\u0027t get the point that until_complete means there is no total limit, thus no need to pare it down to avoid exceeding the desired total. I\u0027ll put the logic back and add more words to the code comment to prevent me getting confused again.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":569,"context_line":"                max_rows_to_archive \u003d max_rows - total_rows_archived"},{"line_number":570,"context_line":"            else:"},{"line_number":571,"context_line":"                break"},{"line_number":572,"context_line":"            # If all_cells\u003dFalse, cell_mapping is None"},{"line_number":573,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":574,"context_line":"                cell_name \u003d cell_mapping.name if cell_mapping else None"},{"line_number":575,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_9216b9a7","line":572,"updated":"2019-08-07 21:14:05.000000000","message":"Looks a bit weird but yeah it works, None just means the context isn\u0027t targeted and we\u0027ll hit the local [database]/connection as before.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                total_rows_archived +\u003d rows_archived"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        if until_complete and verbose:"},{"line_number":591,"context_line":"            if not interrupt:"},{"line_number":592,"context_line":"                print(\u0027.\u0027 + _(\u0027complete\u0027))  # noqa"},{"line_number":593,"context_line":"            else:"},{"line_number":594,"context_line":"                print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":595,"context_line":""},{"line_number":596,"context_line":"        if verbose:"},{"line_number":597,"context_line":"            if table_to_rows_archived:"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_f42fda85","line":594,"range":{"start_line":591,"start_character":15,"end_line":594,"end_character":49},"updated":"2019-08-07 21:14:05.000000000","message":"nit: swap the order of these to avoid the negative \"not interrupt\" logic to make this easier to read.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                total_rows_archived +\u003d rows_archived"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        if until_complete and verbose:"},{"line_number":591,"context_line":"            if not interrupt:"},{"line_number":592,"context_line":"                print(\u0027.\u0027 + _(\u0027complete\u0027))  # noqa"},{"line_number":593,"context_line":"            else:"},{"line_number":594,"context_line":"                print(\u0027.\u0027 + _(\u0027stopped\u0027))  # noqa"},{"line_number":595,"context_line":""},{"line_number":596,"context_line":"        if verbose:"},{"line_number":597,"context_line":"            if table_to_rows_archived:"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_bdeeb01e","line":594,"range":{"start_line":591,"start_character":15,"end_line":594,"end_character":49},"in_reply_to":"7faddb67_f42fda85","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":610,"context_line":"        return int(bool(table_to_rows_archived))"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"    def _do_archive(self, table_to_rows_archived, deleted_instance_uuids,"},{"line_number":613,"context_line":"                    cctxt, max_rows, until_complete, verbose, before,"},{"line_number":614,"context_line":"                    cell_name):"},{"line_number":615,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_343b32c9","line":612,"updated":"2019-08-07 21:14:05.000000000","message":"Documenting this would be nice. Like, what goes into table_to_rows_archived and how are the keys defined since they have a special format (cell_name.table_name).","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":610,"context_line":"        return int(bool(table_to_rows_archived))"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"    def _do_archive(self, table_to_rows_archived, deleted_instance_uuids,"},{"line_number":613,"context_line":"                    cctxt, max_rows, until_complete, verbose, before,"},{"line_number":614,"context_line":"                    cell_name):"},{"line_number":615,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_78527b37","line":612,"in_reply_to":"7faddb67_343b32c9","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":615,"context_line":"        while True:"},{"line_number":616,"context_line":"            run, deleted_instance_uuids, total_rows_archived \u003d \\"},{"line_number":617,"context_line":"                db.archive_deleted_rows(cctxt, max_rows, before\u003dbefore)"},{"line_number":618,"context_line":"            for k, v in run.items():"},{"line_number":619,"context_line":"                if cell_name:"},{"line_number":620,"context_line":"                    k \u003d cell_name + \u0027.\u0027 + k"},{"line_number":621,"context_line":"                table_to_rows_archived.setdefault(k, 0)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_f444ba49","line":618,"range":{"start_line":618,"start_character":16,"end_line":618,"end_character":20},"updated":"2019-08-07 21:14:05.000000000","message":"nit: could we take this opportunity to self-document this a bit better with using proper variable names, like table_name and rows_archived?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":615,"context_line":"        while True:"},{"line_number":616,"context_line":"            run, deleted_instance_uuids, total_rows_archived \u003d \\"},{"line_number":617,"context_line":"                db.archive_deleted_rows(cctxt, max_rows, before\u003dbefore)"},{"line_number":618,"context_line":"            for k, v in run.items():"},{"line_number":619,"context_line":"                if cell_name:"},{"line_number":620,"context_line":"                    k \u003d cell_name + \u0027.\u0027 + k"},{"line_number":621,"context_line":"                table_to_rows_archived.setdefault(k, 0)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_3dec00f3","line":618,"range":{"start_line":618,"start_character":16,"end_line":618,"end_character":20},"in_reply_to":"7faddb67_f444ba49","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                    \u0027API_DB.request_specs\u0027, 0)"},{"line_number":628,"context_line":"                table_to_rows_archived.setdefault("},{"line_number":629,"context_line":"                    \u0027API_DB.instance_group_member\u0027, 0)"},{"line_number":630,"context_line":"                ctxt \u003d context.get_admin_context()"},{"line_number":631,"context_line":"                deleted_mappings \u003d objects.InstanceMappingList.destroy_bulk("},{"line_number":632,"context_line":"                            ctxt, deleted_instance_uuids)"},{"line_number":633,"context_line":"                table_to_rows_archived["}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_b478828f","line":630,"updated":"2019-08-07 21:14:05.000000000","message":"You can define this outside the while loop.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                    \u0027API_DB.request_specs\u0027, 0)"},{"line_number":628,"context_line":"                table_to_rows_archived.setdefault("},{"line_number":629,"context_line":"                    \u0027API_DB.instance_group_member\u0027, 0)"},{"line_number":630,"context_line":"                ctxt \u003d context.get_admin_context()"},{"line_number":631,"context_line":"                deleted_mappings \u003d objects.InstanceMappingList.destroy_bulk("},{"line_number":632,"context_line":"                            ctxt, deleted_instance_uuids)"},{"line_number":633,"context_line":"                table_to_rows_archived["}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_ddb60cfa","line":630,"in_reply_to":"7faddb67_b478828f","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":641,"context_line":"                        ctxt, deleted_instance_uuids))"},{"line_number":642,"context_line":"                table_to_rows_archived["},{"line_number":643,"context_line":"                    \u0027API_DB.instance_group_member\u0027] +\u003d deleted_group_members"},{"line_number":644,"context_line":"            if not until_complete or not run:"},{"line_number":645,"context_line":"                break"},{"line_number":646,"context_line":"            if verbose:"},{"line_number":647,"context_line":"                sys.stdout.write(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_34d7b252","line":644,"updated":"2019-08-07 21:14:05.000000000","message":"Could we add a comment for this? I know this wasn\u0027t documented before, but it would be helpful, something simple like:\n\n# If we\u0027re not archiving until there is nothing more to\n# archive, we have reached max_rows in this cell DB or\n# there was nothing to archive.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":641,"context_line":"                        ctxt, deleted_instance_uuids))"},{"line_number":642,"context_line":"                table_to_rows_archived["},{"line_number":643,"context_line":"                    \u0027API_DB.instance_group_member\u0027] +\u003d deleted_group_members"},{"line_number":644,"context_line":"            if not until_complete or not run:"},{"line_number":645,"context_line":"                break"},{"line_number":646,"context_line":"            if verbose:"},{"line_number":647,"context_line":"                sys.stdout.write(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_fda0a8a7","line":644,"in_reply_to":"7faddb67_34d7b252","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":645,"context_line":"                break"},{"line_number":646,"context_line":"            if verbose:"},{"line_number":647,"context_line":"                sys.stdout.write(\u0027.\u0027)"},{"line_number":648,"context_line":"        return total_rows_archived"},{"line_number":649,"context_line":""},{"line_number":650,"context_line":"    @args(\u0027--before\u0027, metavar\u003d\u0027\u003cbefore\u003e\u0027, dest\u003d\u0027before\u0027,"},{"line_number":651,"context_line":"          help\u003d\u0027If specified, purge rows from shadow tables that are older \u0027"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_b4d40249","line":648,"updated":"2019-08-07 21:14:05.000000000","message":"OK so this is keeping track of how many total records we\u0027ve archived across all cells. So if we came in here with max_rows\u003d1000 but the cell only archived 500, then we can continue to the next cell but only archive up to 1000-500\u003d500 more rows.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"59e346121ae50c3962d0ab86625917de789edb4a","unresolved":false,"context_lines":[{"line_number":574,"context_line":"            # limit because with until_complete\u003dTrue, we have no total limit."},{"line_number":575,"context_line":"            if until_complete:"},{"line_number":576,"context_line":"                max_rows_to_archive \u003d max_rows"},{"line_number":577,"context_line":"            elif not until_complete and max_rows \u003e total_rows_archived:"},{"line_number":578,"context_line":"                # We reduce the max rows to archive based on what we\u0027ve"},{"line_number":579,"context_line":"                # archived so far to avoid potentially exceeding the specified"},{"line_number":580,"context_line":"                # total limit."}],"source_content_type":"text/x-python","patch_set":68,"id":"7faddb67_39ad8930","line":577,"range":{"start_line":577,"start_character":17,"end_line":577,"end_character":35},"updated":"2019-08-21 18:49:29.000000000","message":"nit: this is redundant right? Meaning removing this and we have the same logic, e.g.:\n\nif False:\n   ...\nelif True and ...","commit_id":"01632dd156e5155190de815f451885c49c0cd0fc"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a63b5c6cdb0cadbf7bb1612e9b02b1ba32c9a238","unresolved":false,"context_lines":[{"line_number":574,"context_line":"            # limit because with until_complete\u003dTrue, we have no total limit."},{"line_number":575,"context_line":"            if until_complete:"},{"line_number":576,"context_line":"                max_rows_to_archive \u003d max_rows"},{"line_number":577,"context_line":"            elif not until_complete and max_rows \u003e total_rows_archived:"},{"line_number":578,"context_line":"                # We reduce the max rows to archive based on what we\u0027ve"},{"line_number":579,"context_line":"                # archived so far to avoid potentially exceeding the specified"},{"line_number":580,"context_line":"                # total limit."}],"source_content_type":"text/x-python","patch_set":68,"id":"7faddb67_5734c948","line":577,"range":{"start_line":577,"start_character":17,"end_line":577,"end_character":35},"in_reply_to":"7faddb67_39ad8930","updated":"2019-08-22 00:49:39.000000000","message":"Hm... yeah, seems so. At first I was thinking maybe we needed it because of the \u0027and\u0027 with the second condition, but yeah, in this case we should already know until_complete\u003dFalse if we\u0027re in the \u0027elif\u0027.","commit_id":"01632dd156e5155190de815f451885c49c0cd0fc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"59e346121ae50c3962d0ab86625917de789edb4a","unresolved":false,"context_lines":[{"line_number":617,"context_line":"        if table_to_rows_archived and purge:"},{"line_number":618,"context_line":"            if verbose:"},{"line_number":619,"context_line":"                print(_(\u0027Rows were archived, running purge...\u0027))"},{"line_number":620,"context_line":"            self.purge(purge_all\u003dTrue, verbose\u003dverbose, all_cells\u003dall_cells)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":623,"context_line":"        return int(bool(table_to_rows_archived))"}],"source_content_type":"text/x-python","patch_set":68,"id":"7faddb67_a49e2cb5","line":620,"updated":"2019-08-21 18:49:29.000000000","message":"This is a change in behavior, right? I mean, it makes sense that if you\u0027re going to proxy the purge as part of the archive call that we\u0027d proxy the --all-cells parameter as well, but I wasn\u0027t expecting this I guess. Maybe should be called out in the commit message. Do we have a test for this to make sure --all-cells is passed through to purge when --purge is provided to archive?","commit_id":"01632dd156e5155190de815f451885c49c0cd0fc"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"81dafd6181de7607bd85fd3a06fc8d5ce160cc8f","unresolved":false,"context_lines":[{"line_number":617,"context_line":"        if table_to_rows_archived and purge:"},{"line_number":618,"context_line":"            if verbose:"},{"line_number":619,"context_line":"                print(_(\u0027Rows were archived, running purge...\u0027))"},{"line_number":620,"context_line":"            self.purge(purge_all\u003dTrue, verbose\u003dverbose, all_cells\u003dall_cells)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":623,"context_line":"        return int(bool(table_to_rows_archived))"}],"source_content_type":"text/x-python","patch_set":68,"id":"7faddb67_bafe44ac","line":620,"in_reply_to":"7faddb67_1aaaf8d0","updated":"2019-08-22 01:13:40.000000000","message":"(later) I didn\u0027t find any test coverage for that case, so I will add it tomorrow. Aside: this patch is gigantic :(","commit_id":"01632dd156e5155190de815f451885c49c0cd0fc"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a63b5c6cdb0cadbf7bb1612e9b02b1ba32c9a238","unresolved":false,"context_lines":[{"line_number":617,"context_line":"        if table_to_rows_archived and purge:"},{"line_number":618,"context_line":"            if verbose:"},{"line_number":619,"context_line":"                print(_(\u0027Rows were archived, running purge...\u0027))"},{"line_number":620,"context_line":"            self.purge(purge_all\u003dTrue, verbose\u003dverbose, all_cells\u003dall_cells)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":623,"context_line":"        return int(bool(table_to_rows_archived))"}],"source_content_type":"text/x-python","patch_set":68,"id":"7faddb67_1aaaf8d0","line":620,"in_reply_to":"7faddb67_a49e2cb5","updated":"2019-08-22 00:49:39.000000000","message":"Yeah, agreed it makes sense to proxy it but I need to double check whether there\u0027s test coverage of this case. And I\u0027ll add a note in the commit message.","commit_id":"01632dd156e5155190de815f451885c49c0cd0fc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"59e346121ae50c3962d0ab86625917de789edb4a","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            cells"},{"line_number":645,"context_line":"        \"\"\""},{"line_number":646,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":647,"context_line":"        deleted_instance_uuids \u003d []"},{"line_number":648,"context_line":"        while True:"},{"line_number":649,"context_line":"            run, deleted_instance_uuids, total_rows_archived \u003d \\"},{"line_number":650,"context_line":"                db.archive_deleted_rows(cctxt, max_rows, before\u003dbefore_date)"}],"source_content_type":"text/x-python","patch_set":68,"id":"7faddb67_395b4954","line":647,"updated":"2019-08-21 18:49:29.000000000","message":"Why do we need this variable defined here? It\u0027s overwritten in the loop.","commit_id":"01632dd156e5155190de815f451885c49c0cd0fc"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a63b5c6cdb0cadbf7bb1612e9b02b1ba32c9a238","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            cells"},{"line_number":645,"context_line":"        \"\"\""},{"line_number":646,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":647,"context_line":"        deleted_instance_uuids \u003d []"},{"line_number":648,"context_line":"        while True:"},{"line_number":649,"context_line":"            run, deleted_instance_uuids, total_rows_archived \u003d \\"},{"line_number":650,"context_line":"                db.archive_deleted_rows(cctxt, max_rows, before\u003dbefore_date)"}],"source_content_type":"text/x-python","patch_set":68,"id":"7faddb67_faaefce4","line":647,"in_reply_to":"7faddb67_395b4954","updated":"2019-08-22 00:49:39.000000000","message":"Yeah, I\u0027m not sure if I did this or what. Will remove.","commit_id":"01632dd156e5155190de815f451885c49c0cd0fc"}],"nova/db/api.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"220198f9b229fc10bc44d7131daa93f78660fbcd","unresolved":false,"context_lines":[{"line_number":1986,"context_line":"def archive_deleted_rows(max_rows\u003dNone, context\u003dNone):"},{"line_number":1987,"context_line":"    \"\"\"Move up to max_rows rows from production tables to corresponding shadow"},{"line_number":1988,"context_line":"    tables."},{"line_number":1989,"context_line":""},{"line_number":1990,"context_line":"    :returns: dict that maps table name to number of rows archived from that"},{"line_number":1991,"context_line":"              table, for example:"},{"line_number":1992,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"df87a7cf_1477a1a2","line":1989,"updated":"2017-12-06 10:18:04.000000000","message":"nit: Worth adding descriptions for the parameters here (what they are and why they\u0027re needed).\n\nnit: Could you place context as the first argument here, seeing as this is the custom elsewhere","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1772,"context_line":"####################"},{"line_number":1773,"context_line":""},{"line_number":1774,"context_line":""},{"line_number":1775,"context_line":"def archive_deleted_rows(context\u003dNone, max_rows\u003dNone, before\u003dNone):"},{"line_number":1776,"context_line":"    \"\"\"Move up to max_rows rows from production tables to corresponding shadow"},{"line_number":1777,"context_line":"    tables."},{"line_number":1778,"context_line":"    :param:context: Request context"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_b4864265","line":1775,"range":{"start_line":1775,"start_character":54,"end_line":1775,"end_character":65},"updated":"2019-08-07 21:14:05.000000000","message":"Why not document this as well while you\u0027re adding new params to the docstring?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1778,"context_line":"    :param:context: Request context"},{"line_number":1779,"context_line":"    :param:max_rows: Maximum rows to archive"},{"line_number":1780,"context_line":""},{"line_number":1781,"context_line":"    :returns: dict that maps table name to number of rows archived from that"},{"line_number":1782,"context_line":"              table, for example:"},{"line_number":1783,"context_line":""},{"line_number":1784,"context_line":"    ::"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_d48e5e78","line":1781,"updated":"2019-08-07 21:14:05.000000000","message":"This is also incomplete. That\u0027s really a separate issue from this patch, but something we should cleanup at some point (could be a separate patch).","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"2aed8220b121e6c461cdeb620f8791173290b026","unresolved":false,"context_lines":[{"line_number":5994,"context_line":"def _archive_deleted_rows_for_table(tablename, max_rows):"},{"line_number":5995,"context_line":"    \"\"\"Move up to max_rows rows from one tables to the corresponding"},{"line_number":5996,"context_line":"    shadow table."},{"line_number":5997,"context_line":"    :param:context: Request context"},{"line_number":5998,"context_line":"    :param:max_rows: Maximum rows to archive"},{"line_number":5999,"context_line":""},{"line_number":6000,"context_line":"    :returns: number of rows archived"}],"source_content_type":"text/x-python","patch_set":26,"id":"df87a7cf_050d12a0","line":5997,"range":{"start_line":5997,"start_character":0,"end_line":5997,"end_character":35},"updated":"2017-12-07 05:44:24.000000000","message":"It should be removed.","commit_id":"928b3c4cdd6e0700b1345b85416e01d9f68102c8"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"131265fb7106d2d9129eceab62bd8fbdacbef54f","unresolved":false,"context_lines":[{"line_number":5994,"context_line":"def _archive_deleted_rows_for_table(tablename, max_rows):"},{"line_number":5995,"context_line":"    \"\"\"Move up to max_rows rows from one tables to the corresponding"},{"line_number":5996,"context_line":"    shadow table."},{"line_number":5997,"context_line":"    :param:context: Request context"},{"line_number":5998,"context_line":"    :param:max_rows: Maximum rows to archive"},{"line_number":5999,"context_line":""},{"line_number":6000,"context_line":"    :returns: number of rows archived"}],"source_content_type":"text/x-python","patch_set":26,"id":"df87a7cf_d671a20e","line":5997,"range":{"start_line":5997,"start_character":0,"end_line":5997,"end_character":35},"in_reply_to":"df87a7cf_050d12a0","updated":"2017-12-13 02:11:21.000000000","message":"Done","commit_id":"928b3c4cdd6e0700b1345b85416e01d9f68102c8"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"e76e10007ca18ca3c6bc9426ff0db9c85eb91b86","unresolved":false,"context_lines":[{"line_number":6084,"context_line":"def _archive_deleted_rows_for_table(tablename, max_rows):"},{"line_number":6085,"context_line":"    \"\"\"Move up to max_rows rows from one tables to the corresponding"},{"line_number":6086,"context_line":"    shadow table."},{"line_number":6087,"context_line":"    :param:context: Request context"},{"line_number":6088,"context_line":"    :param:max_rows: Maximum rows to archive"},{"line_number":6089,"context_line":""},{"line_number":6090,"context_line":"    :returns: number of rows archived"}],"source_content_type":"text/x-python","patch_set":30,"id":"3fa0c359_23f529cc","line":6087,"range":{"start_line":6087,"start_character":4,"end_line":6087,"end_character":35},"updated":"2018-02-05 06:18:37.000000000","message":"There is no \u0027context\u0027 argument in this method.","commit_id":"0267b57e15f64875cc6bfbbbfb9b0a16b6563368"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"2aab590f8422382bc8a3046f13e2868ecef3ca75","unresolved":false,"context_lines":[{"line_number":6084,"context_line":"def _archive_deleted_rows_for_table(tablename, max_rows):"},{"line_number":6085,"context_line":"    \"\"\"Move up to max_rows rows from one tables to the corresponding"},{"line_number":6086,"context_line":"    shadow table."},{"line_number":6087,"context_line":"    :param:context: Request context"},{"line_number":6088,"context_line":"    :param:max_rows: Maximum rows to archive"},{"line_number":6089,"context_line":""},{"line_number":6090,"context_line":"    :returns: number of rows archived"}],"source_content_type":"text/x-python","patch_set":30,"id":"3fa0c359_d7d99b22","line":6087,"range":{"start_line":6087,"start_character":4,"end_line":6087,"end_character":35},"in_reply_to":"3fa0c359_23f529cc","updated":"2018-02-05 09:37:08.000000000","message":"Done","commit_id":"0267b57e15f64875cc6bfbbbfb9b0a16b6563368"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":5883,"context_line":"    :param max_rows: Maximum rows to archive"},{"line_number":5884,"context_line":""},{"line_number":5885,"context_line":"    :returns: dict that maps table name to number of rows archived from that"},{"line_number":5886,"context_line":"              table, for example:"},{"line_number":5887,"context_line":""},{"line_number":5888,"context_line":"    ::"},{"line_number":5889,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_17b042f4","line":5886,"updated":"2018-03-08 17:46:04.000000000","message":"This was already out of date, but you\u0027re making it more out of date :)","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":5919,"context_line":"            table_to_rows_archived[tablename] \u003d rows_archived"},{"line_number":5920,"context_line":"        if total_rows_archived \u003e\u003d max_rows:"},{"line_number":5921,"context_line":"            break"},{"line_number":5922,"context_line":"    return table_to_rows_archived, deleted_instance_uuids, total_rows_archived"},{"line_number":5923,"context_line":""},{"line_number":5924,"context_line":""},{"line_number":5925,"context_line":"@pick_context_manager_writer"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_378a261b","line":5922,"range":{"start_line":5922,"start_character":59,"end_line":5922,"end_character":78},"updated":"2018-03-08 17:46:04.000000000","message":"We don\u0027t really need to return this right? The caller can easily do this:\n\n total \u003d sum(table_to_rows_archived.values())\n\nProbably worth not changing the return value I think. it\u0027s already kinda awkward the way it is.","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":5449,"context_line":""},{"line_number":5450,"context_line":"    :returns: number of rows archived"},{"line_number":5451,"context_line":"    \"\"\""},{"line_number":5452,"context_line":"    engine \u003d get_engine()"},{"line_number":5453,"context_line":"    conn \u003d engine.connect()"},{"line_number":5454,"context_line":"    metadata \u003d MetaData()"},{"line_number":5455,"context_line":"    metadata.bind \u003d engine"},{"line_number":5456,"context_line":"    # NOTE(tdurakov): table metadata should be received"},{"line_number":5457,"context_line":"    # from models, not db tables. Default value specified by SoftDeleteMixin"},{"line_number":5458,"context_line":"    # is known only by models, not DB layer."}],"source_content_type":"text/x-python","patch_set":60,"id":"dfbec78f_ce7978fc","line":5455,"range":{"start_line":5452,"start_character":4,"end_line":5455,"end_character":26},"updated":"2019-05-10 13:18:30.000000000","message":"so I tried this on devstack and it doesn\u0027t work for multi-cells because of this part. Although you fix the context stuff at L5579, this get_engine() part seems to be reading it from the nova.conf file which means the multi-cell queries are not even happening. I think you should have more functional test coverage to actually check if we are connecting to the cell dbs in reality. What I had to do to get this to work on my multi-cell devstack was to pass context into this function as well and do the same thing you did earlier, ie.\n\n get_engine(context\u003dcontext, use_slave\u003dTrue)\n\n-1 for this.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a336fe501b67aa5cdcaff51ddb6e287da1fec7a4","unresolved":false,"context_lines":[{"line_number":5449,"context_line":""},{"line_number":5450,"context_line":"    :returns: number of rows archived"},{"line_number":5451,"context_line":"    \"\"\""},{"line_number":5452,"context_line":"    engine \u003d get_engine()"},{"line_number":5453,"context_line":"    conn \u003d engine.connect()"},{"line_number":5454,"context_line":"    metadata \u003d MetaData()"},{"line_number":5455,"context_line":"    metadata.bind \u003d engine"},{"line_number":5456,"context_line":"    # NOTE(tdurakov): table metadata should be received"},{"line_number":5457,"context_line":"    # from models, not db tables. Default value specified by SoftDeleteMixin"},{"line_number":5458,"context_line":"    # is known only by models, not DB layer."}],"source_content_type":"text/x-python","patch_set":60,"id":"7faddb67_7518d2d2","line":5455,"range":{"start_line":5452,"start_character":4,"end_line":5455,"end_character":26},"in_reply_to":"dfbec78f_ce7978fc","updated":"2019-07-03 21:53:10.000000000","message":"Thanks for catching this problem. I\u0027m working on an update and enhanced test coverage.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4c7cb6763746ee824a98d626745d8559c44a97a6","unresolved":false,"context_lines":[{"line_number":5576,"context_line":"    table_to_rows_archived \u003d {}"},{"line_number":5577,"context_line":"    deleted_instance_uuids \u003d []"},{"line_number":5578,"context_line":"    total_rows_archived \u003d 0"},{"line_number":5579,"context_line":"    meta \u003d MetaData(get_engine(context\u003dcontext, use_slave\u003dTrue))"},{"line_number":5580,"context_line":"    meta.reflect()"},{"line_number":5581,"context_line":"    # Reverse sort the tables so we get the leaf nodes first for processing."},{"line_number":5582,"context_line":"    for table in reversed(meta.sorted_tables):"}],"source_content_type":"text/x-python","patch_set":60,"id":"dfbec78f_0e1d5065","line":5579,"updated":"2019-05-10 13:18:30.000000000","message":"so for the all_cells\u003dFalse case since we have use_slave\u003dTrue, it will pull it from the nova.conf like it used to (https://github.com/openstack/nova/blob/71b11292fb6c37b3854ba1bbfc00c729b4b5ecf4/nova/db/sqlalchemy/api.py#L100) and for all_cells\u003dTrue case this comes from the context.db_connection for each cell.","commit_id":"41ab6b201d481bf140f056bbeadaa54c2ecb916b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":5439,"context_line":""},{"line_number":5440,"context_line":"    :returns: number of rows archived"},{"line_number":5441,"context_line":"    \"\"\""},{"line_number":5442,"context_line":"    engine \u003d get_engine(context\u003dcontext, use_slave\u003dTrue)"},{"line_number":5443,"context_line":"    conn \u003d engine.connect()"},{"line_number":5444,"context_line":"    metadata \u003d MetaData()"},{"line_number":5445,"context_line":"    metadata.bind \u003d engine"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_54c90eaa","line":5442,"range":{"start_line":5442,"start_character":24,"end_line":5442,"end_character":55},"updated":"2019-08-07 21:14:05.000000000","message":"nit: I know these are kwargs but they are defined as (use_slave\u003dFalse, context\u003dNone), also, why are we setting use_slave\u003dTrue now? That seems unrelated to the --all-cells change. Maybe because on L5544 we use use_slave\u003dTrue?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":5520,"context_line":"    return rows_archived, deleted_instance_uuids"},{"line_number":5521,"context_line":""},{"line_number":5522,"context_line":""},{"line_number":5523,"context_line":"def archive_deleted_rows(context\u003dNone, max_rows\u003dNone, before\u003dNone):"},{"line_number":5524,"context_line":"    \"\"\"Move up to max_rows rows from production tables to the corresponding"},{"line_number":5525,"context_line":"    shadow tables."},{"line_number":5526,"context_line":"    :param context: Request context"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_b4eba210","line":5523,"updated":"2019-08-07 21:14:05.000000000","message":"same comment about docstrings","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":5541,"context_line":"    table_to_rows_archived \u003d {}"},{"line_number":5542,"context_line":"    deleted_instance_uuids \u003d []"},{"line_number":5543,"context_line":"    total_rows_archived \u003d 0"},{"line_number":5544,"context_line":"    meta \u003d MetaData(get_engine(context\u003dcontext, use_slave\u003dTrue))"},{"line_number":5545,"context_line":"    meta.reflect()"},{"line_number":5546,"context_line":"    # Reverse sort the tables so we get the leaf nodes first for processing."},{"line_number":5547,"context_line":"    for table in reversed(meta.sorted_tables):"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_f4b91a15","line":5544,"range":{"start_line":5544,"start_character":20,"end_line":5544,"end_character":30},"updated":"2019-08-07 21:14:05.000000000","message":"Could we just pass this engine into _archive_deleted_rows_for_table so _archive_deleted_rows_for_table doesn\u0027t need to build the engine facade again? Maybe that\u0027s something for a separate cleanup patch.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":5566,"context_line":"            table_to_rows_archived[tablename] \u003d rows_archived"},{"line_number":5567,"context_line":"        if total_rows_archived \u003e\u003d max_rows:"},{"line_number":5568,"context_line":"            break"},{"line_number":5569,"context_line":"    return table_to_rows_archived, deleted_instance_uuids, total_rows_archived"},{"line_number":5570,"context_line":""},{"line_number":5571,"context_line":""},{"line_number":5572,"context_line":"def _purgeable_tables(metadata):"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_14dab678","line":5569,"updated":"2019-08-07 21:14:05.000000000","message":"This is where it would be nice to document the returns in the docstring properly since I have to look at this sort code to understand how the nova-manage command works.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe155cf1312cd8b53d2868ef94fefa9b54a297ec","unresolved":false,"context_lines":[{"line_number":5569,"context_line":"    return rows_archived, deleted_instance_uuids"},{"line_number":5570,"context_line":""},{"line_number":5571,"context_line":""},{"line_number":5572,"context_line":"def archive_deleted_rows(context\u003dNone, max_rows\u003dNone, before\u003dNone):"},{"line_number":5573,"context_line":"    \"\"\"Move up to max_rows rows from production tables to the corresponding"},{"line_number":5574,"context_line":"    shadow tables."},{"line_number":5575,"context_line":""}],"source_content_type":"text/x-python","patch_set":67,"id":"7faddb67_06ede423","line":5572,"range":{"start_line":5572,"start_character":25,"end_line":5572,"end_character":32},"updated":"2019-08-20 14:50:14.000000000","message":"This isn\u0027t used at all. Is that why the verify patch on top is failing? It\u0027s just getting the engine below but not using the cell-targeted context to get the engine, which is the problem, right?","commit_id":"a571313928ec7e005ff39d896383e25e7a5c9bc9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b4413aae46fce543828d5838140ed716703d249c","unresolved":false,"context_lines":[{"line_number":5593,"context_line":"    table_to_rows_archived \u003d {}"},{"line_number":5594,"context_line":"    deleted_instance_uuids \u003d []"},{"line_number":5595,"context_line":"    total_rows_archived \u003d 0"},{"line_number":5596,"context_line":"    meta \u003d MetaData(get_engine(use_slave\u003dTrue))"},{"line_number":5597,"context_line":"    meta.reflect()"},{"line_number":5598,"context_line":"    # Reverse sort the tables so we get the leaf nodes first for processing."},{"line_number":5599,"context_line":"    for table in reversed(meta.sorted_tables):"}],"source_content_type":"text/x-python","patch_set":67,"id":"7faddb67_464c3c3e","line":5596,"updated":"2019-08-20 14:52:47.000000000","message":"In PS65 you had this:\n\nmeta \u003d MetaData(get_engine(context\u003dcontext, use_slave\u003dTrue))","commit_id":"a571313928ec7e005ff39d896383e25e7a5c9bc9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7d91581fbc375d4669609af86ea288edf2cde1c4","unresolved":false,"context_lines":[{"line_number":5593,"context_line":"    table_to_rows_archived \u003d {}"},{"line_number":5594,"context_line":"    deleted_instance_uuids \u003d []"},{"line_number":5595,"context_line":"    total_rows_archived \u003d 0"},{"line_number":5596,"context_line":"    meta \u003d MetaData(get_engine(use_slave\u003dTrue))"},{"line_number":5597,"context_line":"    meta.reflect()"},{"line_number":5598,"context_line":"    # Reverse sort the tables so we get the leaf nodes first for processing."},{"line_number":5599,"context_line":"    for table in reversed(meta.sorted_tables):"}],"source_content_type":"text/x-python","patch_set":67,"id":"7faddb67_c6b7cc84","line":5596,"in_reply_to":"7faddb67_464c3c3e","updated":"2019-08-20 15:12:16.000000000","message":"Argh, I messed this up somehow when I was addressing comments and didn\u0027t notice it. Sorry for wasting your time. :(","commit_id":"a571313928ec7e005ff39d896383e25e7a5c9bc9"}],"nova/tests/functional/db/test_archive.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                        \u0027No system_metadata for instance: %s\u0027 % server_id)"},{"line_number":93,"context_line":"        # Now try and archive the soft deleted records."},{"line_number":94,"context_line":"        results, deleted_instance_uuids, archived \u003d \\"},{"line_number":95,"context_line":"            db.archive_deleted_rows(max_rows\u003d100)"},{"line_number":96,"context_line":"        # verify system_metadata was dropped"},{"line_number":97,"context_line":"        self.assertIn(\u0027instance_system_metadata\u0027, results)"},{"line_number":98,"context_line":"        self.assertEqual(len(instance.system_metadata),"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_17892222","line":95,"updated":"2018-03-08 17:46:04.000000000","message":"^^ awkwardness :)","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"00ca238b400e9954f82821a4ce9f869d754a5879","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        self.assertTrue(len(instance.system_metadata),"},{"line_number":100,"context_line":"                        \u0027No system_metadata for instance: %s\u0027 % server_id)"},{"line_number":101,"context_line":"        # Now try and archive the soft deleted records."},{"line_number":102,"context_line":"        results, deleted_instance_uuids, archived \u003d \\"},{"line_number":103,"context_line":"            db.archive_deleted_rows(max_rows\u003d100)"},{"line_number":104,"context_line":"        # verify system_metadata was dropped"},{"line_number":105,"context_line":"        self.assertIn(\u0027instance_system_metadata\u0027, results)"}],"source_content_type":"text/x-python","patch_set":52,"id":"5f7c97a3_b0d141cf","line":102,"range":{"start_line":102,"start_character":41,"end_line":102,"end_character":49},"updated":"2018-06-19 06:25:45.000000000","message":"you should test the value of \u0027archived\u0027?","commit_id":"7f4d1b0336c57385e298c8a39862272e3d0ae836"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"cee2750151badf07339738a114409ed82d9e3d42","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        self.assertTrue(len(instance.system_metadata),"},{"line_number":100,"context_line":"                        \u0027No system_metadata for instance: %s\u0027 % server_id)"},{"line_number":101,"context_line":"        # Now try and archive the soft deleted records."},{"line_number":102,"context_line":"        results, deleted_instance_uuids, archived \u003d \\"},{"line_number":103,"context_line":"            db.archive_deleted_rows(max_rows\u003d100)"},{"line_number":104,"context_line":"        # verify system_metadata was dropped"},{"line_number":105,"context_line":"        self.assertIn(\u0027instance_system_metadata\u0027, results)"}],"source_content_type":"text/x-python","patch_set":52,"id":"5f7c97a3_6bd5f846","line":102,"range":{"start_line":102,"start_character":41,"end_line":102,"end_character":49},"in_reply_to":"5f7c97a3_b0d141cf","updated":"2018-06-19 06:43:19.000000000","message":"Done","commit_id":"7f4d1b0336c57385e298c8a39862272e3d0ae836"}],"nova/tests/functional/test_nova_manage.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1426,"context_line":""},{"line_number":1427,"context_line":""},{"line_number":1428,"context_line":"class TestDBArchiveDeletedRowsMultiCell(integrated_helpers.InstanceHelperMixin,"},{"line_number":1429,"context_line":"                                        test_servers.ServersTestBase):"},{"line_number":1430,"context_line":""},{"line_number":1431,"context_line":"    NUMBER_OF_CELLS \u003d 2"},{"line_number":1432,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_d46ade7f","line":1429,"range":{"start_line":1429,"start_character":40,"end_line":1429,"end_character":68},"updated":"2019-08-07 21:14:05.000000000","message":"Eww, generally I\u0027d avoid this as a base class because it has so much built-in setup like using CastAsCall and it\u0027s confusing implementation of _wait_for_state_change (compared to the one in InstanceHelperMixin).","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":1426,"context_line":""},{"line_number":1427,"context_line":""},{"line_number":1428,"context_line":"class TestDBArchiveDeletedRowsMultiCell(integrated_helpers.InstanceHelperMixin,"},{"line_number":1429,"context_line":"                                        test_servers.ServersTestBase):"},{"line_number":1430,"context_line":""},{"line_number":1431,"context_line":"    NUMBER_OF_CELLS \u003d 2"},{"line_number":1432,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_b9d9d583","line":1429,"range":{"start_line":1429,"start_character":40,"end_line":1429,"end_character":68},"in_reply_to":"7faddb67_d46ade7f","updated":"2019-08-15 20:31:39.000000000","message":"Bah humbug.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1436,"context_line":"        self.cli \u003d manage.DbCommands()"},{"line_number":1437,"context_line":"        self.output \u003d StringIO()"},{"line_number":1438,"context_line":"        self.useFixture(fixtures.MonkeyPatch(\u0027sys.stdout\u0027, self.output))"},{"line_number":1439,"context_line":"        # Start two compute services, one per cell"},{"line_number":1440,"context_line":"        self.compute1 \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027host1\u0027,"},{"line_number":1441,"context_line":"                                           cell\u003d\u0027cell1\u0027)"},{"line_number":1442,"context_line":"        self.compute2 \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027host2\u0027,"},{"line_number":1443,"context_line":"                                           cell\u003d\u0027cell2\u0027)"},{"line_number":1444,"context_line":"        # This is needed to find a server that is still booting with multiple"},{"line_number":1445,"context_line":"        # cells, while waiting for the state change to ACTIVE. See the"},{"line_number":1446,"context_line":"        # _get_instance method in the compute/api for details."}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_b40722ca","line":1443,"range":{"start_line":1439,"start_character":8,"end_line":1443,"end_character":56},"updated":"2019-08-07 21:14:05.000000000","message":"If you\u0027re going to extend ServersTestBase, then you should override and do this in _setup_compute_service. Anyway, another reason I don\u0027t like ServersTestBase (and _IntegratedTestBase really for that matter).","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"                                           cell\u003d\u0027cell1\u0027)"},{"line_number":1442,"context_line":"        self.compute2 \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027host2\u0027,"},{"line_number":1443,"context_line":"                                           cell\u003d\u0027cell2\u0027)"},{"line_number":1444,"context_line":"        # This is needed to find a server that is still booting with multiple"},{"line_number":1445,"context_line":"        # cells, while waiting for the state change to ACTIVE. See the"},{"line_number":1446,"context_line":"        # _get_instance method in the compute/api for details."},{"line_number":1447,"context_line":"        self.useFixture(nova_fixtures.AllServicesCurrent())"},{"line_number":1448,"context_line":""},{"line_number":1449,"context_line":"        # We need the admin api to work with aggregates"},{"line_number":1450,"context_line":"        self.admin_api \u003d self.api_fixture.admin_api"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_7411aa04","line":1447,"range":{"start_line":1444,"start_character":8,"end_line":1447,"end_character":59},"updated":"2019-08-07 21:14:05.000000000","message":"This looks like an old comment, we removed that service version code in _get_instance in I11083aa3c78bd8b6201558561457f3d65007a177.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"                                           cell\u003d\u0027cell1\u0027)"},{"line_number":1442,"context_line":"        self.compute2 \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027host2\u0027,"},{"line_number":1443,"context_line":"                                           cell\u003d\u0027cell2\u0027)"},{"line_number":1444,"context_line":"        # This is needed to find a server that is still booting with multiple"},{"line_number":1445,"context_line":"        # cells, while waiting for the state change to ACTIVE. See the"},{"line_number":1446,"context_line":"        # _get_instance method in the compute/api for details."},{"line_number":1447,"context_line":"        self.useFixture(nova_fixtures.AllServicesCurrent())"},{"line_number":1448,"context_line":""},{"line_number":1449,"context_line":"        # We need the admin api to work with aggregates"},{"line_number":1450,"context_line":"        self.admin_api \u003d self.api_fixture.admin_api"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_f95aedef","line":1447,"range":{"start_line":1444,"start_character":8,"end_line":1447,"end_character":59},"in_reply_to":"7faddb67_7411aa04","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1447,"context_line":"        self.useFixture(nova_fixtures.AllServicesCurrent())"},{"line_number":1448,"context_line":""},{"line_number":1449,"context_line":"        # We need the admin api to work with aggregates"},{"line_number":1450,"context_line":"        self.admin_api \u003d self.api_fixture.admin_api"},{"line_number":1451,"context_line":""},{"line_number":1452,"context_line":"        self.aggregates \u003d {}"},{"line_number":1453,"context_line":""}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_942b0632","line":1450,"updated":"2019-08-07 21:14:05.000000000","message":"nit: if you define ADMIN_API \u003d True in the class then self.api is the admin API.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1482,"context_line":""},{"line_number":1483,"context_line":"    def test_archive_deleted_rows(self):"},{"line_number":1484,"context_line":"        admin_context \u003d context.get_admin_context(read_deleted\u003d\u0027yes\u0027)"},{"line_number":1485,"context_line":"        # Create aggregates for cell1 and cell2"},{"line_number":1486,"context_line":"        self._create_aggregate(\u0027agg1_cell1\u0027)"},{"line_number":1487,"context_line":"        self._create_aggregate(\u0027agg2_cell2\u0027)"},{"line_number":1488,"context_line":"        # Add each cell to a separate aggregate"},{"line_number":1489,"context_line":"        self._add_host_to_aggregate(\u0027agg1_cell1\u0027, \u0027host1\u0027)"},{"line_number":1490,"context_line":"        self._add_host_to_aggregate(\u0027agg2_cell2\u0027, \u0027host2\u0027)"},{"line_number":1491,"context_line":"        # Set each cell to a separate availability zone"},{"line_number":1492,"context_line":"        self._set_az_aggregate(\u0027agg1_cell1\u0027, \u0027cell1\u0027)"},{"line_number":1493,"context_line":"        self._set_az_aggregate(\u0027agg2_cell2\u0027, \u0027cell2\u0027)"},{"line_number":1494,"context_line":"        # Boot a server to cell1"},{"line_number":1495,"context_line":"        server_ids \u003d {}"},{"line_number":1496,"context_line":"        server \u003d self._build_minimal_create_server_request("}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_742a0a2d","line":1493,"range":{"start_line":1485,"start_character":8,"end_line":1493,"end_character":53},"updated":"2019-08-07 21:14:05.000000000","message":"This could be a lot simpler by simply forcing each server to a specific host using the az\u003dnova:$host trick. Then we don\u0027t need to mess with aggregates and AZs in this test. You\u0027ll bypass filters in the scheduler but I don\u0027t think that matters for this test does it?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":1482,"context_line":""},{"line_number":1483,"context_line":"    def test_archive_deleted_rows(self):"},{"line_number":1484,"context_line":"        admin_context \u003d context.get_admin_context(read_deleted\u003d\u0027yes\u0027)"},{"line_number":1485,"context_line":"        # Create aggregates for cell1 and cell2"},{"line_number":1486,"context_line":"        self._create_aggregate(\u0027agg1_cell1\u0027)"},{"line_number":1487,"context_line":"        self._create_aggregate(\u0027agg2_cell2\u0027)"},{"line_number":1488,"context_line":"        # Add each cell to a separate aggregate"},{"line_number":1489,"context_line":"        self._add_host_to_aggregate(\u0027agg1_cell1\u0027, \u0027host1\u0027)"},{"line_number":1490,"context_line":"        self._add_host_to_aggregate(\u0027agg2_cell2\u0027, \u0027host2\u0027)"},{"line_number":1491,"context_line":"        # Set each cell to a separate availability zone"},{"line_number":1492,"context_line":"        self._set_az_aggregate(\u0027agg1_cell1\u0027, \u0027cell1\u0027)"},{"line_number":1493,"context_line":"        self._set_az_aggregate(\u0027agg2_cell2\u0027, \u0027cell2\u0027)"},{"line_number":1494,"context_line":"        # Boot a server to cell1"},{"line_number":1495,"context_line":"        server_ids \u003d {}"},{"line_number":1496,"context_line":"        server \u003d self._build_minimal_create_server_request("}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_d9c7f197","line":1493,"range":{"start_line":1485,"start_character":8,"end_line":1493,"end_character":53},"in_reply_to":"7faddb67_742a0a2d","updated":"2019-08-15 20:31:39.000000000","message":"Yeah, that would work.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":1527,"context_line":"                objects.Instance.get_by_uuid(cctxt, server_id)"},{"line_number":1528,"context_line":"        # Archive the deleted rows"},{"line_number":1529,"context_line":"        self.cli.archive_deleted_rows(verbose\u003dTrue, all_cells\u003dTrue)"},{"line_number":1530,"context_line":"        # Three instances should have been archived (cell0, cell1, cell2)"},{"line_number":1531,"context_line":"        self.assertRegex(self.output.getvalue(),"},{"line_number":1532,"context_line":"                         r\"| cell0\\.instances.*\\| 1.*\")"},{"line_number":1533,"context_line":"        self.assertRegex(self.output.getvalue(),"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_34c6d24b","line":1530,"updated":"2019-08-07 21:14:05.000000000","message":"I guess the unit test covers this as well, but seems like it would be nice to make sure we have output for the API_DB and archiving instance_mappings and request_specs as well (should have 3 for each). I just trust functional tests more than unit tests for this kind of stuff.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":1527,"context_line":"                objects.Instance.get_by_uuid(cctxt, server_id)"},{"line_number":1528,"context_line":"        # Archive the deleted rows"},{"line_number":1529,"context_line":"        self.cli.archive_deleted_rows(verbose\u003dTrue, all_cells\u003dTrue)"},{"line_number":1530,"context_line":"        # Three instances should have been archived (cell0, cell1, cell2)"},{"line_number":1531,"context_line":"        self.assertRegex(self.output.getvalue(),"},{"line_number":1532,"context_line":"                         r\"| cell0\\.instances.*\\| 1.*\")"},{"line_number":1533,"context_line":"        self.assertRegex(self.output.getvalue(),"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_aeb8a610","line":1530,"in_reply_to":"7faddb67_34c6d24b","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"}],"nova/tests/unit/test_nova_manage.py":[{"author":{"_account_id":19853,"name":"Nguyen Hung Phuong","email":"phuongnh@vn.fujitsu.com","username":"phuongnh"},"change_message_id":"9629ad3ae96f028bab40a95c68d4fe461da36220","unresolved":false,"context_lines":[{"line_number":561,"context_line":"    def test_archive_deleted_rows_and_instance_mappings_and_request_specs(self,"},{"line_number":562,"context_line":"                                mock_destroy, mock_db_archive, verbose\u003dTrue):"},{"line_number":563,"context_line":"        cell_uuid \u003d uuidutils.generate_uuid()"},{"line_number":564,"context_line":"        cell_mapping \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":565,"context_line":"                                            uuid\u003dcell_uuid,"},{"line_number":566,"context_line":"                                            database_connection\u003d\u0027fake:///db\u0027,"},{"line_number":567,"context_line":"                                            transport_url\u003d\u0027fake:///mq\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"ff82abbf_2ffab174","line":564,"range":{"start_line":564,"start_character":51,"end_line":564,"end_character":55},"updated":"2017-11-22 07:31:25.000000000","message":"ctxt is removed already?","commit_id":"baaadad5fb8f8ee9d1e0239c1883c18e79192dc2"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"8ca359eb1b0f9f126287c30472e4141de430c7b1","unresolved":false,"context_lines":[{"line_number":561,"context_line":"    def test_archive_deleted_rows_and_instance_mappings_and_request_specs(self,"},{"line_number":562,"context_line":"                                mock_destroy, mock_db_archive, verbose\u003dTrue):"},{"line_number":563,"context_line":"        cell_uuid \u003d uuidutils.generate_uuid()"},{"line_number":564,"context_line":"        cell_mapping \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":565,"context_line":"                                            uuid\u003dcell_uuid,"},{"line_number":566,"context_line":"                                            database_connection\u003d\u0027fake:///db\u0027,"},{"line_number":567,"context_line":"                                            transport_url\u003d\u0027fake:///mq\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"ff82abbf_ef2129fd","line":564,"range":{"start_line":564,"start_character":51,"end_line":564,"end_character":55},"in_reply_to":"ff82abbf_2ffab174","updated":"2017-11-22 07:33:04.000000000","message":"It uses the ctxt set in set_up","commit_id":"baaadad5fb8f8ee9d1e0239c1883c18e79192dc2"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"b22fc4f3fc366da1d0b942a56a44e40b6349ecde","unresolved":false,"context_lines":[{"line_number":561,"context_line":"    def test_archive_deleted_rows_and_instance_mappings_and_request_specs(self,"},{"line_number":562,"context_line":"                                mock_destroy, mock_db_archive, verbose\u003dTrue):"},{"line_number":563,"context_line":"        cell_uuid \u003d uuidutils.generate_uuid()"},{"line_number":564,"context_line":"        cell_mapping \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":565,"context_line":"                                            uuid\u003dcell_uuid,"},{"line_number":566,"context_line":"                                            database_connection\u003d\u0027fake:///db\u0027,"},{"line_number":567,"context_line":"                                            transport_url\u003d\u0027fake:///mq\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"ff82abbf_c4a1a7ab","line":564,"range":{"start_line":564,"start_character":51,"end_line":564,"end_character":55},"in_reply_to":"ff82abbf_ef2129fd","updated":"2017-11-22 08:29:40.000000000","message":"Ah, I misread some lines.","commit_id":"baaadad5fb8f8ee9d1e0239c1883c18e79192dc2"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4348223041c68cba6fbbcfe6f3c20355b866745a","unresolved":false,"context_lines":[{"line_number":425,"context_line":"| Table     | Number of Rows Archived |"},{"line_number":426,"context_line":"+-----------+-------------------------+"},{"line_number":427,"context_line":"| consoles  | 15                      |"},{"line_number":428,"context_line":"| instances | 30                      |"},{"line_number":429,"context_line":"+-----------+-------------------------+"},{"line_number":430,"context_line":"\u0027\u0027\u0027"},{"line_number":431,"context_line":"        self.assertEqual(expected, output)"}],"source_content_type":"text/x-python","patch_set":31,"id":"3fa0c359_32000d35","line":428,"updated":"2018-02-05 10:15:32.000000000","message":"I\u0027m not sold on why we archive three times the number of instances if we only have two cells (wrt what _test_archive_deleted_rows returns us).\n\nI guess it\u0027s because we have cell0, but then why should we archive those and return the output to the user ? That looks confusing to me.\n\nAlso, I wonder, some operators could ask to get the number archive rows *per cell*, and not something munged between all the cells.","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":420,"context_line":"| Table     | Number of Rows Archived |"},{"line_number":421,"context_line":"+-----------+-------------------------+"},{"line_number":422,"context_line":"| consoles  | 10                      |"},{"line_number":423,"context_line":"| instances | 20                      |"},{"line_number":424,"context_line":"+-----------+-------------------------+"},{"line_number":425,"context_line":"\u0027\u0027\u0027"},{"line_number":426,"context_line":"        self.assertEqual(expected, output)"}],"source_content_type":"text/x-python","patch_set":36,"id":"ff6b8bd7_d0b74086","line":423,"updated":"2018-03-06 19:30:14.000000000","message":"This is merged across all cells now, right? That\u0027s probably not what people will want to see. I think you probably need to namespace these to $cell_name.$table_name.","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"5313cc4eb6046e92c1074a1d3270a1a036de3507","unresolved":false,"context_lines":[{"line_number":420,"context_line":"| Table     | Number of Rows Archived |"},{"line_number":421,"context_line":"+-----------+-------------------------+"},{"line_number":422,"context_line":"| consoles  | 10                      |"},{"line_number":423,"context_line":"| instances | 20                      |"},{"line_number":424,"context_line":"+-----------+-------------------------+"},{"line_number":425,"context_line":"\u0027\u0027\u0027"},{"line_number":426,"context_line":"        self.assertEqual(expected, output)"}],"source_content_type":"text/x-python","patch_set":36,"id":"df7087c5_e293bc5b","line":423,"in_reply_to":"ff6b8bd7_d0b74086","updated":"2018-03-07 02:13:25.000000000","message":"Done","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9c158a8c6132d38d0291a32b8d1716ee1f4cc717","unresolved":false,"context_lines":[{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    @mock.patch.object(objects.CellMappingList, \u0027get_all\u0027,"},{"line_number":435,"context_line":"                       side_effect\u003ddb_exc.CantStartEngineError)"},{"line_number":436,"context_line":"    def test_archive_deleted_rows_all_cells_falure(self,"},{"line_number":437,"context_line":"                                                   mock_cell_mapping_get):"},{"line_number":438,"context_line":"        result \u003d self.commands.archive_deleted_rows(20, verbose\u003dTrue,"},{"line_number":439,"context_line":"                                                    all_cells\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_77773e3c","line":436,"range":{"start_line":436,"start_character":44,"end_line":436,"end_character":50},"updated":"2018-03-08 17:46:04.000000000","message":"\"failure\"","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"92db058bdb71bafeb841c4eb2ba2d0a258c82cf5","unresolved":false,"context_lines":[{"line_number":560,"context_line":"        cell_mapping \u003d objects.CellMapping(context\u003dctxt,"},{"line_number":561,"context_line":"                                           uuid\u003dcell_uuid,"},{"line_number":562,"context_line":"                                           database_connection\u003d\u0027fake:///db\u0027,"},{"line_number":563,"context_line":"                                           transport_url\u003d\u0027fake:///mq\u0027)"},{"line_number":564,"context_line":"        cell_mapping.create()"},{"line_number":565,"context_line":"        uuids \u003d []"},{"line_number":566,"context_line":"        for i in range(2):"}],"source_content_type":"text/x-python","patch_set":40,"id":"df7087c5_2ff08667","line":563,"updated":"2018-03-08 22:59:56.000000000","message":"While good, this is unnecessary whitespace damage that should be in a separate patch.","commit_id":"a53aa0fad877527247351d54affaea2dc32d83ec"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    @mock.patch.object(db, \u0027archive_deleted_rows\u0027,"},{"line_number":399,"context_line":"                       return_value\u003d(dict(instances\u003d10, consoles\u003d5),"},{"line_number":400,"context_line":"                                     list(), 15))"},{"line_number":401,"context_line":"    def test_archive_deleted_rows_all_cells(self, mock_db_archive):"},{"line_number":402,"context_line":"        cell_dbs \u003d nova_fixtures.CellDatabases()"},{"line_number":403,"context_line":"        cell_dbs.add_cell_database(\u0027fake:///db1\u0027)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_147b9629","line":400,"range":{"start_line":400,"start_character":45,"end_line":400,"end_character":47},"updated":"2019-08-07 21:14:05.000000000","message":"OK so each call to archive in each cell returns total_rows_archived\u003d15, which is why when you pass in max_rows\u003d30, you only iterate the first two cells. A comment would be useful.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    @mock.patch.object(db, \u0027archive_deleted_rows\u0027,"},{"line_number":399,"context_line":"                       return_value\u003d(dict(instances\u003d10, consoles\u003d5),"},{"line_number":400,"context_line":"                                     list(), 15))"},{"line_number":401,"context_line":"    def test_archive_deleted_rows_all_cells(self, mock_db_archive):"},{"line_number":402,"context_line":"        cell_dbs \u003d nova_fixtures.CellDatabases()"},{"line_number":403,"context_line":"        cell_dbs.add_cell_database(\u0027fake:///db1\u0027)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_8efe0aad","line":400,"range":{"start_line":400,"start_character":45,"end_line":400,"end_character":47},"in_reply_to":"7faddb67_147b9629","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        result \u003d self.commands.archive_deleted_rows(30, verbose\u003dTrue,"},{"line_number":431,"context_line":"                                                    all_cells\u003dTrue)"},{"line_number":432,"context_line":"        mock_db_archive.assert_has_calls(["},{"line_number":433,"context_line":"            mock.call(test.MatchType(context.RequestContext), 30, before\u003dNone),"},{"line_number":434,"context_line":"            mock.call(test.MatchType(context.RequestContext), 15, before\u003dNone)"},{"line_number":435,"context_line":"        ])"},{"line_number":436,"context_line":"        output \u003d self.output.getvalue()"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_d4741e39","line":433,"updated":"2019-08-07 21:14:05.000000000","message":"Called with max_rows\u003d30 but only archived 15. So total is 15 and new max_rows is 15 for the next call in the 2nd cell.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"60d6551caf7cc39a4fc5bbf32d6fb305e06f0b21","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    @mock.patch.object(objects.CellMappingList, \u0027get_all\u0027,"},{"line_number":451,"context_line":"                       side_effect\u003ddb_exc.CantStartEngineError)"},{"line_number":452,"context_line":"    def test_archive_deleted_rows_all_cells_falure(self,"},{"line_number":453,"context_line":"                                                   mock_cell_mapping_get):"},{"line_number":454,"context_line":"        result \u003d self.commands.archive_deleted_rows(20, verbose\u003dTrue,"},{"line_number":455,"context_line":"                                                    all_cells\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_1c39343e","line":452,"range":{"start_line":452,"start_character":44,"end_line":452,"end_character":50},"updated":"2019-07-26 16:45:01.000000000","message":"failure","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        expected \u003d \u0027\u0027\u0027\\"},{"line_number":458,"context_line":"Failed to connect to API DB so aborting this archival attempt. \\"},{"line_number":459,"context_line":"Please check your config file to make sure that \\"},{"line_number":460,"context_line":"CONF.api_database.connection is set and run this command again."},{"line_number":461,"context_line":"\u0027\u0027\u0027"},{"line_number":462,"context_line":"        self.assertEqual(expected, output)"},{"line_number":463,"context_line":"        self.assertEqual(3, result)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_14a07691","line":460,"range":{"start_line":460,"start_character":0,"end_line":460,"end_character":4},"updated":"2019-08-07 21:14:05.000000000","message":"Ugh - again we should burn this from user-facing messages/docs.\n\nAlso, isn\u0027t there already a test for this (this \u003d the no API DB configured case)?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        expected \u003d \u0027\u0027\u0027\\"},{"line_number":458,"context_line":"Failed to connect to API DB so aborting this archival attempt. \\"},{"line_number":459,"context_line":"Please check your config file to make sure that \\"},{"line_number":460,"context_line":"CONF.api_database.connection is set and run this command again."},{"line_number":461,"context_line":"\u0027\u0027\u0027"},{"line_number":462,"context_line":"        self.assertEqual(expected, output)"},{"line_number":463,"context_line":"        self.assertEqual(3, result)"}],"source_content_type":"text/x-python","patch_set":65,"id":"7faddb67_8e17eaee","line":460,"range":{"start_line":460,"start_character":0,"end_line":460,"end_character":4},"in_reply_to":"7faddb67_14a07691","updated":"2019-08-15 20:31:39.000000000","message":"Yeah, looks like a dupe. Will remove.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"}],"releasenotes/notes/archive-db-from-all-cells-b4775b3f1feb004e.yaml":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6d7149cd0d0bce643f2fe1598aabceda1afea293","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Support for archiving deleted rows from the database across"},{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. The ``--all-cells`` option run the process across all"},{"line_number":7,"context_line":"    existing cells."}],"source_content_type":"text/x-yaml","patch_set":24,"id":"df87a7cf_2d8b741f","line":7,"range":{"start_line":6,"start_character":13,"end_line":7,"end_character":19},"updated":"2017-12-06 12:33:52.000000000","message":"Specify the ``--all-cells`` option to run the process across all existing cells.","commit_id":"1d99e22518bf48dedd62d7cb117500ede08fad1d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4348223041c68cba6fbbcfe6f3c20355b866745a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Support for archiving deleted rows from the database across"},{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells."}],"source_content_type":"text/x-yaml","patch_set":31,"id":"3fa0c359_32e32d08","line":7,"updated":"2018-02-05 10:15:32.000000000","message":"You should mention that it only works from a node where it\u0027s possible to query all the MQs and all the children DBs, which shouldn\u0027t be possible for a child cell node from a security point.","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"2f2af97168eb2934ef62a35825869117be8e27b3","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Support for archiving deleted rows from the database across"},{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells."}],"source_content_type":"text/x-yaml","patch_set":31,"id":"3fa0c359_4d341e4b","line":7,"in_reply_to":"3fa0c359_32e32d08","updated":"2018-02-05 10:54:26.000000000","message":"Done","commit_id":"582c82f4e03112433bac4967cc31c6821c092bca"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Support for archiving deleted rows from the database across"},{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells. It is only possibe to archive all DBs from a node where"},{"line_number":8,"context_line":"    it is connect to API_DB nad possible to query all the MQs and all the"},{"line_number":9,"context_line":"    cell DBs."}],"source_content_type":"text/x-yaml","patch_set":36,"id":"ff6b8bd7_f03fe4d3","line":7,"range":{"start_line":7,"start_character":31,"end_line":7,"end_character":38},"updated":"2018-03-06 19:30:14.000000000","message":"possible","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells. It is only possibe to archive all DBs from a node where"},{"line_number":8,"context_line":"    it is connect to API_DB nad possible to query all the MQs and all the"},{"line_number":9,"context_line":"    cell DBs."}],"source_content_type":"text/x-yaml","patch_set":36,"id":"ff6b8bd7_1063781c","line":8,"range":{"start_line":8,"start_character":28,"end_line":8,"end_character":31},"updated":"2018-03-06 19:30:14.000000000","message":"\"and\"","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells. It is only possibe to archive all DBs from a node where"},{"line_number":8,"context_line":"    it is connect to API_DB nad possible to query all the MQs and all the"},{"line_number":9,"context_line":"    cell DBs."}],"source_content_type":"text/x-yaml","patch_set":36,"id":"ff6b8bd7_d0450072","line":8,"range":{"start_line":8,"start_character":4,"end_line":8,"end_character":17},"updated":"2018-03-06 19:30:14.000000000","message":"It is able to connect to the","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"50cd50dfeacf1b3b9a453480c88a28d6729e7cd9","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells. It is only possibe to archive all DBs from a node where"},{"line_number":8,"context_line":"    it is connect to API_DB nad possible to query all the MQs and all the"},{"line_number":9,"context_line":"    cell DBs."}],"source_content_type":"text/x-yaml","patch_set":36,"id":"ff6b8bd7_1031380c","line":8,"range":{"start_line":8,"start_character":50,"end_line":8,"end_character":61},"updated":"2018-03-06 19:30:14.000000000","message":"There is no MQ access needed for this.","commit_id":"4a7c01e290e899bc7e9c617b711169d147ac0bfd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells. It is only possible to archive all DBs from a node where"},{"line_number":8,"context_line":"    it is able to connect to the API_DB and possible to query and all the cell"},{"line_number":9,"context_line":"    DBs."}],"source_content_type":"text/x-yaml","patch_set":65,"id":"7faddb67_f4bfdaa7","line":8,"range":{"start_line":8,"start_character":33,"end_line":8,"end_character":39},"updated":"2019-08-07 21:14:05.000000000","message":"This looks like a variable...probably say \"API database\" or somehow work in the [api_database]/connection config option wording.","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"118c5f9f2da6e51875cf75d82286bcd535d4d6c8","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells. It is only possible to archive all DBs from a node where"},{"line_number":8,"context_line":"    it is able to connect to the API_DB and possible to query and all the cell"},{"line_number":9,"context_line":"    DBs."}],"source_content_type":"text/x-yaml","patch_set":65,"id":"7faddb67_94da261b","line":8,"range":{"start_line":8,"start_character":62,"end_line":8,"end_character":65},"updated":"2019-08-07 21:14:05.000000000","message":"nix?","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b86bf9eaaba10c99f7271cf609f1ab3d04bcffd6","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    all cells has been added to the ``nova-manage db archive_deleted_rows``"},{"line_number":6,"context_line":"    command. Specify the ``--all-cells`` option to run the process across all"},{"line_number":7,"context_line":"    existing cells. It is only possible to archive all DBs from a node where"},{"line_number":8,"context_line":"    it is able to connect to the API_DB and possible to query and all the cell"},{"line_number":9,"context_line":"    DBs."}],"source_content_type":"text/x-yaml","patch_set":65,"id":"7faddb67_2eb91678","line":8,"range":{"start_line":8,"start_character":33,"end_line":8,"end_character":39},"in_reply_to":"7faddb67_f4bfdaa7","updated":"2019-08-15 20:31:39.000000000","message":"Done","commit_id":"9793a2fb3d039a7ca8654298e3be04d8c1ff08c6"}]}
