# Will turnning allow\_primary on delete the exist shard?

**URL:** https://discuss.elastic.co/t/will-turnning-allow-primary-on-delete-the-exist-shard/23053
**Category:** Elasticsearch
**Created:** [April 2, 2015, 3:39am UTC](https://discuss.elastic.co/t/will-turnning-allow-primary-on-delete-the-exist-shard/23053 "2015-04-02T03:39:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yang\_2](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@yang\_2](https://discuss.elastic.co/u/yang_2)
#### Post date: [April 2, 2015, 3:39am UTC](https://discuss.elastic.co/t/will-turnning-allow-primary-on-delete-the-exist-shard/23053/1 "2015-04-02T03:39:09Z")

</div>

Hi,

We had some outage wiht ES cluster. So that we cutoff the incomming and  
outgoing traffic to/from ES cluster.

but we see lots of unassigned shards and get get them allocated  
automatically.

Question is, will tuning allow\_primary flag on when manually allocating the  
shards delete the existing data?  
I did so, and saw those shards immediately became available with size 0b.

THanks,  
Yang

--  
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/7ebd6baf-dd5b-40db-8894-a203b9607e8a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7ebd6baf-dd5b-40db-8894-a203b9607e8a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [April 2, 2015, 3:55am UTC](https://discuss.elastic.co/t/will-turnning-allow-primary-on-delete-the-exist-shard/23053/2 "2015-04-02T03:55:25Z")

</div>

The docs mention this is a possibility -

> **[Cluster reroute API | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html)**

allocate

Allocate an unassigned shard to a node. Accepts the index and shard for  
index name and shard number, and node to allocate the shard to. It also  
accepts allow\_primary flag to explicitly specify that it is allowed to  
explicitly allocate a primary shard (might result in data loss).

On 2 April 2015 at 14:39, [yang@getblueshift.com](mailto:yang@getblueshift.com) wrote:

> Hi,
> 
> We had some outage wiht ES cluster. So that we cutoff the incomming and  
> outgoing traffic to/from ES cluster.
> 
> but we see lots of unassigned shards and get get them allocated  
> automatically.
> 
> Question is, will tuning allow\_primary flag on when manually allocating  
> the shards delete the existing data?  
> I did so, and saw those shards immediately became available with size 0b.
> 
> THanks,  
> Yang
> 
> --  
> 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/7ebd6baf-dd5b-40db-8894-a203b9607e8a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7ebd6baf-dd5b-40db-8894-a203b9607e8a%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/7ebd6baf-dd5b-40db-8894-a203b9607e8a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7ebd6baf-dd5b-40db-8894-a203b9607e8a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAEYi1X8jTTpObh0B6KCDLoyhtgFMtxNeM4kscAjFbwkYTOU1AQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8jTTpObh0B6KCDLoyhtgFMtxNeM4kscAjFbwkYTOU1AQ%40mail.gmail.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:22am UTC](https://discuss.elastic.co/t/will-turnning-allow-primary-on-delete-the-exist-shard/23053/3 "2017-07-06T00:22:07Z")

</div>


