Lucene - Core
  1. Lucene - Core
  2. LUCENE-138

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/store
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

      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

        Activity

        Hide
        Otis Gospodnetic added a comment -

        A better patch is attached to bug 23750.

        Show
        Otis Gospodnetic added a comment - A better patch is attached to bug 23750.
        Hide
        Hani Suleiman added a comment -

        Created an attachment (id=8402)
        Patch to ensure that touchFile works on OSX

        Show
        Hani Suleiman added a comment - Created an attachment (id=8402) Patch to ensure that touchFile works on OSX

          People

          • Assignee:
            Lucene Developers
            Reporter:
            Hani Suleiman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development