elasticsearch/elasticsearch — Issue #1718: Local Gateway: Delete dangling indices after a (configurable) timeout, and not immediately 
Author: kimchy
Created: 2012-02-17 23:43:51+00:00
State: open
Labels: enhancement, v0.19.0.RC3

Dangling indices can happen for example when one starts a single fresh node (with no "recover after" settings), which goes on and forms a single node cluster with no indices. Then, another node is started, which does hold certain data. The node joins the cluster, and currently, its data will be deleted since there are no indices in the cluster. Those indices that the other node has are dangling indices.

We should try and help and protect against a mistake a user makes and not immediately delete dangling indices. We can do that now (0.19) thanks to the fact that local gateway state is stored per index / shard.

Add a setting, `indices.store.dangling_timeout`, which defaults to `2h` (2 hours). When a dangling index is detected, an INFO level logging will be logged explaining that the relevant dandling index will be deleted in the set timeout.

The timeout can be set to `0` to delete it immediately, or to `-1` to never delete dangling indices.