Merge "Keep migration status if instance still resizing" into stable/juno
This commit is contained in:
commit
b86bcb9358
|
@ -5430,6 +5430,16 @@ class ComputeManager(manager.Manager):
|
|||
LOG.debug(msg, instance=instance)
|
||||
continue
|
||||
|
||||
# race condition: This condition is hit when this method is
|
||||
# called between the save of the migration record with a status of
|
||||
# finished and the save of the instance object with a state of
|
||||
# RESIZED. The migration record should not be set to error.
|
||||
if instance.task_state == task_states.RESIZE_FINISH:
|
||||
msg = ("Instance still resizing during resize "
|
||||
"confirmation. Skipping.")
|
||||
LOG.debug(msg, instance=instance)
|
||||
continue
|
||||
|
||||
vm_state = instance['vm_state']
|
||||
task_state = instance['task_state']
|
||||
if vm_state != vm_states.RESIZED or task_state is not None:
|
||||
|
|
|
@ -6327,7 +6327,10 @@ class ComputeTestCase(BaseTestCase):
|
|||
task_state='deleting'),
|
||||
fake_instance.fake_db_instance(uuid='fake_uuid7',
|
||||
vm_state=vm_states.RESIZED,
|
||||
task_state='soft-deleting')]
|
||||
task_state='soft-deleting'),
|
||||
fake_instance.fake_db_instance(uuid='fake_uuid8',
|
||||
vm_state=vm_states.ACTIVE,
|
||||
task_state='resize_finish')]
|
||||
expected_migration_status = {'fake_uuid1': 'confirmed',
|
||||
'noexist': 'error',
|
||||
'fake_uuid2': 'error',
|
||||
|
@ -6335,7 +6338,8 @@ class ComputeTestCase(BaseTestCase):
|
|||
'fake_uuid4': None,
|
||||
'fake_uuid5': 'error',
|
||||
'fake_uuid6': None,
|
||||
'fake_uuid7': None}
|
||||
'fake_uuid7': None,
|
||||
'fake_uuid8': None}
|
||||
migrations = []
|
||||
for i, instance in enumerate(instances, start=1):
|
||||
fake_mig = test_migration.fake_db_migration()
|
||||
|
|
Loading…
Reference in New Issue