Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
7.7.2
-
None
-
None
-
New
Description
If one of the existing segment files is opened by another (say a 3rd party) process, it can causing a parallel commit to fail with an error complaining about the index files to be locked by another process. Upon debugging, I see that fsync is being called during commit on already existing segment files, and failure to open the file in write mode causes this. But this should not be an expected behavior since there is no reason for a commit to open an existing segment file in WRITE mode to fsync. Please note that in this case, the index file was also a part of a saved commit point, so there is all the more reason to not fsync it.
The line of code I am referring to is as below:
try (final FileChannel file = FileChannel.open(fileToSync, isDir ? StandardOpenOption.READ : StandardOpenOption.WRITE))
in method fsync(Path fileToSync, boolean isDir) of the class file
lucene\core\src\java\org\apache\lucene\util\IOUtils.java
Opening this Jira after discussion with Mike McCandless and Michael Sokolov on the dev mailing list here:
Lucene - Java Developer - Lucene (unexpected ) fsync on existing segments (nabble.com)