diff --git a/server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java b/server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java index a3ab206191f9e..e37336c54b102 100644 --- a/server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java +++ b/server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java @@ -171,6 +171,12 @@ protected boolean useDirectIO(String name, IOContext context, OptionalLong fileL @Override public IndexInput openInput(String name, IOContext context) throws IOException { + // Force direct I/O for stored field temp fdt files, given that these are used once and then removed: + // (tmp fdt files should only exist when index sorting is enabled) + if (directIODelegate != null && LuceneFilesExtensions.TMP.getExtension().equals(getExtension(name)) && name.contains("fdt")) { + return openInputDirect(name, context); + } + if (useDelegate(name, context)) { // we need to do these checks on the outer directory since the inner doesn't know about pending deletes ensureOpen();