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

Keith Laban commented on LUCENE-7671:
-------------------------------------

[~mikemccand], I pushed an update which at the moment cleanly applies.

However is looks like LUCENE-7756 break {{addIndexes}} again because of this 
check which was added: 
{code}
+  private void validateMergeReader(CodecReader leaf) {
+    LeafMetaData segmentMeta = leaf.getMetaData();
+    if (segmentInfos.getIndexCreatedVersionMajor() != 
segmentMeta.getCreatedVersionMajor()) {
+      throw new IllegalArgumentException("Cannot merge a segment that has been 
created with major version "
+          + segmentMeta.getCreatedVersionMajor() + " into this index which has 
been created by major version "
+          + segmentInfos.getIndexCreatedVersionMajor());
+    }
+
+    if (segmentInfos.getIndexCreatedVersionMajor() >= 7 && 
segmentMeta.getMinVersion() == null) {
+      throw new IllegalStateException("Indexes created on or after Lucene 7 
must record the created version major, but " + leaf + " hides it");
+    }
+
+    Sort leafIndexSort = segmentMeta.getSort();
+    if (config.getIndexSort() != null && leafIndexSort != null
+        && config.getIndexSort().equals(leafIndexSort) == false) {
+      throw new IllegalArgumentException("cannot change index sort from " + 
leafIndexSort + " to " + config.getIndexSort());
+    }
+  }
{code}

Is this mergepolicy working against future goals of lucene such that it will be 
impossible to upgrade major versions without reIndexing?

> Enhance UpgradeIndexMergePolicy with additional options
> -------------------------------------------------------
>
>                 Key: LUCENE-7671
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7671
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Keith Laban
>
> Enhance UpgradeIndexMergePolicy to be a MergePolicy that can be used outside 
> the scope the IndexUpgrader.
> The enhancement aims to allow the UpgradeIndexMergePolicy to:
> 1) Delegate normal force merges to the underlying merge policy
> 2) Enable a flag that will explicitly tell UpgradeIndexMergePolicy when it 
> should start looking for upgrades.
> 3) Allow new segments to be considered to be merged with old segments, 
> depending on underlying MergePolicy.
> 4) Be configurable for backwards compatibility such that only segments 
> needing an upgrade would be considered when merging, no explicit upgrades.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to