# Alias update not atomic

**URL:** https://discuss.elastic.co/t/alias-update-not-atomic/53833
**Category:** Elasticsearch
**Created:** [June 23, 2016, 9:16pm UTC](https://discuss.elastic.co/t/alias-update-not-atomic/53833 "2016-06-23T21:16:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![baller](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@baller](https://discuss.elastic.co/u/baller)
#### Post date: [June 23, 2016, 9:16pm UTC](https://discuss.elastic.co/t/alias-update-not-atomic/53833/1 "2016-06-23T21:16:42Z")

</div>

Hi, I'm experiencing a very strange issue that only occurs sometimes when updating aliases (POST /\_aliases). I'm sending a request like the following:

```
`{'actions': [
    {'remove': {'index': old_index_name,
                'alias': index_alias}},
    {'add': {'index': new_index_name,
             'alias': index_alias}}
]}`

```

However, sometimes after executing this, I'm still unable to index objects to the alias and the error indicates that the alias points to multiple indexes (`can't execute a single index op`). Another strange thing is that querying the alias information indicates that only one index is associated with the alias.

Is there any way to ensure that this set of actions happens and doesn't leave the alias pointing to multiple indexes? What am I misunderstanding about how this API works?

Thank you!

---

<div class="post-metadata">

### Author: ![Rajind\_Ruparathna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajind_ruparathna/32/10545_2.png) [@Rajind\_Ruparathna](https://discuss.elastic.co/u/Rajind_Ruparathna)
#### Post date: [January 24, 2017, 4:07am UTC](https://discuss.elastic.co/t/alias-update-not-atomic/53833/2 "2017-01-24T04:07:58Z")

</div>

@baller Any luck with this ? I am experiencing a similar issue.

---

<div class="post-metadata">

### Author: ![baller](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@baller](https://discuss.elastic.co/u/baller)
#### Post date: [January 24, 2017, 4:23am UTC](https://discuss.elastic.co/t/alias-update-not-atomic/53833/3 "2017-01-24T04:23:52Z")

</div>

I never solved this directly but it could have to do with your tiebreaker running out of memory and restarting, causing state to be confused. Once elastic support increased the memory for my tiebreaker, this issue went away. You could reach out to elastic support and ask them to see if your tiebreaker is running out of mem. Hope this helps!

---

<div class="post-metadata">

### Author: ![Rajind\_Ruparathna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajind_ruparathna/32/10545_2.png) [@Rajind\_Ruparathna](https://discuss.elastic.co/u/Rajind_Ruparathna)
#### Post date: [January 24, 2017, 5:40am UTC](https://discuss.elastic.co/t/alias-update-not-atomic/53833/4 "2017-01-24T05:40:44Z")

</div>

@baller thank you for your response. I'm actually on a test environment on my machine. Still the issue could be related to memory as I am testing with heavy load.

---

<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, 10:03pm UTC](https://discuss.elastic.co/t/alias-update-not-atomic/53833/5 "2017-07-05T22:03:56Z")

</div>


