elasticsearch/elasticsearch — pull request #7379 by s1monw (2014-08-21 15:10:13+00:00)
Title: [STORE] Ignore segments.gen on metadata snapshots

The `segments.gen` file is optional and might even change while we read it. It's safer to just ignore that file in the snapshot instead.

we saw test failing with:
```
Caused by: org.apache.lucene.index.CorruptIndexException: codec footer mismatch: actual footer=0 vs expected footer=-1071082520 (resource: MockIndexInputWrapper(NIOFSIndexInput(path="/Users/igor/Projects/elasticsearch/data/shared-hoverfly.local-CHILD_VM=[0]-CLUSTER_SEED=[-3070528509192838244]-HASH=[138C74D8B6080338]/nodes/1/indices/test-idx/5/index/segments.gen")))
at org.apache.lucene.codecs.CodecUtil.validateFooter(CodecUtil.java:235)
at org.apache.lucene.codecs.CodecUtil.retrieveChecksum(CodecUtil.java:228)
at org.elasticsearch.index.store.Store$MetadataSnapshot.checksumFromLuceneFile(Store.java:564)
at org.elasticsearch.index.store.Store$MetadataSnapshot.buildMetadata(Store.java:498)
at org.elasticsearch.index.store.Store$MetadataSnapshot.(Store.java:459)
at org.elasticsearch.index.store.Store.getMetadata(Store.java:154)
at org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository$SnapshotContext.snapshot(BlobStoreIndexShardRepository.java:428)
```

which can happen if commits happen concurrently since this file gets corrupted on purpose during a commit