Conditional update of cluster settings


I'm trying to update Elasticsearch cluster settings from multiple consumers, especially "cluster.routing.allocation.exclude._ip". The issue is that I need to GET the old value, add the IP, and PUT the new value back, which means in unfortunate cases there is an update in between that I will be overwriting. A classical race-condition.
HTTP has means to circumvent this like ETags, If-Modified-Since, PATCH operation but I didn't find anything in the Elastic docs. Is there something that I missed?


No, today there is no such feature. The assumption is normally that things like cluster settings are under control of a single administrator (or, more generally, a set of administrators behaving consistently).

It would be possible to implement this kind of conditional update, but this is the first time I've heard anyone ask for it. Can you explain in more detail why you need to do consistent, concurrent updates on settings like this, without any coordination outside Elasticsearch?

Hi David,

thanks for the quick reply. I was looking for possible options for an issue we're facing with our Kubernetes Operator ( ) for Elasticsearch. It's also solvable with a mutex / lock inside the client code to avoid simultaneous API calls.


I see, looks interesting! I think this operator will face more concurrency issues than just the one you highlight here, so will need its own coordination mechanism, so it sounds reasonable to coordinate settings updates using the same mechanism.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.