Disown machine if owning more than desired replicas #43
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.
Description of changes:
Under normal circumstances, the etcd machines owned by the etcdadm cluster should never be higher than the specified number of desired replicas, they should be equal at most.
However, it's possible that due to stale client caches or even manual updates (where a user re-adds the owner reference to an old etcd machine), an etcdadm cluster might appear to own (during an upgrade reconcile loop) more machines that the number of desired replicas. In that case, regardless of the reason, we want to remove the owner reference before creating new replicas. If not, the next reconciliation loop will still detect an owned machine out of spec and will create a new replica, again without removing ownership of the out of spec machine. This causes a loop of new machines being created without a limit.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.