Alias update not atomic

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!

1 Like

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

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!

1 Like

@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.