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

David Smiley commented on SOLR-12239:
-------------------------------------

Thank you for your contribution here.

But I'm unsure on the value/need of this.  It doesn't support SolrCloud or 
nested docs yet.  In practice, I expect an index to be created with sort 
criteria from the start.  Is that too much to ask of a user?  Trying to sort 
after-the-fact sounds awkward as a user would not only need this mechanism, but 
then need to update solrconfig.xml.  I suspect updates that happen during the 
resorting or after but before the updated config would result in errors.  I 
could be wrong but I suspect you implemented this simply because you saw my 
email and this issue, not because you actually want to put this to use in your 
use of Solr.

There's understandably a lot of code for this complicated feature.  In the days 
of AI code gen, the limited resources is code review time (my time).  Ideally 
others would step in here to review; I take on too much TBH.  You might get a 
review from [~rahulgoswami]  who recently did *very* similar work.

> 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
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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
(v8.20.10#820010)

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

Reply via email to