-
Notifications
You must be signed in to change notification settings - Fork 718
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
Do not call the voting config exclusions API at every single reconciliation #2642
Conversation
This commit sets up an annotation containing the last applied value for voting config exclusions. The annotation can either be: - nil: it has not been set yet - empty: the last setting applied was to reset voting config exclusions - not empty: it contains the last applied voting config exclusions Before making the ES API call, which check the value of that annotation. Users can remove the annotation at anytime, it will be set again after the next API call. Note we ignore cases where users would manipulate voting config exclusions behind our back here.
copy(sliceCopy, excludedNodes) | ||
sort.Strings(sliceCopy) | ||
return strings.Join(sliceCopy, ",") | ||
} |
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.
I decided to sort a copy of the slice instead of mutating the slice itself. That's an extra allocation but I would not expect such a side effect to occur in that function.
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
reverted in #2880 (thus |
This PR sets up an annotation containing the last applied value for
voting config exclusions. The annotation can either be:
Before making the ES API call to either add nodes to voting config exclusions
or reset its value, we check the value of the annotation.
Users can remove the annotation at anytime, it will be set again after
the next API call.
Note we ignore cases where users would manipulate voting config
exclusions behind our back here.
Fixes #2605.