diff --git a/server/src/main/java/org/opensearch/index/store/Store.java b/server/src/main/java/org/opensearch/index/store/Store.java index 8967100d4faf0..6225332292d91 100644 --- a/server/src/main/java/org/opensearch/index/store/Store.java +++ b/server/src/main/java/org/opensearch/index/store/Store.java @@ -824,6 +824,10 @@ private void cleanupFiles(Collection filesToConsiderForCleanup, String r try { directory.deleteFile(reason, existingFile); } catch (IOException ex) { + if (ex instanceof NoSuchFileException) { + // file doesn't exist, nothing to do. + return; + } if (existingFile.startsWith(IndexFileNames.SEGMENTS) || existingFile.startsWith(CORRUPTED_MARKER_NAME_PREFIX)) { // TODO do we need to also fail this if we can't delete the pending commit file? // if one of those files can't be deleted we better fail the cleanup otherwise we might leave an old commit