-
Notifications
You must be signed in to change notification settings - Fork 488
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
flow: change clustering interface to be a call to NotifyClusterChange #4790
Conversation
Previously, components would opt in to clustering notifications through a call to ClusterUpdatesRegistration. Then, if that method returned true, they would be re-evaluated. In preparation for the move to services, the clustering service would not be able to function the same way, as services are not permitted to trigger a re-evaluation of a component. The new interface is a NotifyClusterChange method, which allows components to opt-in to whether they want to ignore that signal or not. This is not reflected in the CHANGELOG as it is a no-op for users.
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.
LGTM!
|
||
// Schedule a reload so targets get redistributed. | ||
select { | ||
case c.onUpdate <- struct{}{}: |
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 a case where this change can probably simplify things a lot. Trying to differentiate a clustering update vs an argument update was a real pain. We can probably not send on this channel, and just call c.manager.ClusteringUpdated()
directly, and simplify the logic in Run by a bit.
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.
Can we defer that to a separate PR? I want to minimize the impact of changes as much as possible here.
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. I can make that change after.
…#4790) * flow: change clustering interface to be a call to NotifyClusterChange Previously, components would opt in to clustering notifications through a call to ClusterUpdatesRegistration. Then, if that method returned true, they would be re-evaluated. In preparation for the move to services, the clustering service would not be able to function the same way, as services are not permitted to trigger a re-evaluation of a component. The new interface is a NotifyClusterChange method, which allows components to opt-in to whether they want to ignore that signal or not. This is not reflected in the CHANGELOG as it is a no-op for users. * flow: remove unused Reevaluate function in ComponentNode * component: add more documentation around NotifyClusterChange * prometheus.operator.*: change Mutex to a RWMutex
Previously, components would opt in to clustering notifications through a call to ClusterUpdatesRegistration. Then, if that method returned true, they would be re-evaluated.
In preparation for the move to services, the clustering service would not be able to function the same way, as services are not permitted to trigger a re-evaluation of a component.
The new interface is a NotifyClusterChange method, which allows components to opt-in to whether they want to ignore that signal or not.
This is not reflected in the CHANGELOG as it is a no-op for users.