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

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

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.6, 4.0-ALPHA
    • None
    • None
    • 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

            mikemccand Michael McCandless
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: