-
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
CA-394109: Reduce number of alerts #5696
CA-394109: Reduce number of alerts #5696
Conversation
c0fe06a
to
2faefbe
Compare
2faefbe
to
74851ba
Compare
6f55aea
to
0dbfad9
Compare
1384b5e
to
4685175
Compare
(fun h -> not (List.mem h quorum_hosts)) | ||
all_cluster_hosts | ||
let dead_hosts = | ||
List.filter (fun h -> not (List.mem h live_hosts)) all_cluster_hosts |
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.
Should we use sets here? This is O(n^2).
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 maximum number of hosts we support is 16, so maximum complexity is 256, should be fine, what do you think?
4685175
to
22ffd5e
Compare
Checking format failed. If you use VSCode, you can configure setting.json to auto-format when saving the code like this:
|
9bf46ef
to
9143797
Compare
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 change replaces the direct call to alerts from normal operation to trigger a stack synchronization. This should be caught by the watcher and generate the alert once, instead of twice like before
going to run a quick xrt test to make sure these changes are good, since it has been in the review fow a while |
9143797
to
c66e731
Compare
Signed-off-by: Vincent Liu <[email protected]>
Use the Atomic module to track whether a watcher has been created. Signed-off-by: Vincent Liu <[email protected]>
Signed-off-by: Vincent Liu <[email protected]>
Added a feature flag, and tests look ok, merge this one now. |
c66e731
to
cca43a4
Compare
This allows one to force sync the state of xapi db with the cluster stack, useful for cluster API methods change the state of the cluster. Signed-off-by: Vincent Liu <[email protected]>
Previously there were two ways an alert for a cluster host join/leave can be raised: 1. through the cluster change watcher; 2. through the api call. These two can generate duplicate alerts as an API call can cause the cluster change watcher to notice the change as well. The idea of the fix here is still to let API and watcher raise alerts separately, but now add synchronous API calls to allow API call (cluster-host-join, etc) to call the cluster change update code at the right time so that the cluster change watcher won't see the change again, hence not generating duplicate alerts. Signed-off-by: Vincent Liu <[email protected]>
Signed-off-by: Vincent Liu <[email protected]>
relatively large change, best reviewed by commit