# Problem updating settings: maxThreadCount (= 8) should be \<= maxMergeCount (= 6)

**URL:** <https://discuss.elastic.co/t/problem-updating-settings-maxthreadcount-8-should-be-maxmergecount-6/76279>\
**Category:** Elasticsearch\
**Created:** [February 23, 2017, 5:38pm UTC](https://discuss.elastic.co/t/problem-updating-settings-maxthreadcount-8-should-be-maxmergecount-6/76279 "2017-02-23T17:38:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbbarth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbbarth/32/12266_2.png) [@jbbarth](https://discuss.elastic.co/u/jbbarth)\
**Post date:** [February 23, 2017, 5:38pm UTC](https://discuss.elastic.co/t/problem-updating-settings-maxthreadcount-8-should-be-maxmergecount-6/76279/1 "2017-02-23T17:38:09Z")

</div>

Hi there,

(let me know if I file a bug on Github directly)

We're in the process of upgrading to ES5 (5.0.2 in our case). We have reindexed a lot of data already.

I wanted to try settings I saw in a blog post from a friend (adapted), so I issued this command:

```
$ curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
  "index.merge.scheduler.max_thread_count" : "8",
  "index.merge.policy.max_merge_at_once" : "4",
  "index.merge.policy.max_merge_at_once_explicit" : "4",
  "index.merge.policy.max_merged_segment" : "20gb",
  "index.merge.policy.segments_per_tier" : "4"
}'

```

The command worked fine. After that I couldn't update any setting anymore:

```
$ curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
 "index.merge.scheduler.max_thread_count" : "17"
}'
{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[hostname.example.net][10.1.4.188:9300][indices:admin/settings/update]"}],"type":"illegal_argument_exception","reason":"maxThreadCount (= 8) should be <= maxMergeCount (= 6)"},"status":400}

```

I tried with "index.merge.scheduler.max\_merge\_count" too, and any other param. I tried every possible value below, equal, or above 6/8. I tried other params.

Despaired, I shutdown the whole cluster, and restarted nodes. My indices won't open anymore. I saw the params are kept in ".st" files in master and data nodes, but I don't know how they can be edited easily.

My current understanding of the problem is:

- ES accepted params it shouldn't have accepted in the first place
- current settings prevent any setting modifications
- if I read the code correctly, "MergeSchedulerConfig::setMaxThreadAndMergeCount()" is called on instantiation with the current params, so I don't have any hope of recovering my index (with 180M docs in it) without going back to a valid "state" file.
- my other option is to recompile ES without this safety check just to open my indices and configure this setting to a right value and go back to an official .jar afterwards

What do you think? I find this issue on GH: [https://github.com/elastic/elasticsearch/issues/20380](https://github.com/elastic/elasticsearch/issues/20380) / [https://github.com/elastic/elasticsearch/pull/20383](https://github.com/elastic/elasticsearch/pull/20383), but it's supposed to be in 5.0.0, and my problem happens on 5.0.2.

Thanks,

Jean-Baptiste

---

<div class="post-metadata">

**Author:** ![jimczi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimczi/32/47985_2.png) [@jimczi](https://discuss.elastic.co/u/jimczi)\
**Post date:** [February 27, 2017, 6:20pm UTC](https://discuss.elastic.co/t/problem-updating-settings-maxthreadcount-8-should-be-maxmergecount-6/76279/2 "2017-02-27T18:20:31Z")

</div>

Thanks for reporting Jean-Baptiste.  
I opened [https://github.com/elastic/elasticsearch/pull/23391](https://github.com/elastic/elasticsearch/pull/23391) for the fix.

```
 my other option is to recompile ES without this safety check just to open my indices and configure this setting to a right value and go back to an official .jar afterwards

```

Yes this is the only option I see at the moment, sorry for the trouble. The fix will be in 5.3 hopefully.

---

<div class="post-metadata">

**Author:** ![jbbarth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbbarth/32/12266_2.png) [@jbbarth](https://discuss.elastic.co/u/jbbarth)\
**Post date:** [February 27, 2017, 11:42pm UTC](https://discuss.elastic.co/t/problem-updating-settings-maxthreadcount-8-should-be-maxmergecount-6/76279/3 "2017-02-27T23:42:33Z")

</div>

@jimczi thanks for your answer and the PR! Happy to help pushing it if needed, let me know what I can do to help.

I ended up rebuilding a jar with the a few guard lines commented out and I could change the setting to a safe value and get my data back. It was surprisingly easy btw, I'll write a quick article on that, it will hopefully help other people needing that kind of sorcery. Thanks!

---

<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:** [March 27, 2017, 11:42pm UTC](https://discuss.elastic.co/t/problem-updating-settings-maxthreadcount-8-should-be-maxmergecount-6/76279/4 "2017-03-27T23:42:53Z")

</div>

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