-
Notifications
You must be signed in to change notification settings - Fork 652
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
fix: indexer cache error when default evictor is re-initialized #1452
Conversation
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
3b02da4
to
7ab36da
Compare
/cc @ingvagabund any ideas on how to make this better? to be honest, I'm not sure why DefaultEvictor is getting re-initialized. But perhaps this is possible in case of multiple profiles |
Yeah. Each profile gets initialized separately. The same shared informer, a new instance of the default evictor. |
Some thoughts:
|
The current implementation creates a new profile in each descheduling cycle. Yet, the created indexer never gets removed from the shared informer. Making every other descheduling cycle to error when minReplicas is set to a non-zero number. |
Worth checking if the code can be cleanly refactored to initialize each plugin only once per the whole descheduler run. The primary motivation for re-initializing each plugin was to start clean. If we can guarantee no plugin will keep a state then this will be a nice improvement to the code base. |
Why is that necessarily? This is no plugin logic inside the shared informer. And ideally we share the shared informer.
we certainly could, but we then need to compare it against the current implementation. I personally prefer this PR but open to feedback from others. For example, no need to initialize the shared informer for policies that do not need minReplicas check.
is there a reason for this? ideally we share it to reduce memory footprint. |
I think the issue is that the params/config for each can be different. Correct? |
We could inject the params/config as "data" (alongside nodes and pods). Assuming the args do not interfere with a plugin initialization. Though, that will change the plugin API. |
You are right. That was another motivation for it. |
Note: We share a single shared informer through all the plugins. As long as the plugins are part of this repository we have a full control over how each indexer gets created. We don't have such control over custom plugins. Thus, we need to rely on good citizenship principles and assume anyone assembling their own deschedulers from the descheduling framework will take the extra step of making sure all the extra plugins create their indexes properly. Plugin owners can already define as many indexers as they like without following any good practices. The same holds for updating items in either of the informer caches without making a deep copy. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ingvagabund The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
It appears that DefaultEvictor is re-initialized, which causes a conflict issue when adding the same indexer again.
closes #1440