# ElasticSearch reindex suddenly cut docs by half and went red

**URL:** <https://discuss.elastic.co/t/elasticsearch-reindex-suddenly-cut-docs-by-half-and-went-red/27280>\
**Category:** Elasticsearch\
**Created:** [August 12, 2015, 6:08pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-suddenly-cut-docs-by-half-and-went-red/27280 "2015-08-12T18:08:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thyagobr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thyagobr/32/602_2.png) [@thyagobr](https://discuss.elastic.co/u/thyagobr)\
**Post date:** [August 12, 2015, 6:08pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-suddenly-cut-docs-by-half-and-went-red/27280/1 "2015-08-12T18:08:25Z")

</div>

Hi, everyone.

I have a 25GB elasticsearch index and I have to add an analyzer to some fields, so I'm reindexing the entire index.

I wrote a ruby script that ran fine, but, this time, it behaved  
oddly: when I was reaching the last docs (a bit over 10 million docs)  
and, suddenly, my new index showed only half-ish the documents (5747957  
out of 10902974-ish - and 13.34GB out of 25GB-ish) and went red. Funny  
thing is the behaviour I watched on kopf plugin:

![](https://us1.discourse-cdn.com/elastic/original/2X/9/9e2bfa55d3751e6749414b65766a5ee4b8724a06.png)

There is always one primary shard deallocated (as you can see, both  
3's are unassigned, but they keep shifting to other shards every second  
or so). On top of that, I've noticed this:

![](https://us1.discourse-cdn.com/elastic/original/2X/7/786662c418125c4e0214d94f18c82081c041c085.png)

So, that disk space might be the issue too... and that one shard just won't initilize, it keeps that "1 shard initializing", but I'm not sure what's going on.

Could anyone shed some light on this issue?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [August 12, 2015, 9:29pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-suddenly-cut-docs-by-half-and-went-red/27280/2 "2015-08-12T21:29:10Z")

</div>

I suggest you close or delete the index. If you close it, it will leave the data there and you can re-open it at any time. With the index closed the cluster state will most likely go green. If thats the case, then you can delete the bad index, and try to re-index again.

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [August 14, 2015, 12:15pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-suddenly-cut-docs-by-half-and-went-red/27280/3 "2015-08-14T12:15:38Z")

</div>

did u try adding more disk space / disk (updating [https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html#paths](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html#paths)) so things settle down.

Btw - ES reports the document count available in active shards so if you have shard which is still not initialized/started, the documents in that shard will not show up.

---

<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, 11:55pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-suddenly-cut-docs-by-half-and-went-red/27280/4 "2017-07-05T23:55:46Z")

</div>


