Skip to content

Commit 042802e

Browse files
vladimirdolzhenkokcm
authored andcommitted
Store: keep IndexFormatTooOldException and IndexFormatTooNewException in corruption marker (#33920)
Closes #33916
1 parent ccb3b74 commit 042802e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

server/src/main/java/org/elasticsearch/index/store/Store.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public SegmentInfos readLastCommittedSegmentsInfo() throws IOException {
185185
failIfCorrupted();
186186
try {
187187
return readSegmentsInfo(null, directory());
188-
} catch (CorruptIndexException ex) {
188+
} catch (CorruptIndexException | IndexFormatTooOldException | IndexFormatTooNewException ex) {
189189
markStoreCorrupted(ex);
190190
throw ex;
191191
}

server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ public void testShardLock() throws Exception {
146146
}
147147
}
148148

149-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/33916")
150149
public void testCorruptedIndex() throws Exception {
151150
final int numDocs = indexDocs(indexShard, true);
152151

@@ -179,10 +178,10 @@ public void testCorruptedIndex() throws Exception {
179178
} else {
180179
assertThat(e.getMessage(), containsString("aborted by user"));
181180
}
181+
} finally {
182+
logger.info("--> output:\n{}", t.getOutput());
182183
}
183184

184-
logger.info("--> output:\n{}", t.getOutput());
185-
186185
if (corruptSegments == false) {
187186

188187
// run command without dry-run

0 commit comments

Comments
 (0)