-
Notifications
You must be signed in to change notification settings - Fork 697
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
Downscale one master at a time & don't remove last running master #1549
Conversation
This commit adds 2 safety measures to StatefulSets downscales: * Make sure we remove one master node at a time This plays nicely with zen settings in general (especially zen1). * Don't remove a master if it's the last master running in the cluster This prevents situation where we can accidentally remove the last running master, loosing cluster_state, while waiting for other masters to spin up during a sset mutation (eg. sset renamed). Both are implemented as "invariants" in an "invariants" struct we use through the downscale process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
operators/pkg/controller/elasticsearch/driver/downscale_invariants.go
Outdated
Show resolved
Hide resolved
operators/pkg/controller/elasticsearch/driver/downscale_invariants.go
Outdated
Show resolved
Hide resolved
operators/pkg/controller/elasticsearch/driver/downscale_invariants.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, literally only naming nits
LGTM ! As a side note I have been a little bit surprised that the operator allows a scale down from 5 to 3 master nodes while master 0 and 1 are unavailable:
After the scale down request user has only one master alive while it's initial request was to keep 3 of them:
But I guess that's the expected behavior ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one nit.
operators/pkg/controller/elasticsearch/driver/downscale_invariants.go
Outdated
Show resolved
Hide resolved
Interesting, thanks for testing this corner case. I think that's what we'd expect? The operator cannot do much about nodes staying in a One important thing though is, if you wanted to downscale to 5 to 2, it would make sure we don't remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-LGTM
Add safety measures to StatefulSets downscales:
Make sure we remove one master node at a time
This plays nicely with zen settings in general (especially zen1).
Don't remove a master if it's the last master running in the cluster
This prevents situation where we can accidentally remove the last
running master, loosing cluster_state, while waiting for other masters
to be running during a sset mutation (eg. sset renamed).
Both are implemented as "invariants" in an "invariants" struct we use
through the downscale process.
Relates #1281.