Affects Version/s: None
Fix Version/s: None
Operating System: All
Since the file modification resolution on OSX appears to be 1000ms, the touchFile method in
FSDirectory ends up not actually modifying the file's modification time. This in turn causes the
IndexReader not to detect that it is working with stale info, thus losing information.
The same problem happens in the optimize call, where a new segment file is written, but this is
not detected as being 'newer' than the old one.
I am unsure of whether the fixes I propose are 100% correct though (adding a directory.touchFile
at the end of the optimize method). Maybe there should be some locking involved, as this could
take up to a second?
Anyway, here's a patch, so those in the know can decide on exactly how to tweak it to ensure it's
perfect for all situations