Skip to content

Commit 637cf20

Browse files
committed
Add clustered migration sync for shared disks (SYNCING barrier)
Introduce TASK_STATUS_SYNCING and TASK_TYPES_REQUIRING_CLUSTER_SYNC (DEPLOY_TRANSFER_DISKS, SHUTDOWN_INSTANCE) so multi-instance transfers with base_transfer_action.clustered=True wait for all peer tasks before marking COMPLETED and advancing dependents. - Add clustered boolean on base_transfer_action (DB migration 024) - Plumb clustered through create_instances_transfer, REST transfers API, deployment creation (inherits from parent transfer) - On task_completed: set SYNCING when barrier applies; when all peers are SYNCING, finalize (for deploy: dedupe volumes_info by disk_id, leader gets replicate_disk_data=True, followers False) - ReplicateDisksTask: skip provider replicate_disks for volumes with replicate_disk_data=False and merge back in export disk order - On set_task_error: abort peer tasks stuck in SYNCING for the same type Volumes schema already allows extra properties; replicate_disk_data is consumed by replication only (default True preserves behavior).
1 parent 3ce217f commit 637cf20

File tree

15 files changed

+369
-13
lines changed

15 files changed

+369
-13
lines changed

coriolis/api-refs/api_samples/transfer/openstack-transfer-create-resp.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
}
5050
},
5151
"executions": [],
52-
"scenario": "replica"
52+
"scenario": "replica",
53+
"clustered": false
5354
}
5455
}

coriolis/api-refs/api_samples/transfer/openstack-transfer-get-resp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"origin_minion_pool_id": null,
4343
"destination_minion_pool_id": null,
4444
"instance_osmorphing_minion_pool_mappings": {},
45+
"clustered": false,
4546
"executions": [
4647
{
4748
"created_at": "2019-07-11T10:06:47.000000",

coriolis/api-refs/api_samples/transfer/transfer-list-resp.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
"instances": {}
7575
},
7676
"id": "0460aa4d-6b16-4c98-bd56-27ee186e4a22",
77-
"scenario": "replica"
77+
"scenario": "replica",
78+
"clustered": false
7879
}
7980
]
8081
}

coriolis/api-refs/api_samples/transfer/transfer-update-resp.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@
133133
"ubuntu-xenial": "echo 'anything you need'"
134134
}
135135
},
136-
"scenario": "replica"
136+
"scenario": "replica",
137+
"clustered": false
137138
}
138139
}
139140
}

coriolis/api-refs/source/parameters.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ connection_info_schema:
123123
in: body
124124
type: object
125125
required: false
126+
clustered:
127+
description: |
128+
Present only in API responses (read-only). ``true`` when the transfer
129+
includes more than one instance, ``false`` for a single instance. Not
130+
stored in the database; derived from ``instances``.
131+
in: body
132+
type: boolean
133+
required: false
126134
deployment_cancel:
127135
description: |
128136
Object containing information about the type of deployment cancellation.

coriolis/api-refs/source/transfer.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Response
5151
- instance_osmorphing_minion_pool_mappings : instance_osmorphing_minion_pool_mappings
5252
- user_scripts : user_scripts
5353
- scenario: scenario_type
54+
- clustered : clustered
5455

5556
**Example of Transfer List Response**
5657

@@ -111,6 +112,7 @@ Response
111112
- instance_osmorphing_minion_pool_mappings : instance_osmorphing_minion_pool_mappings
112113
- user_scripts : user_scripts
113114
- scenario: scenario_type
115+
- clustered : clustered
114116

115117
**Example of Transfer Show Response**
116118

@@ -183,6 +185,7 @@ Response
183185
- instance_osmorphing_minion_pool_mappings : instance_osmorphing_minion_pool_mappings
184186
- user_scripts : user_scripts
185187
- scenario: scenario_type
188+
- clustered : clustered
186189

187190
**Example of Transfer Create Response**
188191

coriolis/conductor/rpc/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def create_instances_transfer(self, ctxt,
169169
source_environment, destination_environment,
170170
instances, network_map, storage_mappings,
171171
notes=None, user_scripts=None,
172-
clone_disks=True, skip_os_morphing=False):
172+
clone_disks=True, skip_os_morphing=False,
173+
clustered=None):
173174
return self._call(
174175
ctxt, 'create_instances_transfer',
175176
transfer_scenario=transfer_scenario,
@@ -187,7 +188,8 @@ def create_instances_transfer(self, ctxt,
187188
source_environment=source_environment,
188189
user_scripts=user_scripts,
189190
clone_disks=clone_disks,
190-
skip_os_morphing=skip_os_morphing)
191+
skip_os_morphing=skip_os_morphing,
192+
clustered=clustered)
191193

192194
def get_transfers(self, ctxt, include_tasks_executions=False,
193195
include_task_info=False):

0 commit comments

Comments
 (0)