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

Lazy Field Loading has edge case bug causing read past EOF

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1
    • Component/s: core/index
    • Labels:
      None

      Description

      While trying to run some benchmarking of Lazy filed loading, i discovered there seems to be an edge case when accessing the last field of the last doc of an index.

      the problem seems to only happen when the doc has been accessed after at least one other doc.

      i have not tried to dig into the code to find the root cause, testcase to follow...

        Issue Links

          Activity

          Hide
          yseeley@gmail.com Yonik Seeley added a comment -

          Ouch!
          There is a very serious bug somewhere... I briefly checked out this test and expanded it, and you aren't even guaranteed to get back the same data you put in!

          I'll try and look into it further.

          Show
          yseeley@gmail.com Yonik Seeley added a comment - Ouch! There is a very serious bug somewhere... I briefly checked out this test and expanded it, and you aren't even guaranteed to get back the same data you put in! I'll try and look into it further.
          Hide
          yseeley@gmail.com Yonik Seeley added a comment -

          Found it... the thread local that held the fieldsStream was static, and hence not bound to any particular FieldsReader!
          Essentially that means that the offset and size were read from a random segment, not necessarily the segment the field value was stored in.

          Show
          yseeley@gmail.com Yonik Seeley added a comment - Found it... the thread local that held the fieldsStream was static, and hence not bound to any particular FieldsReader! Essentially that means that the offset and size were read from a random segment, not necessarily the segment the field value was stored in.
          Hide
          yseeley@gmail.com Yonik Seeley added a comment -

          fix and modified test case committed.

          Show
          yseeley@gmail.com Yonik Seeley added a comment - fix and modified test case committed.

            People

            • Assignee:
              yseeley@gmail.com Yonik Seeley
              Reporter:
              hossman Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development