Store: keep IndexFormatTooOldException and IndexFormatTooNewException in corruption marker (#33920)
Closes #33916
This commit is contained in:
parent
cac93949fe
commit
9c0316869b
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue