Store: keep IndexFormatTooOldException and IndexFormatTooNewException in corruption marker (#33920)

Closes #33916
This commit is contained in:
Vladimir Dolzhenko 2018-09-21 14:00:02 +02:00 committed by GitHub
parent cac93949fe
commit 9c0316869b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -185,7 +185,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
failIfCorrupted();
try {
return readSegmentsInfo(null, directory());
} catch (CorruptIndexException ex) {
} catch (CorruptIndexException | IndexFormatTooOldException | IndexFormatTooNewException ex) {
markStoreCorrupted(ex);
throw ex;
}

View File

@ -146,7 +146,6 @@ public class RemoveCorruptedShardDataCommandTests extends IndexShardTestCase {
}
}
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/33916")
public void testCorruptedIndex() throws Exception {
final int numDocs = indexDocs(indexShard, true);
@ -179,10 +178,10 @@ public class RemoveCorruptedShardDataCommandTests extends IndexShardTestCase {
} else {
assertThat(e.getMessage(), containsString("aborted by user"));
}
} finally {
logger.info("--> output:\n{}", t.getOutput());
}
logger.info("--> output:\n{}", t.getOutput());
if (corruptSegments == false) {
// run command without dry-run