Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14492

many json.facet aggregations can throw ArrayIndexOutOfBoundsException when using DVHASH due to incorrect resize impl

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.6
    • Component/s: Facet Module
    • Labels:
      None

      Description

      It appears we have quite a few SlotAcc impls that don't properly implement resize: they ask the Resizer to resize their arrays, but throw away the result. (arrays can't be resized in place, the Resizer is designed to return a new replacment map, initializing empty values and/or mapping old indicies to new indicies)

      For many FacetFieldProcessors, this isn't (normally) a problem because they create their Accs using a "max upper bound" on the possible number of slots in advance – and only use resize later to "shrink" the number of slots.

      But in the case of method:dvhash / FacetFieldProcessorByHashDV this processor starts out using a number of slots based on the size of the base DocSet (rounded up to the next power of 2) maxed out at 1024, and then grows the SlotAccs if it encounters more values then that.

      This means that if the "base" context of the term facet is significantly smaller then the number of values in the docValues field being faceted on (ie: multiValued fields), then these problematic SlotAccs won't grow properly and you'll get ArrayIndexOutOfBoundsException

        Attachments

        1. SOLR-14492.patch
          7 kB
          Chris M. Hostetter
        2. SOLR-14492.patch
          2 kB
          Chris M. Hostetter

          Activity

            People

            • Assignee:
              hossman Chris M. Hostetter
              Reporter:
              hossman Chris M. Hostetter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: