Skip to content

Commit 4871fef

Browse files
authored
Always use NORMAL ReadAdvice with cfs files (elastic#135831)
This works around an issue where RANDOM advice was being used for flushes, which causes a significant increase in IOPS and a drop in performance.
1 parent 0ba2f6a commit 4871fef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ private static BiFunction<String, IOContext, Optional<ReadAdvice>> getReadAdvice
157157
if (context.hints().contains(StandardIOBehaviorHint.INSTANCE)) {
158158
return Optional.of(ReadAdvice.NORMAL);
159159
}
160+
if (name.endsWith(".cfs")) {
161+
return Optional.of(ReadAdvice.NORMAL);
162+
}
160163
return MMapDirectory.ADVISE_BY_CONTEXT.apply(name, context);
161164
};
162165
}

0 commit comments

Comments
 (0)