)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3ad0b7549d5f4c067c5eda791ea4ac988e2a3978","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"The change however didn\u0027t take live migration into account and more"},{"line_number":15,"context_line":"specifically the call to disconnect_volume during post_live_migration at"},{"line_number":16,"context_line":"the end of the migration from the source. At this point the original"},{"line_number":17,"context_line":"instance has already moved, as a result the call to get_uuids_by_host"},{"line_number":18,"context_line":"will only return any remaining instances that are attached to the volume"},{"line_number":19,"context_line":"on the host."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_5c5880f8","line":17,"range":{"start_line":16,"start_character":41,"end_line":17,"end_character":26},"updated":"2019-02-01 13:48:12.000000000","message":"This isn\u0027t the case, we only switch instance.host after this when calling post_live_migration_at_destination:\n\nhttps://docs.openstack.org/nova/latest/reference/live-migration.html","commit_id":"b38ebb55c936b19e811e72e149d19d06fdff5f3f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"fb0daa2c75e9ca4d7986ad91259b0f3f0c5f3000","unresolved":false,"context_lines":[{"line_number":15,"context_line":"specifically the call to disconnect_volume during post_live_migration at"},{"line_number":16,"context_line":"the end of the migration from the source. At this point the original"},{"line_number":17,"context_line":"instance has already moved, as a result the call to get_uuids_by_host"},{"line_number":18,"context_line":"will only return any remaining instances that are attached to the volume"},{"line_number":19,"context_line":"on the host."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"This in turn allows disconnect_volume to be called prematurely if a single"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_88078718","line":18,"range":{"start_line":18,"start_character":41,"end_line":18,"end_character":72},"updated":"2019-02-01 12:18:42.000000000","message":"Sorry this shouldn\u0027t be here.","commit_id":"b38ebb55c936b19e811e72e149d19d06fdff5f3f"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"46eab4fb5a247608fd478628ae0d8e205439482c","unresolved":false,"context_lines":[{"line_number":1297,"context_line":"                # another Server on this Host, ie just check to see if more"},{"line_number":1298,"context_line":"                # than one attachment.server_id for this volume is in our"},{"line_number":1299,"context_line":"                # list of Server UUID\u0027s for this Host"},{"line_number":1300,"context_line":"                servers_this_host \u003d objects.InstanceList.get_uuids_by_host("},{"line_number":1301,"context_line":"                    context, instance.host)"},{"line_number":1302,"context_line":""},{"line_number":1303,"context_line":"                # NOTE(jdg): nova.volume.cinder translates the"},{"line_number":1304,"context_line":"                # volume[\u0027attachments\u0027] response into a dict which includes"},{"line_number":1305,"context_line":"                # the Server UUID as the key, so we\u0027re using that"},{"line_number":1306,"context_line":"                # here to check against our server_this_host list"},{"line_number":1307,"context_line":"                for server_id, data in attachments.items():"},{"line_number":1308,"context_line":"                    if server_id in servers_this_host:"},{"line_number":1309,"context_line":"                        connection_count +\u003d 1"},{"line_number":1310,"context_line":"                # NOTE(lyarwood): Handle calls to _disconnect_volume during"},{"line_number":1311,"context_line":"                # post_live_migration from the source where the instance has"},{"line_number":1312,"context_line":"                # already moved to the destination but another instance is"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_880d47e9","line":1309,"range":{"start_line":1300,"start_character":0,"end_line":1309,"end_character":45},"updated":"2019-02-01 13:02:28.000000000","message":"If you\u0027re thinking about a refactor, this whole method is obviously a race and needs a redesign, but this specifically can be done much more efficiently in a single query.\n\nPseudoquery:\n\n  select count(*) from instances where instance.uuid in attachments and instance.host \u003d this host\n\nThe current implementation becomes more expensive the more instances per compute host.","commit_id":"b38ebb55c936b19e811e72e149d19d06fdff5f3f"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"46eab4fb5a247608fd478628ae0d8e205439482c","unresolved":false,"context_lines":[{"line_number":1311,"context_line":"                # post_live_migration from the source where the instance has"},{"line_number":1312,"context_line":"                # already moved to the destination but another instance is"},{"line_number":1313,"context_line":"                # still attached to the volume."},{"line_number":1314,"context_line":"                if (connection_count \u003d\u003d 1 and"},{"line_number":1315,"context_line":"                    instance.uuid not in servers_this_host):"},{"line_number":1316,"context_line":"                    return False"},{"line_number":1317,"context_line":"        return (False if connection_count \u003e 1 else True)"},{"line_number":1318,"context_line":""},{"line_number":1319,"context_line":"    def _disconnect_volume(self, context, connection_info, instance,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_a8b36be8","line":1316,"range":{"start_line":1314,"start_character":0,"end_line":1316,"end_character":32},"updated":"2019-02-01 13:02:28.000000000","message":"A more obvious way to write this would be:\n\n  # Assume that if we\u0027re being called, it\u0027s only for an instance we expect to still have attachments here, regardless of its current host.\n  if instance.host !\u003d CONF.host:\n    connection_count +\u003d 1\n\nI also think this better states the assumption here. I\u0027m trying to think of situations where this assumption may be incorrect.","commit_id":"b38ebb55c936b19e811e72e149d19d06fdff5f3f"}]}
