Skip to content

Conversation

@ChrisHegarty
Copy link
Contributor

DirectIOIT requires a filesystem that supports Direct IO.

The Elasticsearch CI builds and tests on a tmpfs, /dev/shm/bk, which does not support O_DIRECT.

relates #128370

@ChrisHegarty ChrisHegarty added >test Issues or PRs that are addressing/adding tests :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch labels May 27, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@ChrisHegarty
Copy link
Contributor Author

ChrisHegarty commented May 28, 2025

Without this change we encounter failures like:

 Caused by: java.nio.file.FileSystemException: /dev/shm/bk/chegar/elasticsearch/server/build/testrun/internalClusterTest/temp/org.elasticsearch.index.store.DirectIOIT_6D6
A5FF9F7D9F475-001/tempDir-002/node_s3/d1/indices/LfI708mWQmmunpqa3_2VFw/9/
index/_0_ES818BinaryQuantizedVectorsFormat_0.vec: Invalid argument
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:100) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
        at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:213) ~[?:?]
        at java.nio.channels.FileChannel.open(FileChannel.java:301) ~[?:?]
        at java.nio.channels.FileChannel.open(FileChannel.java:353) ~[?:?]
        at org.apache.lucene.misc.store.DirectIODirectory$DirectIOIndexInput.<init>(DirectIODirectory.java:318) ~[lucene-misc-10.2.1.jar:10.2.1 1b2451b5f435ad2c41a8b6b0f0d6a59b24ff9ad2 - 2025-04-25 16:50:53]
        at org.apache.lucene.misc.store.DirectIODirectory.openInput(DirectIODirectory.java:173) ~[lucene-misc-10.2.1.jar:10.2.1 1b2451b5f435ad2c41a8b6b0f0d6a59b24ff9ad2 - 2025-04-25 16:50:53]
        at org.elasticsearch.index.store.FsDirectoryFactory$HybridDirectory.openInputDirect(FsDirectoryFactory.java:199) ~[main/:?]
        at org.elasticsearch.index.codec.vectors.es818.DirectIOLucene99FlatVectorsReader.openDataInput(DirectIOLucene99FlatVectorsReader.java:131) ~[main/:?]
...

@ChrisHegarty ChrisHegarty merged commit 31c08d0 into elastic:lucene_snapshot May 28, 2025
14 of 17 checks passed
@ChrisHegarty ChrisHegarty deleted the fix_directIO_test_dev_shm branch May 28, 2025 10:19
@thecoop
Copy link
Member

thecoop commented Jun 3, 2025

Shouldn't this check be within Elasticsearch? ES should work regardless of what the underlying file system is, using direct io opportunistically

@ChrisHegarty
Copy link
Contributor Author

While the Elasticsearch CI builds and tests on a tmpfs, /dev/shm/bk, which does not support O_DIRECT, there are "periodic" builds/tests that use a "real" file-system. So there is coverage for directIO in "the system", just not on every PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch >test Issues or PRs that are addressing/adding tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants