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

Allow CFS be empty

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4, 4.0-ALPHA
    • Fix Version/s: 3.4, 4.0-ALPHA
    • Component/s: core/store
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      since we changed CFS semantics slightly closing a CFS directory on an error can lead to an exception. Yet, an empty CFS is still a valid CFS so for consistency we should allow CFS to be empty.
      here is an example:

      1 tests failed.
      REGRESSION:  org.apache.lucene.index.TestIndexWriterOnDiskFull.testAddDocumentOnDiskFull
      
      Error Message:
      CFS has no entries
      
      Stack Trace:
      java.lang.IllegalStateException: CFS has no entries
             at org.apache.lucene.store.CompoundFileWriter.close(CompoundFileWriter.java:139)
             at org.apache.lucene.store.CompoundFileDirectory.close(CompoundFileDirectory.java:181)
             at org.apache.lucene.store.DefaultCompoundFileDirectory.close(DefaultCompoundFileDirectory.java:58)
             at org.apache.lucene.index.SegmentMerger.createCompoundFile(SegmentMerger.java:139)
             at org.apache.lucene.index.IndexWriter.mergeMiddle(IndexWriter.java:4252)
             at org.apache.lucene.index.IndexWriter.merge(IndexWriter.java:3863)
             at org.apache.lucene.index.SerialMergeScheduler.merge(SerialMergeScheduler.java:37)
             at org.apache.lucene.index.IndexWriter.maybeMerge(IndexWriter.java:2715)
             at org.apache.lucene.index.IndexWriter.maybeMerge(IndexWriter.java:2710)
             at org.apache.lucene.index.IndexWriter.maybeMerge(IndexWriter.java:2706)
             at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3513)
             at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2064)
             at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2031)
             at org.apache.lucene.index.TestIndexWriterOnDiskFull.addDoc(TestIndexWriterOnDiskFull.java:539)
             at org.apache.lucene.index.TestIndexWriterOnDiskFull.testAddDocumentOnDiskFull(TestIndexWriterOnDiskFull.java:74)
             at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:1277)
             at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:1195)
      

        Attachments

        1. LUCENE-3279.patch
          5 kB
          Simon Willnauer

          Activity

            People

            • Assignee:
              simonw Simon Willnauer
              Reporter:
              simonw Simon Willnauer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: