# ES 6.2.4 What should be done when having "out of sync replica" error

**URL:** <https://discuss.elastic.co/t/es-6-2-4-what-should-be-done-when-having-out-of-sync-replica-error/141197>\
**Category:** Elasticsearch\
**Created:** [July 23, 2018, 2:43pm UTC](https://discuss.elastic.co/t/es-6-2-4-what-should-be-done-when-having-out-of-sync-replica-error/141197 "2018-07-23T14:43:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [July 23, 2018, 2:43pm UTC](https://discuss.elastic.co/t/es-6-2-4-what-should-be-done-when-having-out-of-sync-replica-error/141197/1 "2018-07-23T14:43:46Z")

</div>

I just hit this issue when trying to close some indexes in the cluster.

What are the recommended actions that one should take in order to resolve this problem?

I have read this thread [Out Of Sync Replica](https://discuss.elastic.co/t/out-of-sync-replica/126588) and this thread [Replicas out of sync](https://discuss.elastic.co/t/replicas-out-of-sync/117128) and looks like my cluster might be having this issue because there are certain indexes in my cluster where some documents are created and then deleted in close successions. Although, I also have to add that we've had this behaviour (creating and deleting in close succesions) for a long while now on 6.2.4 and this is the first time we've hit this issue in our cluster.

---

<div class="post-metadata">

**Author:** ![Evesy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evesy/32/29520_2.png) [@Evesy](https://discuss.elastic.co/u/Evesy)\
**Post date:** [July 23, 2018, 4:09pm UTC](https://discuss.elastic.co/t/es-6-2-4-what-should-be-done-when-having-out-of-sync-replica-error/141197/2 "2018-07-23T16:09:58Z")

</div>

Hey @ld_pvl

When we hit the issue we had to scale the number of replicas on the index down to 0 and then back up again so they're built from scratch.

Worth saying that since we upgraded to 6.3 we've not seen the issue occur again.

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [July 23, 2018, 4:11pm UTC](https://discuss.elastic.co/t/es-6-2-4-what-should-be-done-when-having-out-of-sync-replica-error/141197/3 "2018-07-23T16:11:47Z")

</div>

Thanks Michael,

I will give that a try and that also gives me a reason to upgrade now.

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [July 25, 2018, 10:45am UTC](https://discuss.elastic.co/t/es-6-2-4-what-should-be-done-when-having-out-of-sync-replica-error/141197/4 "2018-07-25T10:45:33Z")

</div>

Yep it worked.

To summarise what I did.

Changed the index settings to set number of replicas to 0:

```
curl -X PUT "my_host:9200/problematic_indexes/_settings" -H 'Content-Type: application/json' -d'
{
    "index" : {
        "number_of_replicas" : 0
    }
}
'

```

Then back up to whatever number again:

```
curl -X PUT "my_host:9200/problematic_indexes/_settings" -H 'Content-Type: application/json' -d'
{
    "index" : {
        "number_of_replicas" : <googol>
    }
}
'

```

Now it's time to upgrade to 6.3.

Thanks again!

---

<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:** [August 22, 2018, 10:45am UTC](https://discuss.elastic.co/t/es-6-2-4-what-should-be-done-when-having-out-of-sync-replica-error/141197/5 "2018-08-22T10:45:41Z")

</div>

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