[DRAFT] Cluster scalling improvements: allow safe scale down & even replicas #844
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.
For the sake of simplicity, I will be referring to
spec.replicasasinstances. Renamingreplicastoinstanceswon't be a part of this PR (so there won't be breaking changes, requiring a possibly complex operator upgrade for the users).Scope:
StatefulSet'sit's not possible to customize which pods get deleted first; instead highest ordinals get deleted first (for example, with 5 instances, scaling down to 3 will delete 4 and 3, keeping 0, 1, and 2). To ensure the primary is not accidentally deleted during scale down, it's required not to be in the "pods to delete pool". If it is, the cluster instances update is not accepted with the following error message:Sequentially add instances to the cluster on scale-upmocoheavily relies on all pod instances being deployed right after scale-up.ceil((instances - 1) / 2)replicas are required to ACK before primary commits.CHANGELOG.md