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

Christine Poerschke commented on SOLR-12239:
--------------------------------------------

Looks like LUCENE-8505 subsequently changed the {{validateIndexSort}} logic 
slightly from 8.0 onwards but the issue here remains based on 
[https://github.com/apache/lucene-solr/blob/releases/lucene-solr/8.2.0/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L938-L949]
 reading i.e. the transition from "no sorting" to "some sorting" is considered 
invalid.

I'm curious if some segments being unsorted could perhaps be accommodated 
somehow?

> Enabling index sorting causes "segment not sorted with indexSort=null"
> ----------------------------------------------------------------------
>
>                 Key: SOLR-12239
>                 URL: https://issues.apache.org/jira/browse/SOLR-12239
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 7.1
>            Reporter: Ishan Chattopadhyaya
>            Priority: Major
>
> When index sorting is enabled on an existing collection/index (using 
> SortingMergePolicy), the collection reload causes the following exception:
> {code}
> java.util.concurrent.ExecutionException: 
> org.apache.solr.common.SolrException: Unable to create core 
> [mycoll_shard1_replica_n1]
>         at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>         at java.util.concurrent.FutureTask.get(FutureTask.java:192)
>         at 
> org.apache.solr.core.CoreContainer.lambda$load$14(CoreContainer.java:671)
>         at 
> com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:188)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: org.apache.solr.common.SolrException: Unable to create core 
> [mycoll_shard1_replica_n1]
>         at 
> org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1045)
>         at 
> org.apache.solr.core.CoreContainer.lambda$load$13(CoreContainer.java:642)
>         at 
> com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197)
>         ... 5 more
> Caused by: org.apache.solr.common.SolrException: Error opening new searcher
>         at org.apache.solr.core.SolrCore.<init>(SolrCore.java:989)
>         at org.apache.solr.core.SolrCore.<init>(SolrCore.java:844)
>         at 
> org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1029)
>         ... 7 more
> Caused by: org.apache.solr.common.SolrException: Error opening new searcher
>         at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:2076)
>         at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:2196)
>         at org.apache.solr.core.SolrCore.initSearcher(SolrCore.java:1072)
>         at org.apache.solr.core.SolrCore.<init>(SolrCore.java:961)
>         ... 9 more
> Caused by: org.apache.lucene.index.CorruptIndexException: segment not sorted 
> with indexSort=null (resource=_0(7.1.0):C1)
>         at 
> org.apache.lucene.index.IndexWriter.validateIndexSort(IndexWriter.java:1185)
>         at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1108)
>         at 
> org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:119)
>         at 
> org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:94)
>         at 
> org.apache.solr.update.DefaultSolrCoreState.createMainIndexWriter(DefaultSolrCoreState.java:257)
>         at 
> org.apache.solr.update.DefaultSolrCoreState.getIndexWriter(DefaultSolrCoreState.java:131)
>         at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:2037)
>         ... 12 more
> {code}
> This means that the user actually needs to delete the index segments, reload 
> the collection and then re-index. This is bad user experience.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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

Reply via email to