Lucene - Core
  1. Lucene - Core
  2. LUCENE-3365

Create or Append mode determined before obtaining write lock

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, 3.2, 3.3
    • Fix Version/s: 3.4, 4.0-ALPHA
    • Component/s: core/index
    • Labels:
    • Lucene Fields:
      New, Patch Available

      Description

      If an IndexWriter("writer1") is opened in CREATE_OR_APPEND mode, it determines whether to CREATE or APPEND before obtaining the write lock. When another IndexWriter("writer2") is in the process of creating the index, this can result in writer1 entering create mode and then waiting to obtain the lock. When writer2 commits and releases the lock, writer1 is already in create mode and overwrites the index created by write2.

      This bug was probably effected by LUCENE-2386 as prior to that Lucene generated an empty commit when a new index was created. I think the issue could still have occurred prior to that but the two IndexWriters would have needed to be opened nearly simultaneously and the first IndexWriter would need to release the lock before the second timed out.

      1. LUCENE-3365.patch
        6 kB
        Geoff Cooney
      2. LUCENE-3365.patch
        5 kB
        Simon Willnauer

        Activity

        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Simon Willnauer made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Simon Willnauer made changes -
        Attachment LUCENE-3365.patch [ 12489949 ]
        Simon Willnauer made changes -
        Fix Version/s 3.4 [ 12316675 ]
        Fix Version/s 4.0 [ 12314025 ]
        Lucene Fields [New] [New, Patch Available]
        Priority Minor [ 4 ] Major [ 3 ]
        Simon Willnauer made changes -
        Assignee Simon Willnauer [ simonw ]
        Geoff Cooney made changes -
        Comment [ Patch containing junit test case and fix ]
        Geoff Cooney made changes -
        Field Original Value New Value
        Attachment LUCENE-3365.patch [ 12489832 ]
        Geoff Cooney created issue -

          People

          • Assignee:
            Simon Willnauer
            Reporter:
            Geoff Cooney
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development