Просмотр исходного кода

Merge pull request #91 from aznashwan/validation-task-order

Schedule VALIDATE_SOURCE tasks before GET_INSTANCE.
Nashwan Azhari 6 лет назад
Родитель
Сommit
e2cb280066
1 измененных файлов с 12 добавлено и 8 удалено
  1. 12 8
      coriolis/conductor/rpc/server.py

+ 12 - 8
coriolis/conductor/rpc/server.py

@@ -334,15 +334,17 @@ class ConductorServerEndpoint(object):
         execution.type = constants.EXECUTION_TYPE_REPLICA_EXECUTION
 
         for instance in execution.action.instances:
-            get_instance_info_task = self._create_task(
-                instance, constants.TASK_TYPE_GET_INSTANCE_INFO,
-                execution)
-
             validate_replica_source_inputs_task = self._create_task(
                 instance,
                 constants.TASK_TYPE_VALIDATE_REPLICA_SOURCE_INPUTS,
                 execution)
 
+            get_instance_info_task = self._create_task(
+                instance,
+                constants.TASK_TYPE_GET_INSTANCE_INFO,
+                execution,
+                depends_on=[validate_replica_source_inputs_task.id])
+
             validate_replica_destination_inputs_task = self._create_task(
                 instance,
                 constants.TASK_TYPE_VALIDATE_REPLICA_DESTINATION_INPUTS,
@@ -728,15 +730,17 @@ class ConductorServerEndpoint(object):
             # to prevent the Replica disks from being cloned:
             migration.info[instance] = {"clone_disks": False}
 
-            get_instance_info_task = self._create_task(
-                instance, constants.TASK_TYPE_GET_INSTANCE_INFO,
-                execution)
-
             validate_migration_source_inputs_task = self._create_task(
                 instance,
                 constants.TASK_TYPE_VALIDATE_MIGRATION_SOURCE_INPUTS,
                 execution)
 
+            get_instance_info_task = self._create_task(
+                instance,
+                constants.TASK_TYPE_GET_INSTANCE_INFO,
+                execution,
+                depends_on=[validate_migration_source_inputs_task.id])
+
             validate_migration_destination_inputs_task = self._create_task(
                 instance,
                 constants.TASK_TYPE_VALIDATE_MIGRATION_DESTINATION_INPUTS,