elasticsearch/elasticsearch — pull request #8917 by s1monw (2014-12-12 09:49:13+00:00)
Title: [TRANSLOG] Never delete translog file from a snapshot

If we are currently running a recovery and the source node is
closed due to a restart the last reference to the translog is from
the snapshot. The delete logic respects only the last passed parameter.
This causes the transaction log file to be fully deleted and essentially
loses all documents in the translog.

This usually happens during rolling restarts where the node holing
the primary is shutting down while a replica is recovering from it. Once
the primnary is coming up again recovering from gateway it will skip the
transaction log since it can't find the file.

Note: This logic has been remove entirely in 2.0. Deleting are only happening if
they are safe from a reference counting point of view.

Here is a smoking gun:

```
http://build-us-00.elasticsearch.org/job/es_bwc_1x/5686/CHECK_BRANCH=origin%2F1.3,jdk=JDK7,label=bwc/
```