Mike Mike - 7 months ago 108
Apache Configuration Question

Solr indexing issue after upgrading from 4.7 to 7.1

I just upgraded our solr from 4.7 to 7.1.
I copied the older folder name 'old_core' (that contains the folders: 'index', 'snapshot_metadata' and 'tlog') into the data folder.
I also created a new core via the new solr UI.

When starting solr, I get an error message (on the UI):

old_core: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error opening new searcher
.

I found that when I copy the subfolder 'index' from the "new_core" into the "old_core" folder it starts without any error messages.

Is it means that indexes from solr version 4.7 can't be transferred into version 7.1?
Is there a way to fix it? Is it safe or may corrupt the indexes?

Error from the log:

Short:


Caused by: org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path="/data/solr/sst1_1/index/segments_5"))): 1 (needs to be between 6 and 7). This version of Lucene only supports indexes created with release 6.0 and later.


Full:
>

ERROR - 2017-11-23 10:05:57.182; org.apache.solr.core.CoreContainer; Error waiting for SolrCore to be created
java.util.concurrent.ExecutionException: org.apache.solr.common.SolrException: Unable to create core [sst1_1]
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 [sst1_1]
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.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path="/data/solr/sst1_1/index/segments_5"))): 1 (needs to be between 6 and 7). This version of Lucene only supports indexes created with release 6.0 and later.
at org.apache.lucene.codecs.CodecUtil.checkHeaderNoMagic(CodecUtil.java:213)
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:305)
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:289)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1076)
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
ERROR - 2017-11-23 10:05:59.235; org.apache.solr.update.SolrIndexWriter; SolrIndexWriter was not closed prior to finalize(), indicates a bug -- POSSIBLE RESOURCE LEAK!!!
ERROR - 2017-11-23 10:05:59.236; org.apache.solr.update.SolrIndexWriter; Error closing IndexWriter
java.lang.NullPointerException
at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3583)
at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3545)
at org.apache.lucene.index.IndexWriter.shutdown(IndexWriter.java:1272)
at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1317)
at org.apache.solr.update.SolrIndexWriter.close(SolrIndexWriter.java:280)
at org.apache.solr.update.SolrIndexWriter.finalize(SolrIndexWriter.java:336)
at java.lang.System$2.invokeFinalize(System.java:1270)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)


Thanks in advance!

Mike

Answer Source

You can't upgrade through that many versions in a single upgrade. Solr (Lucene) only supports the index format from the previous version, so you might have to do each version by itself.

There's a tool bundled with Solr to help you do this - the IndexUpgrader.

There's also a helpful script to automate migration from 4.x and onwards.

As always, keep a backup of your index if necessary. Also remember that certain field types may no longer be available, or field types has changed (and introduced new features which may be enabled by default).

If you can reindex, that's the preferred upgrade path.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download