elastic/elasticsearch

Bulk requests to an alias based on an old cluster state can cause strange rejection message

Open

#27,767 opened on Dec 12, 2017

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Java (76,700 stars) (25,882 forks)batch import
:Distributed/CRUD>bugTeam:Distributedhelp wantedhigh hanging fruit

Description

When a bulk request is based on an older state (where the index appears to need to be created) or where the node has not yet joined the cluster, and the request is issued using an alias instead of a concrete index, the node can send the request, then receive a confusing message about there already being an alias for that name, such as:

    [RemoteTransportException[[node-1][127.0.0.1:9300][indices:admin/create]]; 
    nested: InvalidIndexNameException[Invalid index name [current], already exists as 
    alias];]

There are really two things that should happen in this situation:

  • We should check that the node is in a ready state before continuing with the bulk processing (ie, there are no WRITE blocks in the cluster state)
  • When we receive a message about the alias already existing, we should not fail the bulk operation(s)

Relates to https://discuss.elastic.co/t/invalid-index-name/111131

Contributor guide

Bulk requests to an alias based on an old cluster state can cause strange rejection message · elastic/elasticsearch#27767 | Good First Issue