Skip to content

Commit 48ae1a3

Browse files
authored
CA-408230: Enable destroy op for HA statefile VDI after HA is disabled (xapi-project#6424)
2 parents b645ba4 + f19f381 commit 48ae1a3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ocaml/xapi/xapi_ha.ml

+5
Original file line numberDiff line numberDiff line change
@@ -1745,6 +1745,11 @@ let disable_internal __context =
17451745
)
17461746
errors
17471747
) ;
1748+
(* CA-408230: mark current operation, `ha_enable or `ha_disable, as done,
1749+
as otherwise it will fail to update_allowed_operations for metadata_vdis
1750+
and statefile_vdis *)
1751+
let task_id = Ref.string_of (Context.get_task_id __context) in
1752+
Db.Pool.remove_from_current_operations ~__context ~self:pool ~key:task_id ;
17481753
(* Update the allowed operations on the statefile VDIs for tidiness *)
17491754
List.iter
17501755
(fun vdi -> Xapi_vdi.update_allowed_operations ~__context ~self:vdi)

ocaml/xapi/xapi_vdi.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ let check_operation_error ~__context ?sr_records:_ ?(pbd_records = [])
345345
then
346346
Error (Api_errors.ha_is_enabled, [])
347347
else if
348-
List.mem record.Db_actions.vDI_type [`ha_statefile; `metadata]
348+
List.mem record.Db_actions.vDI_type [`ha_statefile; `redo_log]
349349
&& Xapi_pool_helpers.ha_enable_in_progress ~__context
350350
then
351351
Error (Api_errors.ha_enable_in_progress, [])
352352
else if
353-
List.mem record.Db_actions.vDI_type [`ha_statefile; `metadata]
353+
List.mem record.Db_actions.vDI_type [`ha_statefile; `redo_log]
354354
&& Xapi_pool_helpers.ha_disable_in_progress ~__context
355355
then
356356
Error (Api_errors.ha_disable_in_progress, [])

0 commit comments

Comments
 (0)