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

Over synchronization for read-only index readers in SegmentTermDocs

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.9.1, 3.0
    • 4.9, 6.0
    • core/search
    • 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

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

            Dates

              Created:
              Updated: