# Promote replica to primary

**URL:** https://discuss.elastic.co/t/promote-replica-to-primary/106942
**Category:** Elasticsearch
**Created:** [November 8, 2017, 10:36pm UTC](https://discuss.elastic.co/t/promote-replica-to-primary/106942 "2017-11-08T22:36:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![erikstephens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erikstephens/32/5430_2.png) [@erikstephens](https://discuss.elastic.co/u/erikstephens)
#### Post date: [November 8, 2017, 10:36pm UTC](https://discuss.elastic.co/t/promote-replica-to-primary/106942/1 "2017-11-08T22:36:13Z")

</div>

After a network partition, primary shards are heavily skewed to the side where the master was. Partition is now healed but there's too much traffic to & from the side with more of the primaries. To resolve that, would like the replicas that were on the other side of the partition to be promoted as primaries. I can stop writes to the index so making sure the replica is in sync is not an issue. The `allocate_stale_primary` command of the reroute api looked close to what I'm trying to do but it complains that primary is already assigned. There are a way to promote replicas to primaries _without_ data movement / triggering reallocation? Thanks!

---

<div class="post-metadata">

### Author: ![erikstephens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erikstephens/32/5430_2.png) [@erikstephens](https://discuss.elastic.co/u/erikstephens)
#### Post date: [November 9, 2017, 12:50am UTC](https://discuss.elastic.co/t/promote-replica-to-primary/106942/2 "2017-11-09T00:50:49Z")

</div>

It's looking like the `cancel` operation is doing what I want: stop writes, flush, cancel causes a replica to become the primary and the old primary to reinitialize as a replica with no data movement. Based on the docs, not sure if that is by design or a happy accident 🙂

---

<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: [November 9, 2017, 2:11am UTC](https://discuss.elastic.co/t/promote-replica-to-primary/106942/3 "2017-11-09T02:11:32Z")

</div>

I don't think this is by design, but it's good to hear!

---

<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: [December 7, 2017, 2:11am UTC](https://discuss.elastic.co/t/promote-replica-to-primary/106942/4 "2017-12-07T02:11:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
