Skip to content
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

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Aug 14, 2023

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.

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.
@rfratto rfratto requested review from a team as code owners August 14, 2023 13:26
Copy link
Member

@tpaschalis tpaschalis left a 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{}{}:
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@rfratto rfratto merged commit d1c5a50 into grafana:main Aug 14, 2023
6 checks passed
@rfratto rfratto deleted the change-clustering-interface branch August 14, 2023 17:19
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
…#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
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants