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

Using "indexed" PointField for _version_ breaks VersionInfo.getMaxVersionFromIndex

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.7, 7.0
    • Component/s: None

      Description

      If someone configures _version_ using a LongPointField which is indexed="true" then VersionInfo.getMaxVersionFromIndex() will incorrectly assume...

          // if indexed, then we have terms to get the max from
          if (versionField.indexed()) {
            LeafReader leafReader = SlowCompositeReaderWrapper.wrap(searcher.getIndexReader());
            Terms versionTerms = leafReader.terms(versionFieldName);
            Long max = (versionTerms != null) ? LegacyNumericUtils.getMaxLong(versionTerms) : null;
      

      ...which will not work because Point based fields have no Terms.

      potential work around: configuring _version_ to use indexed="false" docValues="true" should cause this branch to be skipped and the existing ValueSource/DocValues based fallback to be used.

      We should either:

      • figure out if an alternative option exists for determining the "max" value of a LongPointField, and if so use that if versionField.indexed() && versionField.getType().isPointField()
      • change VersionInfo.getAndCheckVersionField() to check if the version field IsPointField() and if so error unless indexed="false" && docValues="true"

        Attachments

        1. SOLR-10832.patch
          18 kB
          Chris M. Hostetter
        2. SOLR-10832.patch
          17 kB
          Chris M. Hostetter
        3. SOLR-10832.patch
          13 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

            • Assignee:
              hossman Chris M. Hostetter
              Reporter:
              hossman Chris M. Hostetter

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment