fix(): Avoid unnecessary reconcile cycles for slice gw #416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The slice gw reconciler is in a perpetual reconcile cycle. There are places where the CR update func is being called in a for loop. And reflect.DeepEqual is being used to compare two lists that are never guaranteed to have their elements in the same order, this causes unnecessary update from the server worker cluster to the controller, which triggers an update on the client cluster. The reconciler also watches for node updates blindly, triggering the reconcile func every time there is an update to the Node object. The update could be because of the cluster provider adding or modifying labels and annotations. We need a granular check on the node update and trigger the reconciler func only if needed.
Due to the reconcile storm, updates are not being handled in a timely manner, and sometimes it is so bad that the reconcile events get queued for days. This was observed on a customer cluster where an update to the CR was not handled for 15 days.