es-operator icon indicating copy to clipboard operation
es-operator copied to clipboard

[WIP] Allow skipping draining of pods during update/scaledown

Open mikkeloscar opened this issue 4 years ago • 5 comments

This is a simple proposal for how we could allow skipping of pod draining when during rolling update or scaledown of an ElasticsearchDataSet. It adds a field spec.skipDraining which when set to true will instruct the operator not to attempt to drain a pod before it is terminated. The field defaults to false.

We could also think about enabling this by default in case there are any VolumeClaimTemplates which is usually where you would want to not drain the pod but just terminate it and let the replacement pod remount the data from the PVC.

Fix #70

mikkeloscar avatar Aug 29 '19 19:08 mikkeloscar

Are we able to somehow cover this in our e2e tests?

njuettner avatar Sep 02 '19 08:09 njuettner

we could, maybe by force-fully causing cluster red: replicas=0 and skipDraining would make the primary shard to get lost. (one of the risks of this setup)

otrosien avatar Sep 02 '19 18:09 otrosien

we could even disallow termination if an index has no replicas.

otrosien avatar Sep 02 '19 18:09 otrosien

we could even disallow termination if an index has no replicas.

Can we figure out if an index is stored on the particular node and then check if it's not replicated via the es API?

But it might also be fine if the index is not replicated because if you have it on a disk and this is good enough for you, you should be allowed to terminate the node assuming it will be replaced. Obviously this depends if the termination is because of cluster rotation or because of scaledown.

mikkeloscar avatar Sep 02 '19 18:09 mikkeloscar

Do we assume the user knows what he's doing? For an initial implementation let's just add this caveat to the readme.

otrosien avatar Sep 03 '19 15:09 otrosien

@mikkeloscar I don't think it's worth to add an end-to-end test for this. It's kind of messy because we not only need to provision the nodes but also create an index and add at least one document to it...

otrosien avatar Aug 16 '22 15:08 otrosien

:+1:

mikkeloscar avatar Aug 17 '22 06:08 mikkeloscar

👍

otrosien avatar Aug 19 '22 16:08 otrosien