Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-138

[PATCH] Poor file modification resolution on OSX causes reader/writer conflict test to fail

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • core/store
    • None
    • Operating System: All
      Platform: Macintosh

    • 23534

    Description

      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

      Attachments

        Activity

          People

            java-dev@lucene.apache.org Lucene Developers
            hani Hani Suleiman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: