)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1e21d8dcf1b54df8b02a417abe58078a93e3a1de","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Execute TargetDBSetupTask"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds the code to CrossCellMigrationTask which"},{"line_number":10,"context_line":"executes the TargetDBSetupTask sub-task and stores"},{"line_number":11,"context_line":"some fields on the main task for use later when"},{"line_number":12,"context_line":"dealing with the target cell."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"7faddb67_993d282e","line":10,"range":{"start_line":10,"start_character":39,"end_line":10,"end_character":40},"updated":"2019-08-13 14:50:17.000000000","message":"first added in change I30916d8d10d70ce25523fa4961007cedbdfe8ad7","commit_id":"1387180524c1f7e14dbb5b5775011ede0a516860"}],"nova/conductor/tasks/cross_cell_migrate.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b18a82adcfd962b859d02fdd81c47dcacac6fda7","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            self.context, self.instance, self.migration,"},{"line_number":268,"context_line":"            self._target_cell_context)"},{"line_number":269,"context_line":"        self._target_cell_instance, target_cell_migration \u003d task.execute()"},{"line_number":270,"context_line":"        self._completed_tasks[\u0027TargetDBSetupTask\u0027] \u003d task"},{"line_number":271,"context_line":"        return target_cell_migration"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def _perform_external_api_checks(self):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_43d6fec5","line":270,"updated":"2019-06-05 12:22:15.000000000","message":"Hm, if task.execute() fails, then TargetDBSetupTask wont be in the list of subtasks that needs to be rolled back. But task.execute() can fail after it created already in the target cell database and that needs to be cleaned up.","commit_id":"241b95c52e053ded7e81414835f62d43ba452fd3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7410498424f724d03c7544d2eb8eeeb82a683529","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            self.context, self.instance, self.migration,"},{"line_number":268,"context_line":"            self._target_cell_context)"},{"line_number":269,"context_line":"        self._target_cell_instance, target_cell_migration \u003d task.execute()"},{"line_number":270,"context_line":"        self._completed_tasks[\u0027TargetDBSetupTask\u0027] \u003d task"},{"line_number":271,"context_line":"        return target_cell_migration"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def _perform_external_api_checks(self):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_d2758365","line":270,"in_reply_to":"9fb8cfa7_43d6fec5","updated":"2019-06-10 19:49:31.000000000","message":"TargetDBSetupTask will clean up after itself on failure - each subtask has its own rollback, so in the case of TargetDBSetupTask:\n\nhttps://review.opendev.org/#/c/627892/36/nova/conductor/tasks/cross_cell_migrate.py@173\n\nSo CrossCellMigrationTask doesn\u0027t really need to worry about rolling back that one.\n\nIn case it\u0027s not clear, each task\u0027s execute method is actually wrapping _execute and will trigger a rollback on failure:\n\nhttps://github.com/openstack/nova/blob/1316c1c2850d2f966f335b628f7f5fe88cef611c/nova/conductor/tasks/base.py#L38\n\nSo the _completed_tasks dict is keeping track of successfully completed tasks so that they can be rolled back explicitly if a task *after* them fails, e.g. let\u0027s say we do:\n\n* TargetDBSetupTask - ok\n* PrepResizeAtDestTask - ok\n* PrepResizeAtSourceTask - fails\n\nPrepResizeAtSourceTask will clean itself up because of its own rollback, but CrossCellMigrationTask will be in charge of rolling back PrepResizeAtDestTask and TargetDBSetupTask in reverse order of execution.","commit_id":"241b95c52e053ded7e81414835f62d43ba452fd3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"eb85f15034e0d82390368edd7f54012a598123b6","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            self.context, self.instance, self.migration,"},{"line_number":268,"context_line":"            self._target_cell_context)"},{"line_number":269,"context_line":"        self._target_cell_instance, target_cell_migration \u003d task.execute()"},{"line_number":270,"context_line":"        self._completed_tasks[\u0027TargetDBSetupTask\u0027] \u003d task"},{"line_number":271,"context_line":"        return target_cell_migration"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def _perform_external_api_checks(self):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_80c9ba59","line":270,"in_reply_to":"9fb8cfa7_d2758365","updated":"2019-06-13 13:15:12.000000000","message":"Thanks for the explanation. Now it make sense.","commit_id":"241b95c52e053ded7e81414835f62d43ba452fd3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1e21d8dcf1b54df8b02a417abe58078a93e3a1de","unresolved":false,"context_lines":[{"line_number":248,"context_line":"            if the scheduler just selected it)"},{"line_number":249,"context_line":"        \"\"\""},{"line_number":250,"context_line":"        return objects.CellMapping.get_by_uuid("},{"line_number":251,"context_line":"            self.context, self.host_selection.cell_uuid)"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def _setup_target_cell_db(self):"},{"line_number":254,"context_line":"        \"\"\"Creates the instance and its related records in the target cell"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_d912c062","line":251,"updated":"2019-08-13 14:50:17.000000000","message":"not sure if this is really worth spinning out, but that\u0027s a nit","commit_id":"1387180524c1f7e14dbb5b5775011ede0a516860"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2fef516964d7c89430758a4f76772479181f35f7","unresolved":false,"context_lines":[{"line_number":248,"context_line":"            if the scheduler just selected it)"},{"line_number":249,"context_line":"        \"\"\""},{"line_number":250,"context_line":"        return objects.CellMapping.get_by_uuid("},{"line_number":251,"context_line":"            self.context, self.host_selection.cell_uuid)"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def _setup_target_cell_db(self):"},{"line_number":254,"context_line":"        \"\"\"Creates the instance and its related records in the target cell"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_d2e8557d","line":251,"in_reply_to":"7faddb67_d912c062","updated":"2019-08-13 16:25:33.000000000","message":"The method was likely bigger in earlier iterations, or re-used elsewhere, I can\u0027t remember.","commit_id":"1387180524c1f7e14dbb5b5775011ede0a516860"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1e21d8dcf1b54df8b02a417abe58078a93e3a1de","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        \"\"\""},{"line_number":261,"context_line":"        LOG.debug(\u0027Setting up the target cell database for the instance and \u0027"},{"line_number":262,"context_line":"                  \u0027its related records.\u0027, instance\u003dself.instance)"},{"line_number":263,"context_line":"        target_cell_mapping \u003d self._get_target_cell_mapping()"},{"line_number":264,"context_line":"        # Clone the context targeted at the source cell and then target the"},{"line_number":265,"context_line":"        # clone at the target cell."},{"line_number":266,"context_line":"        self._target_cell_context \u003d copy.copy(self.context)"},{"line_number":267,"context_line":"        nova_context.set_target_cell("},{"line_number":268,"context_line":"            self._target_cell_context, target_cell_mapping)"},{"line_number":269,"context_line":"        task \u003d TargetDBSetupTask("},{"line_number":270,"context_line":"            self.context, self.instance, self.migration,"},{"line_number":271,"context_line":"            self._target_cell_context)"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_fc23eaa5","line":268,"range":{"start_line":263,"start_character":0,"end_line":268,"end_character":59},"updated":"2019-08-13 14:50:17.000000000","message":"If anything, all of this should have been separate, either with a function or just newlines before after to group it visually","commit_id":"1387180524c1f7e14dbb5b5775011ede0a516860"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1e21d8dcf1b54df8b02a417abe58078a93e3a1de","unresolved":false,"context_lines":[{"line_number":271,"context_line":"            self._target_cell_context)"},{"line_number":272,"context_line":"        self._target_cell_instance, target_cell_migration \u003d task.execute()"},{"line_number":273,"context_line":"        self._completed_tasks[\u0027TargetDBSetupTask\u0027] \u003d task"},{"line_number":274,"context_line":"        return target_cell_migration"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"    def _perform_external_api_checks(self):"},{"line_number":277,"context_line":"        \"\"\"Performs checks on external service APIs for support."}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_7c44da47","line":274,"range":{"start_line":274,"start_character":0,"end_line":274,"end_character":36},"updated":"2019-08-13 14:50:17.000000000","message":"Returned for tests, I\u0027m assuming (since we don\u0027t use this below)\n\nLater: yup https://review.opendev.org/#/c/633853/39/nova/tests/unit/conductor/tasks/test_cross_cell_migrate.py@483","commit_id":"1387180524c1f7e14dbb5b5775011ede0a516860"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2fef516964d7c89430758a4f76772479181f35f7","unresolved":false,"context_lines":[{"line_number":271,"context_line":"            self._target_cell_context)"},{"line_number":272,"context_line":"        self._target_cell_instance, target_cell_migration \u003d task.execute()"},{"line_number":273,"context_line":"        self._completed_tasks[\u0027TargetDBSetupTask\u0027] \u003d task"},{"line_number":274,"context_line":"        return target_cell_migration"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"    def _perform_external_api_checks(self):"},{"line_number":277,"context_line":"        \"\"\"Performs checks on external service APIs for support."}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_329769ee","line":274,"range":{"start_line":274,"start_character":0,"end_line":274,"end_character":36},"in_reply_to":"7faddb67_7c44da47","updated":"2019-08-13 16:25:33.000000000","message":"That and it\u0027s used later:\n\nhttps://review.opendev.org/#/c/627890/52/nova/conductor/tasks/cross_cell_migrate.py@559","commit_id":"1387180524c1f7e14dbb5b5775011ede0a516860"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2fef516964d7c89430758a4f76772479181f35f7","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        # cannot simply pass the source cell context and instance over RPC"},{"line_number":316,"context_line":"        # to the target compute host and assume changes get mirrored back to"},{"line_number":317,"context_line":"        # the source cell database."},{"line_number":318,"context_line":"        self._setup_target_cell_db()"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"    def rollback(self):"},{"line_number":321,"context_line":"        \"\"\"Rollback based on how sub-tasks completed"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_f2a0f144","line":318,"updated":"2019-08-13 16:25:33.000000000","message":"The return value isn\u0027t stored here but it\u0027s used later:\n\nhttps://review.opendev.org/#/c/627890/52/nova/conductor/tasks/cross_cell_migrate.py@559\n\nStoring the return value in a variable that isn\u0027t used is a pep8 violation.","commit_id":"1387180524c1f7e14dbb5b5775011ede0a516860"}]}
