)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d4810b41c89d8b68c5e39c62deec0067c03e725","unresolved":true,"context_lines":[{"line_number":19,"context_line":"all pCPUs as free and assigns ones already in use, leading to duplicate"},{"line_number":20,"context_line":"pCPU assignments."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Add _instance_is_evacuating() helper that detects in-progress"},{"line_number":23,"context_line":"evacuations by checking migration_type \u003d\u003d \u0027evacuation\u0027 and"},{"line_number":24,"context_line":"instance.host !\u003d migration.dest_compute. Add it as a third condition"},{"line_number":25,"context_line":"in the skip check so evacuation migrations are properly tracked."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1349d8b6_c747afad","line":22,"updated":"2026-08-19 14:23:10.000000000","message":"I think this is a partial fix. I feel we should not clear the task state until we set the instance.host. If we cannot do that in a single transation then the order should be\n1. set instance.host\n2. reset instance.task_state to None to signal that evac finished","commit_id":"e30c5cbc999e2beaa06c5b55e96a605ef78a9f13"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d4810b41c89d8b68c5e39c62deec0067c03e725","unresolved":true,"context_lines":[{"line_number":90,"context_line":"    has not yet completed (instance.host not updated to dest)."},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    During an evacuation, after _update_instance_after_spawn clears"},{"line_number":93,"context_line":"    task_state but before finish_evacuation updates instance.host, the"},{"line_number":94,"context_line":"    instance falls through both _instance_in_resize_state and"},{"line_number":95,"context_line":"    _instance_is_live_migrating checks. This helper catches that window"},{"line_number":96,"context_line":"    so that the migration resources (including CPU pinning) are still"}],"source_content_type":"text/x-python","patch_set":2,"id":"e54de3d3_2b743da8","line":93,"updated":"2026-08-19 14:23:10.000000000","message":"that empty task state before the instance.host upgrade seems like a bigger problem as that allows other actions to run on the instance. I tempted to say try to close that gap and only remove the task state at the same transaction as used to set the instance.host to avoid the gap.","commit_id":"e30c5cbc999e2beaa06c5b55e96a605ef78a9f13"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d4810b41c89d8b68c5e39c62deec0067c03e725","unresolved":true,"context_lines":[{"line_number":97,"context_line":"    tracked by _update_usage_from_migrations."},{"line_number":98,"context_line":"    \"\"\""},{"line_number":99,"context_line":"    return (migration.migration_type \u003d\u003d \u0027evacuation\u0027 and"},{"line_number":100,"context_line":"            instance.host !\u003d migration.dest_compute)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"class ResourceTracker(object):"}],"source_content_type":"text/x-python","patch_set":2,"id":"0ce75fbf_1229e1e7","line":100,"updated":"2026-08-19 14:23:10.000000000","message":"do we need to filter failed evacuates? or is it done elsewhere? See my comment below with details","commit_id":"e30c5cbc999e2beaa06c5b55e96a605ef78a9f13"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d4810b41c89d8b68c5e39c62deec0067c03e725","unresolved":true,"context_lines":[{"line_number":1607,"context_line":"            # Skip migration if instance is neither in a resize state,"},{"line_number":1608,"context_line":"            # live-migrating, nor being evacuated."},{"line_number":1609,"context_line":"            if (not _instance_in_resize_state(instances[uuid]) and not"},{"line_number":1610,"context_line":"                    _instance_is_live_migrating(instances[uuid]) and not"},{"line_number":1611,"context_line":"                    _instance_is_evacuating(instances[uuid], migration)):"},{"line_number":1612,"context_line":"                LOG.debug(\u0027Skipping migration as instance is neither \u0027"},{"line_number":1613,"context_line":"                          \u0027resizing, live-migrating, nor being evacuated.\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"540a22ec_3be27537","line":1610,"updated":"2026-08-19 14:23:10.000000000","message":"OK so this check filtered our evacuation migration record from the usage calculation and we do want that the usage calculation includes an in progress migration targeting this host as well. That seems OK. \n\nBut evacuation is a strange beast. The following can happen:\n* VM is on host A. Host dies.\n* VM evacuation called. Host B selected, migration record exists. but spawn fails. instance is back to a state where evacuation can be retried\n* VM evacuation called. Host C selected, migration record created to host C.\n\nNow the code below will filter the migration recprod to the newest but it runs on migrations where the dest host is this host. So on Host B this will select Host B migration record and will include it into the usage calcualtion. But the instance will never be placed to Host B any more as that evac failed.","commit_id":"e30c5cbc999e2beaa06c5b55e96a605ef78a9f13"}]}
