c# - Elasticsearch - Indexing missing while updating alias -
per blog post: https://www.elastic.co/blog/changing-mapping-with-zero-downtime/, using recommended best practice updating index in production 0 downtime using aliases. despite this, periodically seeing "index missing" exceptions across our application while update running. cannot seem diagnose behavior, , not sure issue be.
current process
- determine index being targeted default alias (there's @ 1)
- sequence current index name appending/incrementing counter: index-name-v1
- create new index , populate data
- update alias in 1 operation: remove old index , add new index
- delete index -2 versions current index -- done ensure index returning data prior alias update not deleted
despite this, we're getting random , regular index missing errors when querying data. alias never removed, updated atomically. there flawed approach not considering?
public virtual void swapalias(string aliasname, string oldindexname, string newindexname) { client.alias(a => { a.add(add => add.alias(aliasname).index(newindexname)); if (oldindexname != null && oldindexname != newindexname) a.remove(remove => remove.alias(aliasname).index(oldindexname)); return a; }); }
Comments
Post a Comment