Skip to content

Commit bbe364f

Browse files
authored
Always use NORMAL ReadAdvice with cfs files (#135831) (#136606)
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 f4f0f50 commit bbe364f

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
@@ -147,6 +147,9 @@ private static BiFunction<String, IOContext, Optional<ReadAdvice>> getReadAdvice
147147
if (context.hints().contains(StandardIOBehaviorHint.INSTANCE)) {
148148
return Optional.of(ReadAdvice.NORMAL);
149149
}
150+
if (name.endsWith(".cfs")) {
151+
return Optional.of(ReadAdvice.NORMAL);
152+
}
150153
return MMapDirectory.ADVISE_BY_CONTEXT.apply(name, context);
151154
};
152155
}

0 commit comments

Comments
 (0)