Lucene - Core
  1. Lucene - Core
  2. LUCENE-4790

FieldCache.getDocTermOrds back to the future bug

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Found while working on LUCENE-4765:

      FieldCache.getDocTermOrds unsafely "bakes in" liveDocs into its structure.

      This means in cases if you have readers at two points in time (r1, r2), and you happen to call getDocTermOrds first on r2, then call it on r1, the results will be incorrect.

      Simple fix is to make DocTermOrds uninvert take liveDocs explicitly: FieldCacheImpl always passes null, Solr's UninvertedField just keeps doing what its doing today (since its a top-level reader, and cached somewhere else).

      Also DocTermOrds had a telescoping ctor that was uninverting twice.

        Activity

        Hide
        Robert Muir added a comment -

        Here's a test with my proposed fix. Again its to just make the livedocs always an explicit parameter so there are no traps or confusion, and FieldCacheImpl passes null always.

        Show
        Robert Muir added a comment - Here's a test with my proposed fix. Again its to just make the livedocs always an explicit parameter so there are no traps or confusion, and FieldCacheImpl passes null always.
        Hide
        Michael McCandless added a comment -

        +1

        Show
        Michael McCandless added a comment - +1
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1448490

        LUCENE-4790: nuke test workaround now that bug is fixed

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1448490 LUCENE-4790 : nuke test workaround now that bug is fixed
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1448371

        LUCENE-4790: FieldCache.getDocTermOrds back to the future bug

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1448371 LUCENE-4790 : FieldCache.getDocTermOrds back to the future bug
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1448489

        LUCENE-4790: nuke test workaround now that bug is fixed

        Show
        Commit Tag Bot added a comment - [trunk commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1448489 LUCENE-4790 : nuke test workaround now that bug is fixed
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1448368

        LUCENE-4790: FieldCache.getDocTermOrds back to the future bug

        Show
        Commit Tag Bot added a comment - [trunk commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1448368 LUCENE-4790 : FieldCache.getDocTermOrds back to the future bug
        Hide
        Uwe Schindler added a comment -

        Closed after release.

        Show
        Uwe Schindler added a comment - Closed after release.

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development