Skip to content

Commit

Permalink
CP-48027: Add feature flag for corosync3
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
  • Loading branch information
Vincent-lau committed May 8, 2024
1 parent 617f3b5 commit cbbc21c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ocaml/xapi/xapi_cluster.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ let create ~__context ~pIF ~cluster_stack ~pool_auto_join ~token_timeout
let cluster_stack_version =
if Xapi_fist.allow_corosync2 () then
2L
else if not (Xapi_cluster_helpers.corosync3_enabled ~__context) then
2L
else
3L
in
Expand Down
5 changes: 5 additions & 0 deletions ocaml/xapi/xapi_cluster_helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ let cluster_health_enabled ~__context =
let restrictions = Db.Pool.get_restrictions ~__context ~self:pool in
List.assoc_opt "restrict_cluster_health" restrictions = Some "false"

let corosync3_enabled ~__context =
let pool = Helpers.get_pool ~__context in
let restrictions = Db.Pool.get_restrictions ~__context ~self:pool in
List.assoc_opt "restrict_corosync3" restrictions = Some "false"

let maybe_generate_alert ~__context ~num_hosts ~missing_hosts ~new_hosts ~quorum
=
let generate_alert join cluster_host =
Expand Down

0 comments on commit cbbc21c

Please sign in to comment.