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

Avoid infinite reconcile if subclusters share svc #408

Merged
merged 4 commits into from
May 26, 2023

Conversation

spilchen
Copy link
Collaborator

This fixes a bug when you have two subclusters share the same service object. Subclusters can share a service object if they both have the same value for spec.subclusters[].serviceName. The service object has a label for the subcluster name (vertica.com/subcluster-name). When more
than one subcluster shared the service object, we would continually update the service object by cycling through the subcluster names. This resulted in an infinite reconcile. We would change the service object, that would trigger another reconcile, that would cause another change in the service object, ...

A secondary bug fix in this relates to handle of annotations. When we compare expected vs current service object, we don't handle annotations correctly. The annotations can be an empty map or nil map. Technically they are both equivalent, but our comparison flags them as different.
Thus we always try to update the service object. The k8s client is smart enough not to change the service object in this case. So, we just end up doing a no-op update. But we can save some time if we treated them the same.

Matt Spilchen added 3 commits May 26, 2023 08:45
This fixes a bug when you have two subclusters share the same service
object. Subclusters can share a service object if they both have the
same value for spec.subclusters[].serviceName. The service object has a
label for the subcluster name (vertica.com/subcluster-name). When more
than one subcluster shared the service object, we would continually
update the service object by cycling through the subcluster names. This
resulted in an infinite reconcile. We would change the service object,
that would trigger another reconcile, that would cause another change
in the service object, ...

A secondary bug fix in this relates to handle of annotations. When we
compare expected vs current service object, we don't handle annotations
correctly. The annotations can be an empty map or nil map. Technically
they are both equivalent, but our comparison flags them as different.
Thus we always try to update the service object. The k8s client is smart
enough not to change the service object in this case. So, we just end up
doing a no-op update. But we can save some time if we treated them the same.

Signed-off-by: Matt Spilchen <matt.spilchen@vertica.com>
@spilchen spilchen requested a review from roypaulin May 26, 2023 12:34
@spilchen spilchen self-assigned this May 26, 2023
@spilchen spilchen merged commit 4ee6ccc into vertica:main May 26, 2023
@spilchen spilchen deleted the bugfix/infinite-reconcile branch May 26, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants