# ES 2.4 to 5.2 Upgrade Followed By Major Cluster Instability

**URL:** https://discuss.elastic.co/t/es-2-4-to-5-2-upgrade-followed-by-major-cluster-instability/79943
**Category:** Elasticsearch
**Created:** [March 24, 2017, 7:45pm UTC](https://discuss.elastic.co/t/es-2-4-to-5-2-upgrade-followed-by-major-cluster-instability/79943 "2017-03-24T19:45:40Z")
**Posts on this page:** 1
**Showing post:** 24

<div class="post-metadata">

### Author: ![mstruve](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mstruve/32/50419_2.png) [@mstruve](https://discuss.elastic.co/u/mstruve)
#### Post date: [March 29, 2017, 10:49pm UTC](https://discuss.elastic.co/t/es-2-4-to-5-2-upgrade-followed-by-major-cluster-instability/79943/24 "2017-03-29T22:49:17Z")

</div>

OK folks, it looks like we have found a solution for our stability issue.

After sending ES a heap dump from one of our spikes they were able to [find a bug](https://github.com/elastic/elasticsearch/pull/23797) that affects filters in aggregations. In filtered aggs like the one below the bug causes the filter to be run as a bool query and it is therefore scored. This is a big issue for us bc we make A LOT of these.

```auto
{
  "agg_name":{
    "filter":{
      "terms":{
        "id":[1,2,...]
      }
    }
  }
}

```

The temp fix is to use constant\_score like this to avoid having the filter scored.

```auto
{ 
  "agg_name": {
    "filter": {
     "constant_score": {
       "filter": {
         "terms": {
            "id": []
          }
        }
      }
   }
}

```

That change looks to have completely stabilized us. The change went out at noon and this is how the graphs look pre and post change. Healthy saw tooth. We will be monitoring it closely and repost if anything changes. Thanks everyone for the help!

 ![](https://us1.discourse-cdn.com/elastic/original/3X/a/5/a515fdc6ee48e0e712d4c0f7408c88995dacd034.png)

---

_[View the full topic](https://discuss.elastic.co/t/es-2-4-to-5-2-upgrade-followed-by-major-cluster-instability/79943)._
