Lucene - Core
  1. Lucene - Core
  2. LUCENE-1411

Enable IndexWriter to open an arbitrary commit point


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.9
    • Component/s: core/index
    • Labels:
    • Lucene Fields:


      With a 2-phase commit involving multiple resources, each resource
      first does its prepareCommit and then if all are successful they each
      commit. If an exception or timeout/power loss is hit in any of the
      resources during prepareCommit or commit, all of the resources must
      then rollback.

      But, because IndexWriter always opens the most recent commit, getting
      Lucene to rollback after commit() has been called is not easy, unless
      you make Lucene the last resource to commit. A simple workaround is
      to simply remove the segments_N files of the newer commits but that's
      sort of a hassle.

      To fix this, we just need to add a ctor to IndexWriter that takes an
      IndexCommit. We recently added this for IndexReader (LUCENE-1311) as
      well. This ctor is definitely an "expert" method, and only makes
      sense if you have a custom DeletionPolicy that preserves more than
      just the most recent commit.

      1. LUCENE-1411.patch
        18 kB
        Michael McCandless


        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12562817 ] jira [ 12584826 ]
        Mark Thomas made changes -
        Workflow jira [ 12443334 ] Default workflow, editable Closed status [ 12562817 ]
        Mark Miller made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Michael McCandless made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Michael McCandless made changes -
        Field Original Value New Value
        Attachment LUCENE-1411.patch [ 12391352 ]
        Michael McCandless created issue -


          • Assignee:
            Michael McCandless
            Michael McCandless
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: