-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CP-49634: Add alerting for Corosync upgrade #5646
CP-49634: Add alerting for Corosync upgrade #5646
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ Additional details and impacted files@@ Coverage Diff @@
## master #5646 +/- ##
========================================
- Coverage 51.4% 44.7% -6.7%
========================================
Files 13 16 +3
Lines 1928 2206 +278
========================================
- Hits 991 988 -3
- Misses 937 1218 +281 see 5 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
emm I did not change any python scripts, why do I get lower coverage? |
I don't think we've changed the CI lately to make these appear? I'll take a look into why |
7a26270
to
d321bb4
Compare
ocaml/xapi/xapi_clustering.ml
Outdated
@@ -517,6 +517,12 @@ module Watcher = struct | |||
performing update" | |||
__FUNCTION__ (Printexc.to_string exn) | |||
|
|||
let cluster_change_watcher : Thread.t option ref = ref None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the modern OCaml 5-ready way to use Atomic
for this now?
ocaml/xapi/xapi_clustering.ml
Outdated
| None -> | ||
debug "%s: No cluster host, no need to watch" __FUNCTION__ | ||
) ; | ||
Ptime.Span.of_d_ps (7, 0L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is waiting for seven days?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new implementation is going to send this as a one-off message
ocaml/xapi/xapi_clustering.ml
Outdated
let body = | ||
"The current cluster stack version of Corosync 2 is out of date, \ | ||
consider updating to Corosync 3" | ||
in | ||
let name, priority = Api_messages.cluster_stack_out_of_date in | ||
let host_uuid = Db.Host.get_uuid ~__context ~self:host in | ||
|
||
Helpers.call_api_functions ~__context (fun rpc session_id -> | ||
ignore | ||
@@ Client.Client.Message.create ~rpc ~session_id ~name ~priority | ||
~cls:`Host ~obj_uuid:host_uuid ~body | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we are missing ()
to include this in the then
block.
Also, if we have detected Corosync 3, then we can just exit the thread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can do that as well. I was thinking about sending periodic notifications to the user urging them to do the upgrade, which has a 7-day period
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this code, a cluster_stack_out_of_date
message is sent even if the cluster stack is not out of date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are absolutely right, I am missing a bracket around the if statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alert is raised outside of the conditional that checks for the Corosync version, so even when running Corosync 3.
Let's wait for #5696 for the watcher refactoring code, and |
d321bb4
to
b6def12
Compare
08ad258
to
c65117a
Compare
#5696 merged, and issues fixed, ready for review again |
0821b2b
to
6577325
Compare
Xapi will send alert when the user is running on a Corosync 2 cluster and prompting them to upgrade. This should only happen on XS 9 and is behind the corosync3 feature flag. XenCenter can take advantage of this alert message, but should have its own warning message to tell the user why/how to perform the upgrade. Signed-off-by: Vincent Liu <[email protected]>
Xapi will send alert when the user is running on a Corosync 2 cluster and prompting them to upgrade. This should only happen on XS 9 and is behind the corosync3 feature flag.
XenCenter can take advantage of this alert message, but should have its own warning message to tell the user why/how to perform the upgrade.