# What happen to replicas after rolling restart?

**URL:** <https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628>\
**Category:** Elasticsearch\
**Created:** [August 19, 2015, 2:56am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628 "2015-08-19T02:56:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinyke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shinyke/32/587_2.png) [@shinyke](https://discuss.elastic.co/u/shinyke)\
**Post date:** [August 19, 2015, 2:56am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/1 "2015-08-19T02:56:36Z")

</div>

Hi,

We follow these steps to restart our cluster [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_rolling\_restarts.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_rolling_restarts.html) .  
What make us confuse is the replicas‘ recovery. Do replicas lost in restart and need newly allocation？Or just do consistency checking on them.

Thanks & regards.  
Shiny

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 19, 2015, 2:58am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/2 "2015-08-19T02:58:22Z")

</div>

What version are you asking for, cause it changes between 1.5\>1.6

---

<div class="post-metadata">

**Author:** ![shinyke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shinyke/32/587_2.png) [@shinyke](https://discuss.elastic.co/u/shinyke)\
**Post date:** [August 19, 2015, 2:59am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/3 "2015-08-19T02:59:13Z")

</div>

Now using 1.7.1 @warkolm

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 19, 2015, 3:23am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/4 "2015-08-19T03:23:17Z")

</div>

Then they don't get removed, it uses [synced flush](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html) which is kinda like consistency checking.

---

<div class="post-metadata">

**Author:** ![shinyke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shinyke/32/587_2.png) [@shinyke](https://discuss.elastic.co/u/shinyke)\
**Post date:** [August 19, 2015, 3:34am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/5 "2015-08-19T03:34:04Z")

</div>

If we keep “cluster.routing.allocation.disable\_allocation : true” ,and allocate the replicas using command like this:

```
 curl -XPOST 127.0.0.1:9200/_cluster/reroute -d '{
  "commands" : [ {
        "allocate" :
            {
              "index" : "myIndex", "shard" : 1, "node" : "node_where_replica_in_before_restart"
            }
        }
  ]
}'

```

Will the replica not removed and recovery uses synced flush?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 19, 2015, 3:39am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/6 "2015-08-19T03:39:26Z")

</div>

Not unless that replica already exists on that node, if it doesn't then it needs to be completely copied over.

Why would you do that though?

---

<div class="post-metadata">

**Author:** ![shinyke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shinyke/32/587_2.png) [@shinyke](https://discuss.elastic.co/u/shinyke)\
**Post date:** [August 19, 2015, 3:47am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/7 "2015-08-19T03:47:37Z")

</div>

Thx for your anwser, that's very helpful~

We are considering a solutions which keep disable allocation and custom allocate all the shards. So that's the problem we met.

---

<div class="post-metadata">

**Author:** ![shinyke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shinyke/32/587_2.png) [@shinyke](https://discuss.elastic.co/u/shinyke)\
**Post date:** [August 19, 2015, 3:52am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/8 "2015-08-19T03:52:09Z")

</div>

I'm also curious about the replicas recovery in 1.5 . Can you tell me more about this in elder version?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 19, 2015, 4:04am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/9 "2015-08-19T04:04:44Z")

</div>

> [@shinyke](#):
>
> I'm also curious about the replicas recovery in 1.5 . Can you tell me more about this in elder version?

Pre 1.6 we essentially copied the entire shard over from scratch, ignoring anything the node may already have locally.

> [@shinyke](#):
>
> We are considering a solutions which keep disable allocation and custom allocate all the shards

But again, why? ES handles this all for you.

---

<div class="post-metadata">

**Author:** ![shinyke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shinyke/32/587_2.png) [@shinyke](https://discuss.elastic.co/u/shinyke)\
**Post date:** [August 19, 2015, 6:31am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/10 "2015-08-19T06:31:12Z")

</div>

Well...Our project manager do not trust any balance mechanism (Mongodb hurt his heart).So we can only control the shards ourselves. Although we show him how well it work do not help. QAQ

All in all, thx very much~

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 21, 2015, 9:35am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/11 "2015-08-21T09:35:59Z")

</div>

That's going to lead to larger problems.....

---

<div class="post-metadata">

**Author:** ![geekpete](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geekpete/32/20409_2.png) [@geekpete](https://discuss.elastic.co/u/geekpete)\
**Post date:** [May 20, 2016, 7:11am UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/12 "2016-05-20T07:11:33Z")

</div>

It's usually best to leverage the features and abilities of your tools to your advantage rather than to manage things of this nature manually. Elasticsearch handles allocation quite well automatically if used correctly. The more recent the version, usually the better things will run due to bug fixes and enhancements.

But I understand that you're under specific instructions to do it this way, all you can do is communicate that this isn't the recommended way and will lead to bigger issues the longer you do it this way and as your data/cluster grows.

---

<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:** [July 5, 2017, 10:50pm UTC](https://discuss.elastic.co/t/what-happen-to-replicas-after-rolling-restart/27628/13 "2017-07-05T22:50:14Z")

</div>


