elasticsearch/elasticsearch — pull request #6938 by s1monw (2014-07-21 11:32:47+00:00)
Title: [RESTORE] Fail restore if snapshot is corrupted

today if a snapshot is corrupted the restore operation
never terminates. Yet, if the snapshot is corrupted there
is no way to restore it anyway. If such a snapshot is restored
today the only way to cancle it is to delete the entire index which
might cause dataloss. This commit also fixes an issue in InternalEngine
where a deadlock can occur if a corruption is detected during flush
since the InternalEngine#snapshotIndex aqcuires a topLevel read lock
which prevents closing the engine.