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

Perform StatefulSets deletions before replicas downscale #2062

Merged
merged 3 commits into from
Oct 28, 2019

Conversation

sebgl
Copy link
Contributor

@sebgl sebgl commented Oct 25, 2019

We had a bug where a StatefulSet with 0 replicas could be kept forever
under particular conditions (eg. cannot be removed since there is a risk
to remove the last master node... even though there is 0 replicas).

This commit fixes it by decoupling StatefulSets deletions from
StatefulSet downscales.
A StatefulSet deletion is only performed when the actual StatefulSet has
0 replicas. Our expectations mechanism ensures there is no Pod still
alive for that StatefulSet (eg. if it was just downscaled from 1 to 0
replicas). So that StatefulSet can be safely garbage-collected.

StatefulSets deletions are now ran before handling downscales,
regardless of any downscale invariant constraint.
The downscale code is a bit simplified since it does not need to handle
StatefulSets deletions anymore.

Fixes #2009 and the TestMutationMdiToDedicated E2E test.

We had a bug where a StatefulSet with 0 replicas could be kept forever
under particular conditions (eg. cannot be removed since there is a risk
to remove the last master node... even though there is 0 replicas).

This commit fixes it by decoupling StatefulSets deletions from
StatefulSet downscales.
A StatefulSet deletion is only performed when the actual StatefulSet has
0 replicas. Our expectations mechanism ensures there is no Pod still
alive for that StatefulSet (eg. if it was just downscaled from 1 to 0
replicas). So that StatefulSet can be safely garbage-collected.

StatefulSets deletions are now ran before handling downscales,
regardless of any downscale invariant constraint.
The downscale code is a bit simplified since it does not need to handle
StatefulSets deletions anymore.
@sebgl sebgl added the >bug Something isn't working label Oct 25, 2019
Copy link
Contributor

@david-kow david-kow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one small comment.

@sebgl sebgl merged commit 21faa95 into elastic:master Oct 28, 2019
@anyasabo anyasabo added the v1.0.0 label Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bypass downscale checks to remove StatefulSets with 0 replicas
3 participants