)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bb86b9651eb23705f71cc5fb4551b9893aa0f788","unresolved":false,"context_lines":[{"line_number":4428,"context_line":""},{"line_number":4429,"context_line":""},{"line_number":4430,"context_line":"@pick_context_manager_reader"},{"line_number":4431,"context_line":"def migration_get_in_progress_by_instance(context, instance_uuid,"},{"line_number":4432,"context_line":"                                          migration_type\u003dNone):"},{"line_number":4433,"context_line":"    # TODO(Shaohe Feng) we should share the in-progress list."},{"line_number":4434,"context_line":"    # TODO(Shaohe Feng) will also summarize all status to a new"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_ab25b80a","line":4431,"range":{"start_line":4431,"start_character":4,"end_line":4431,"end_character":41},"updated":"2019-09-27 15:59:04.000000000","message":"Unrelated, but while we\u0027re looking, and I think this came up in IRC discussion, this method is used by the API (GET /servers/{server_id}/migrations) to list in-progress live migrations. The method we\u0027re changing above is only used by the resource tracker.\n\nFor this method, \u0027accepted\u0027 should probably be in the list since it\u0027s a live migration status. The method is likely biased to what the API lists so that you can abort or force-complete an in-progress live migration. I\u0027m not sure if \u0027accepted\u0027 is really any different from \u0027queued\u0027 except for where it\u0027s set (former in conductor, latter in compute). The semantics for what you can do with those are probably different in the API though (maybe you can\u0027t cancel an \"accepted\" live migration, but seems you should be able to and this was probably just an oversight).\n\nAnyway, in a follow up change it would probably be beneficial to document where/how this is used and how it\u0027s tightly coupled to API behavior so we\u0027d have to be careful about ever changing this one.","commit_id":"6ec686c26b2c8b18bcff522633bfe9715e0feec3"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"0a33486945c7a4ad2303c3639e0c5b49a86cd8aa","unresolved":false,"context_lines":[{"line_number":4428,"context_line":""},{"line_number":4429,"context_line":""},{"line_number":4430,"context_line":"@pick_context_manager_reader"},{"line_number":4431,"context_line":"def migration_get_in_progress_by_instance(context, instance_uuid,"},{"line_number":4432,"context_line":"                                          migration_type\u003dNone):"},{"line_number":4433,"context_line":"    # TODO(Shaohe Feng) we should share the in-progress list."},{"line_number":4434,"context_line":"    # TODO(Shaohe Feng) will also summarize all status to a new"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_49068c22","line":4431,"range":{"start_line":4431,"start_character":4,"end_line":4431,"end_character":41},"in_reply_to":"3fa7e38b_ab25b80a","updated":"2019-09-27 17:45:46.000000000","message":"\u003e Unrelated, but while we\u0027re looking, and I think this came up in IRC\n \u003e discussion, this method is used by the API (GET /servers/{server_id}/migrations)\n \u003e to list in-progress live migrations. The method we\u0027re changing\n \u003e above is only used by the resource tracker.\n\nYeah, Sean brought this up on IRC. This is all correct - this method is only used by that server_migrations API, while the previous one is only used by the resource tracker.\n\n \u003e For this method, \u0027accepted\u0027 should probably be in the list since\n \u003e it\u0027s a live migration status. The method is likely biased to what\n \u003e the API lists so that you can abort or force-complete an\n \u003e in-progress live migration. I\u0027m not sure if \u0027accepted\u0027 is really\n \u003e any different from \u0027queued\u0027 except for where it\u0027s set (former in\n \u003e conductor, latter in compute). The semantics for what you can do\n \u003e with those are probably different in the API though (maybe you\n \u003e can\u0027t cancel an \"accepted\" live migration, but seems you should be\n \u003e able to and this was probably just an oversight).\n\nI don\u0027t think the mechanics we currently have would allow us to cancel an accepted migration - to do so, we pop it off the \n_waiting_live_migrations dict [1], but we only put it there after we\u0027ve set it to \u0027queued\u0027 [2].\n \n \u003e Anyway, in a follow up change it would probably be beneficial to\n \u003e document where/how this is used and how it\u0027s tightly coupled to API\n \u003e behavior so we\u0027d have to be careful about ever changing this one.\n\nYeah - your todo on L4408 would be good to implement in general.\n\n[1] https://github.com/openstack/nova/blob/0ce66605e16aca85df97acdd8c459802fcdb9aa0/nova/compute/manager.py#L7185\n[2] https://github.com/openstack/nova/blob/0ce66605e16aca85df97acdd8c459802fcdb9aa0/nova/compute/manager.py#L7102","commit_id":"6ec686c26b2c8b18bcff522633bfe9715e0feec3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bb86b9651eb23705f71cc5fb4551b9893aa0f788","unresolved":false,"context_lines":[{"line_number":4437,"context_line":"            filter_by(instance_uuid\u003dinstance_uuid).\\"},{"line_number":4438,"context_line":"            filter(models.Migration.status.in_([\u0027queued\u0027, \u0027preparing\u0027,"},{"line_number":4439,"context_line":"                                                \u0027running\u0027,"},{"line_number":4440,"context_line":"                                                \u0027post-migrating\u0027]))"},{"line_number":4441,"context_line":"    if migration_type:"},{"line_number":4442,"context_line":"        query \u003d query.filter(models.Migration.migration_type \u003d\u003d migration_type)"},{"line_number":4443,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_eb01706b","line":4440,"range":{"start_line":4440,"start_character":48,"end_line":4440,"end_character":64},"updated":"2019-09-27 15:59:04.000000000","message":"This isn\u0027t even used for live migration. If you consider force-complete or cancelling an in-progress live migration though, we probably should set this in _post_live_migration in the ComputeManager because trying to cancel or force-complete at that point isn\u0027t going to work.","commit_id":"6ec686c26b2c8b18bcff522633bfe9715e0feec3"}]}
