elasticsearch/elasticsearch — pull request #8610 by s1monw (2014-11-22 20:58:06+00:00)
Title: [GATEWAY] Remove _state directory if index has been deleted

Today we try to delete the index directory if all shard locks have been
acquired. Yet, if this fails due to still running recoveries etc. We might
re-import the index as dangeling which also can happen if the node is restarted.
In contrast to the shard direcotries we can safely delete the metastate which is used
to import dangling indices while leaving the shard directories untouched.