You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dawid Weiss (JIRA)" <ji...@apache.org> on 2018/05/28 07:23:00 UTC

[jira] [Comment Edited] (LUCENE-8334) Ensure SR#getSementInfo() returns snapshot

    [ https://issues.apache.org/jira/browse/LUCENE-8334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492348#comment-16492348 ] 

Dawid Weiss edited comment on LUCENE-8334 at 5/28/18 7:22 AM:
--------------------------------------------------------------

Hi Simon. This was made private in this patch:
{code}
-  // TODO: why is this public?
-  public SegmentReader(SegmentCommitInfo si, int createdVersionMajor, IOContext context) throws IOException {
-    this.si = si;
+  SegmentReader(SegmentCommitInfo si, int createdVersionMajor, IOContext context) throws IOException {
{code}

I agree it's expert-level API, but it is useful (has no alternative) for manipulating parallel indexes (see TestDemoParallelLeafReader). I am actually using this stuff (outside of Lucene code) exactly like Mike's "demo" shows -- to maintain derived indexes from primary segments.

Can we make this a primary API citizen (or expose a public interface implemented by this class that would convey the information required for TestDemoParallelLeafReader to work, if it's moved from .index package)?


was (Author: dweiss):
Hi Simon. This was made private in this patch:
{code}
-  // TODO: why is this public?
-  public SegmentReader(SegmentCommitInfo si, int createdVersionMajor, IOContext context) throws IOException {
-    this.si = si;
+  SegmentReader(SegmentCommitInfo si, int createdVersionMajor, IOContext context) throws IOException {
{code}

I agree it's expert-level API, but it is useful (has no alternative) for manipulating parallel indexes (see TestDemoParallelLeafReader). I am actually using this stuff (outside of Lucene code) exactly like Mike's "demo" shows -- to maintain derived indexes from primary segments.

Can we make a primary API citizen (or expose a public interface implemented by this class that would convey the information required for TestDemoParallelLeafReader to work, if it's moved from .index package)?

> Ensure SR#getSementInfo() returns snapshot
> ------------------------------------------
>
>                 Key: LUCENE-8334
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8334
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Simon Willnauer
>            Priority: Major
>         Attachments: LUCENE-8334.patch
>
>
>  The SegmentCommitInfo passed to the segment reader is mutated concurrently.
>     An instance obtained from SR#getSegmentInfo() might return wrong delete counts
>     or generation ids. This ensures that the SR will use a clone internally while stil
>     maintaining the original SI since it's needed inside IW for maintainance like
>     accessing pooled readers etc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org