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

Index changes are lost if you call prepareCommit() then close()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      You are supposed to call commit() after calling prepareCommit(), but... if you forget, and call close() after prepareCommit() without calling commit(), then any changes done after the prepareCommit() are silently lost (including adding/deleting docs, but also any completed merges).

      Spinoff from java-user thread "lots of .cfs (compound files) in the index directory" from Tim Bogaert.

      I think to fix this, IW.close should throw an IllegalStateException if prepareCommit() was called with no matching call to commit().

        Attachments

        1. LUCENE-3872.patch
          2 kB
          Michael McCandless
        2. LUCENE-3872.patch
          4 kB
          Michael McCandless

          Activity

            People

            • Assignee:
              mikemccand Michael McCandless
              Reporter:
              mikemccand Michael McCandless
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: