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

Over synchronization for read-only index readers in SegmentTermDocs

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9.1, 3.0
    • Fix Version/s: 4.9, 6.0
    • Component/s: core/search
    • Labels:
    • Lucene Fields:
      New

      Description

      In SegmentTermDocs constructor (from 2.9.1)

      46	  protected SegmentTermDocs(SegmentReader parent) {
      47	    this.parent = parent;
      48	    this.freqStream = (IndexInput) parent.core.freqStream.clone();
      49	    synchronized (parent) {
      50	      this.deletedDocs = parent.deletedDocs;
      51	    }
      52	    this.skipInterval = parent.core.getTermsReader().getSkipInterval();
      53	    this.maxSkipLevels = parent.core.getTermsReader().getMaxSkipLevels();
      54	  }
      

      The synchronization on "parent" for accessing deletedDocs is unnecessary on readonly indexes. If that access was moved into the SegmentReader then it could be protected there by default and overridden in ReadonlySegmentReader.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jminard Jayson Minard
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: