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
5 changes: 5 additions & 0 deletions ocaml/xapi/xapi_cluster_helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,8 @@ let with_cluster_operation ~__context ~(self : [`Cluster] API.Ref.t) ~doc ~op
(Datamodel_common._cluster, Ref.string_of self)
with _ -> ()
)

let cluster_health_enabled ~__context =
let pool = Helpers.get_pool ~__context in
let restrictions = Db.Pool.get_restrictions ~__context ~self:pool in
List.assoc_opt "restrict_cluster_health" restrictions = Some "false"
7 changes: 1 addition & 6 deletions ocaml/xapi/xapi_clustering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,7 @@ let create_cluster_watcher_on_master ~__context ~host =
Thread.delay 3.
done
in
let feature_enabled =
let pool = Helpers.get_pool ~__context in
let restrictions = Db.Pool.get_restrictions ~__context ~self:pool in
List.assoc_opt "restrict_cluster_health" restrictions = Some "false"
in
if feature_enabled then (
if Xapi_cluster_helpers.cluster_health_enabled ~__context then (
debug "%s: create watcher for corosync-notifyd on master" __FUNCTION__ ;
ignore @@ Thread.create watch ()
) else
Expand Down