Lucene - Core
  1. Lucene - Core
  2. LUCENE-4972

DirectoryTaxonomyWriter makes a commit even if no changes were made

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4, 6.0
    • Component/s: modules/facet
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Now that IndexWriter allows committing changes even if the only change is setCommitData, DirectoryTaxonomyWriter creates empty commits because whenever you call commit/close, it sets as commitData the indexEpoch, thereby creating unnecessary commit points.

      I think that DirTaxoWriter should track if the index is dirty ... or preferably get that from IndexWriter (i.e. getChangeCount or something). I'll create a test case exposing the bug and then fix DTW.

      1. LUCENE-4972.patch
        5 kB
        Shai Erera
      2. LUCENE-4972.patch
        5 kB
        Shai Erera

        Activity

        Hide
        Shai Erera added a comment -

        Patch adds isDirty flag to DTW and tests. I think it's ready, but would appreciate a review.

        Show
        Shai Erera added a comment - Patch adds isDirty flag to DTW and tests. I think it's ready, but would appreciate a review.
        Hide
        Michael McCandless added a comment -

        I wonder if instead of isDirty we could instead call IW.getCommitData() and check if the epoch hasn't changed?

        Show
        Michael McCandless added a comment - I wonder if instead of isDirty we could instead call IW.getCommitData() and check if the epoch hasn't changed?
        Hide
        Shai Erera added a comment -

        Patch removes isDirty and compares the epoch from indexWriter.commitData.

        Show
        Shai Erera added a comment - Patch removes isDirty and compares the epoch from indexWriter.commitData.
        Hide
        Michael McCandless added a comment -

        +1, thanks Shai.

        Show
        Michael McCandless added a comment - +1, thanks Shai.
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] shaie
        http://svn.apache.org/viewvc?view=revision&revision=1478638

        LUCENE-4972: DirectoryTaxonomyWriter makes a commit even if no changes were made

        Show
        Commit Tag Bot added a comment - [trunk commit] shaie http://svn.apache.org/viewvc?view=revision&revision=1478638 LUCENE-4972 : DirectoryTaxonomyWriter makes a commit even if no changes were made
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] shaie
        http://svn.apache.org/viewvc?view=revision&revision=1478640

        LUCENE-4972: DirectoryTaxonomyWriter makes a commit even if no changes were made

        Show
        Commit Tag Bot added a comment - [branch_4x commit] shaie http://svn.apache.org/viewvc?view=revision&revision=1478640 LUCENE-4972 : DirectoryTaxonomyWriter makes a commit even if no changes were made
        Hide
        Shai Erera added a comment -

        Committed to trunk and 4x. Thanks Mike!

        Show
        Shai Erera added a comment - Committed to trunk and 4x. Thanks Mike!
        Hide
        Steve Rowe added a comment -

        Bulk close resolved 4.4 issues

        Show
        Steve Rowe added a comment - Bulk close resolved 4.4 issues

          People

          • Assignee:
            Shai Erera
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development