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

Lucene deletes entire index if and exception is thrown due do TooManyOpenFiles and OpenMode.CREATE_OR_APPEND

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.0, 4.1, 4.2, 3.6.2
    • 4.3, 4.2.1, 6.0
    • None
    • None
    • New, Patch Available

    Description

      The Lucene IndexWriter might delete an entire index if it hits a FileNotFoundException triggered by TooManyOpenFiles during IndexWriter creation. We try to figure out if the index exists already if the OpenMode.CREATE_OR_APPEND is set (which is default). Yet, the logic in DirectoryReader#indexExists(Directory) will just return false if we are not able to open the segment file. This will cause the IW to assume there is no index and it will try to create a new index there trashing all existing commit points treating this as a OpenMode.CREATE.

      Attachments

        1. LUCENE-4870.patch
          4 kB
          Simon Willnauer
        2. LUCENE-4870.patch
          5 kB
          Simon Willnauer
        3. LUCENE-4870.patch
          5 kB
          Simon Willnauer

        Activity

          People

            simonw Simon Willnauer
            simonw Simon Willnauer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: