-
Notifications
You must be signed in to change notification settings - Fork 717
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
Do not cache Elasticsearch settings in annotations #2864
Comments
The pattern outlined above may actually happen as soon as an annotation is used to store a copy of the Elasticsearch state: Iteration
|
Also I think we should sort the list of |
We have decided to remove any kind of cache between ECK and the Elasticsearch API. This means that in the case of the remote clusters we have to first retrieve the list of the existing remote clusters to know if some of them have to be deleted. But a side effect is that ECK will delete any unknown remote cluster. |
That seems very undesirable especially given that for remote cluster setups that connect to a cluster outside of k8s manual configuration is the only option and we would destroy such setups. A few things come to mind:
|
If the annotation is set first there is no guarantee that the clusters will be removed. |
The disadvantage of the prefix/suffix is that the remote cluster name would not be the one defined by the user in the spec. I was thinking of using the annotation as a history of remote clusters ECK has created. Something like:
On each reconciliation we would GET |
If there's no error the workflow of the annotation is However it seems to solve our problem and sounds cleaner than the naming convention. I'll work on a draft. |
attemptDownscale
may delete some nodes which are not excluded.For example, let's consider the following situation where 2
StatefulSets
with an initialreplicas: 2
are downscaled toreplicas: 1
:Initial state
Iteration 1
actualStatefulSets=[sset1,sset2]
sset1-1
is scheduled to be deleted:allocationSetter.ExcludeFromShardAllocation(ctx, ["sset1-1"])
is successfulupdateAllocationExcludeAnnotation(es, ["sset1-1"])
is successfulsset1-1
is not deleted yet because it is holding some dataIteration 2
actualStatefulSets=[sset2,sset1]
- note the inconsistent order, this is because there is no guarantee regarding the order of the StatefulSets retrieved from the K8S APIsset2-1
is scheduled to be deleted:allocationSetter.ExcludeFromShardAllocation(ctx, ["sset2-1"])
is successfulupdateAllocationExcludeAnnotation(es, ["sset2-1"])
fails (e.g.: Operation cannot be fulfilled on elasticsearches.elasticsearch.k8s.elastic.co "test-mutation-2nd-master-set-dtvx": the object has been modified;...)sset1-1
does not hold some data anymoreAt the end of this iteration there is an inconsistency between the excluded nodes in ES and the annotation set on the
Elasticsearch
object:sset1-1
is not excluded any more even if the annotation on ES is saying the opposite 💣 💣💣Iteration 3
actualStatefulSets=[sset1,sset2]
- note that now the order is the same than the one at iteration 1sset1-1
is scheduled to be deleted:allocationSetter.ExcludeFromShardAllocation(ctx, ["sset1-1"])
is NOT called because of the stale annotation:calculatePerformableDownscale
does not detect any shards onsset1-1
because it has been excluded in the past.sset1-1
is deleted ... but since it is not excluded anymore there is no guarantee that we have not delete some data with it 💥Could be the root cause of #2788 in which 2
StatefulSets
are downscaled/deleted.The text was updated successfully, but these errors were encountered: