Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions ocaml/xapi/xapi_clustering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,22 @@ let rpc ~__context =

let maybe_switch_cluster_stack_version ~__context ~self ~cluster_stack =
if Xapi_cluster_helpers.corosync3_enabled ~__context then
let dbg = Context.string_of_task_and_tracing __context in
let result =
Cluster_client.LocalClient.switch_cluster_stack (rpc ~__context) dbg
cluster_stack
in
match Idl.IdM.run @@ Cluster_client.IDL.T.get result with
| Ok () ->
debug "cluster stack switching was successful for cluster_host: %s"
(Ref.string_of self)
| Error error ->
warn "Error encountered when switching cluster stack cluster_host %s"
(Ref.string_of self) ;
handle_error error
if Xapi_fist.fail_corosync_upgrade () then
handle_error (InternalError "simulated corosync upgrade failure")
else
let dbg = Context.string_of_task_and_tracing __context in
let result =
Cluster_client.LocalClient.switch_cluster_stack (rpc ~__context) dbg
cluster_stack
in
match Idl.IdM.run @@ Cluster_client.IDL.T.get result with
| Ok () ->
debug "cluster stack switching was successful for cluster_host: %s"
(Ref.string_of self)
| Error error ->
warn "Error encountered when switching cluster stack cluster_host %s"
(Ref.string_of self) ;
handle_error error

let assert_cluster_host_quorate ~__context ~self =
(* With the latest kernel GFS2 would hang on mount if clustering is not working yet,
Expand Down
3 changes: 3 additions & 0 deletions ocaml/xapi/xapi_fist.ml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ let reconfigure_host () = fistpoint "reconfigure_host"
(** allow starting up a corosync2 cluster *)
let allow_corosync2 () = fistpoint "allow_corosync2"

(** Make the current node fail the corosync upgrade *)
let fail_corosync_upgrade () = fistpoint "fail_corosync_upgrade"

(** Raise MTC_EXIT_CAN_NOT_ACCESS_STATEFILE *)
let ha_cannot_access_statefile () = fistpoint "ha_cannot_access_statefile"

Expand Down