# {index\_name}/{shard\_id}/\_state directory is missing and {index\_name}/{shard\_id}/index directory is empty (all index files are gone) after a few nodes were restarted at the same time

**URL:** <https://discuss.elastic.co/t/index-name-shard-id--state-directory-is-missing-and-index-name-shard-id-index-directory-is-empty-all-index-files-are-gone-after-a-few-nodes-were-restarted-at-the-same-time/23670>\
**Category:** Elasticsearch\
**Created:** [May 22, 2015, 11:50am UTC](https://discuss.elastic.co/t/index-name-shard-id--state-directory-is-missing-and-index-name-shard-id-index-directory-is-empty-all-index-files-are-gone-after-a-few-nodes-were-restarted-at-the-same-time/23670 "2015-05-22T11:50:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Chuen\_Ooi](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Lee\_Chuen\_Ooi](https://discuss.elastic.co/u/Lee_Chuen_Ooi)\
**Post date:** [May 22, 2015, 11:50am UTC](https://discuss.elastic.co/t/index-name-shard-id--state-directory-is-missing-and-index-name-shard-id-index-directory-is-empty-all-index-files-are-gone-after-a-few-nodes-were-restarted-at-the-same-time/23670/1 "2015-05-22T11:50:45Z")

</div>

Hi,  
I am using ElasticSearch version 1.5.0.

Our ElasticSearch cluster has 8 shards with 1 replica, hosted on 7 data  
nodes + 1 master node with setting below:

gateway.recover\_after\_nodes: 4  
gateway.recover\_after\_time: 5m  
gateway.expected\_nodes: 6

After a few nodes were restarted at the same time, 2 out of 7 shards (both  
Primary and Replicat) are in UNASSIGNED status.  
Here are my findings when I check the shards data folder for these 2  
UNASSIGNED shards:

1. {index\_name}/{shard\_id} only exists in 1 out of 7 data nodes. It should  
exist in 2 out of 7 data nodes since we have 1 replica setting.
2. For {index\_name}/{shard\_id} which exists in one of the data nodes,  
{index\_name}/{shard\_id}/\_state directory is missing
3. For {index\_name}/{shard\_id} which exists in one of the data nodes,  
{index\_name}/{shard\_id}/index directory has 0 files -\> all index files are  
missing.

I am able to simulate this scenario after _a few rounds of stopping and  
starting_ the ElasticSearch cluster nodes (a few nodes at a time).  
Is this a known issue that {index\_name}/{shard\_id}/\_state directory and the  
index files will be lost if the nodes are restarted during  
initializing/relocating?

Thanks.

Lee Chuen

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ef335410-9d64-4da0-9ce9-052bc6941af9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ef335410-9d64-4da0-9ce9-052bc6941af9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:12am UTC](https://discuss.elastic.co/t/index-name-shard-id--state-directory-is-missing-and-index-name-shard-id-index-directory-is-empty-all-index-files-are-gone-after-a-few-nodes-were-restarted-at-the-same-time/23670/2 "2017-07-06T00:12:25Z")

</div>


