Skip to content

Commit 0907c5d

Browse files
committed
Force direct IO for fdt tmp file read access when flushing stored fields.
1 parent d487eb5 commit 0907c5d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ protected boolean useDirectIO(String name, IOContext context, OptionalLong fileL
171171

172172
@Override
173173
public IndexInput openInput(String name, IOContext context) throws IOException {
174+
// Force direct I/O for stored field temp fdt files, given that these are used once and then removed:
175+
// (tmp fdt files should only exist when index sorting is enabled)
176+
if (directIODelegate != null && LuceneFilesExtensions.TMP.getExtension().equals(getExtension(name)) && name.contains("fdt")) {
177+
// we need to do these checks on the outer directory since the inner doesn't know about pending deletes
178+
ensureOpen();
179+
ensureCanRead(name);
180+
return directIODelegate.openInput(name, context);
181+
}
182+
174183
if (useDelegate(name, context)) {
175184
// we need to do these checks on the outer directory since the inner doesn't know about pending deletes
176185
ensureOpen();

0 commit comments

Comments
 (0)