# Conditional update of cluster settings

**URL:** <https://discuss.elastic.co/t/conditional-update-of-cluster-settings/179663>\
**Category:** Elasticsearch\
**Created:** [May 5, 2019, 10:49am UTC](https://discuss.elastic.co/t/conditional-update-of-cluster-settings/179663 "2019-05-05T10:49:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![otrosien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otrosien/32/50471_2.png) [@otrosien](https://discuss.elastic.co/u/otrosien)\
**Post date:** [May 5, 2019, 10:49am UTC](https://discuss.elastic.co/t/conditional-update-of-cluster-settings/179663/1 "2019-05-05T10:49:44Z")

</div>

Hi,

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?

Oliver

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 5, 2019, 12:28pm UTC](https://discuss.elastic.co/t/conditional-update-of-cluster-settings/179663/2 "2019-05-05T12:28:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![otrosien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otrosien/32/50471_2.png) [@otrosien](https://discuss.elastic.co/u/otrosien)\
**Post date:** [May 5, 2019, 3:11pm UTC](https://discuss.elastic.co/t/conditional-update-of-cluster-settings/179663/3 "2019-05-05T15:11:35Z")

</div>

Hi David,

thanks for the quick reply. I was looking for possible options for an issue we're facing with our Kubernetes Operator ( [https://github.com/zalando-incubator/es-operator/](https://github.com/zalando-incubator/es-operator/) ) for Elasticsearch. It's also solvable with a mutex / lock inside the client code to avoid simultaneous API calls.

Oliver

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 5, 2019, 5:08pm UTC](https://discuss.elastic.co/t/conditional-update-of-cluster-settings/179663/4 "2019-05-05T17:08:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 2, 2019, 5:08pm UTC](https://discuss.elastic.co/t/conditional-update-of-cluster-settings/179663/5 "2019-06-02T17:08:25Z")

</div>

Closed on June 2, 2019, 5:08pm UTC

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