elasticsearch/elasticsearch — pull request #8059 by bleskes (2014-10-11 16:50:47+00:00)
Title: Internal: dangling indices import ignores aliases

Dangling indices are indexes found on disk which are not part of the cluster state. By default, we don't delete them but rather import them into the cluster state in order to not accidentally delete data and also allow for the ease of copying index data folders from one cluster to another. Currently, the import logic doesn't check for existing aliases of the same name as the imported dangling index, causing both an index and an alias with the same name.

This commit add a protection against this. Note that the index is still kept as dangling and is only deleted from disk after `gateway.local.dangling_timeout` has passed (2 hours).

We also change the log message indicating deletion of dangling indices to a `WARN` level.