[
https://issues.apache.org/jira/browse/LUCENE-7756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15950678#comment-15950678
]
Michael McCandless commented on LUCENE-7756:
--------------------------------------------
Thanks [~jpountz], this really turned into quite a doozie!
+1 to not be lenient.
I'm a little confused by the testing hack for {{SegmentInfos}}: won't pre-7.0
indices "legitimately" have a null {{minVersion}}, and so Lucene needs to
handle that "gracefully"? For such old indexes, does/shouldn't
{{SegmentInfo.getMinVersion()}} return null? And if those old segments get
merged even with new segments, it should still return null?
Can we rename {{IndexInfos}} to {{SegmentMetaData}} maybe? {{infos}} is
heavily used in Lucene! And improve its javadocs, maybe {{Provides read-only
metadata about the segment}} or so?
Typo {{te}} in the javadocs for {{SegmentInfos.ALLOW_OLD_CODECS_TO_WRITE}}:
{noformat}
of a segment, so for testing those codecs we allow te temporarily set the
{noformat}
In {{IW.addIndexes(CodecReader...)}}, why do you pass {{null}} for the
{{minVersion}} of the newly merged {{SegmentInfo}}? Shouldn't it be the min
across the incoming readers? Oh, I see! SegmentMerger's ctor sets it, OK.
Can you add a comment in both places (here, and in {{_mergeInit}}) in IW where
you pass null saying that {{SegmentMerger}} takes care of it?
In {{IndexInfos}} ctor, can you throw an exception if the
{{createdMajorVersion}} is invalid (less than 7 I guess)? Because, I was
looking at {{ParallelLeafReader}} and it seems like it's logic is possibly
wrong if ever the major version was somehow set to -1. Likewise if
{{minVersion}} is {{null}} but major version is >= 7.
Maybe factor out the "if major version is >= 7 and minVersion is null" checking
to a private helper method in {{SegmentInfos}}? I think there are at least 4
places doing it.
> Only record the major that was used to create the index rather than the full
> version
> ------------------------------------------------------------------------------------
>
> Key: LUCENE-7756
> URL: https://issues.apache.org/jira/browse/LUCENE-7756
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Adrien Grand
> Priority: Minor
> Attachments: LUCENE-7756.patch, LUCENE-7756.patch
>
>
> LUCENE-7703 added information about the Lucene version that was used to
> create the index to the segment infos. But since there is a single creation
> version, it means we need to reject calls to addIndexes that can mix indices
> that have different creation versions, which might be seen as an important
> regression by some users. So I have been thinking about only recording the
> major version that was used to create the index, which is still very valuable
> information and would allow us to accept calls to addIndexes when all merged
> indices have the same major version. This looks like a better trade-off to me.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]