# Why data is rebuild during node restart

**URL:** <https://discuss.elastic.co/t/why-data-is-rebuild-during-node-restart/25844>\
**Category:** Elasticsearch\
**Created:** [July 18, 2015, 9:41am UTC](https://discuss.elastic.co/t/why-data-is-rebuild-during-node-restart/25844 "2015-07-18T09:41:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [July 18, 2015, 9:41am UTC](https://discuss.elastic.co/t/why-data-is-rebuild-during-node-restart/25844/1 "2015-07-18T09:41:25Z")

</div>

Hi,

When a es node (es 0.90.7) restart, the restarted node will rebuild shards using peers replica. Is the rebuild from size 0byte until it is balance with other peers? Why is this done so? is it because of the stale data even within few second restart?

Another question is, considering full cluster restart during upgrade. What's gonna happen to the data in the cluster? Will the cluster think all the data are stale and wipe all the data in this situation?

Thank you.

---

<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:** [July 18, 2015, 10:42am UTC](https://discuss.elastic.co/t/why-data-is-rebuild-during-node-restart/25844/2 "2015-07-18T10:42:25Z")

</div>

Older versions of ES weren't as smart they could have been with recovery, so they will retrieve the entire shard dataset from the current primary.  
If you restart the entire cluster then you just have to wait through recovery, data won't be deleted by ES.

That's a pretty old version by the way, you should really upgrade!

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [July 18, 2015, 11:14am UTC](https://discuss.elastic.co/t/why-data-is-rebuild-during-node-restart/25844/3 "2015-07-18T11:14:03Z")

</div>

> [@warkolm](#):
>
> If you restart the entire cluster then you just have to wait through recovery, data won't be deleted by ES.

do you have reference (book or code) for this? would definitely be very helpful.

> [@warkolm](#):
>
> That's a pretty old version by the way, you should really upgrade

did that before, but too many exceptions. it's a pity nonetheless.

---

<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 6, 2017, 12:00am UTC](https://discuss.elastic.co/t/why-data-is-rebuild-during-node-restart/25844/4 "2017-07-06T00:00:35Z")

</div>


