Search code examples
indexingsolrupgrade

How to solve Solr IndexUpgrader not being able to find _md6.si?


I'm trying to upgrade a Solr 4.x index to Solr 5.x (so I can upgrade it all the way to 8.x). The Solr installation itself is version 4.5.1.

The IndexUpgraderTool complains that it can't find the file _md6.si in my index. It doesn't exist in any of our indexes, and there is no information about the file on the internet. I tried a text search inside all of the index files, thinking it might be a broken link of sorts, but I wasn't able to find it that way either.

The stacktrace is below. Does anyone have any idea what could be wrong?

Exception in thread "main" java.nio.file.NoSuchFileException: C:\Temp\Dev_feature\default\index\_md6.si
        at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(Unknown Source)
        at java.nio.channels.FileChannel.open(Unknown Source)
        at java.nio.channels.FileChannel.open(Unknown Source)
        at org.apache.lucene.store.MMapDirectory.openInput(MMapDirectory.java:196)
        at org.apache.lucene.codecs.lucene40.Lucene40SegmentInfoReader.read(Lucene40SegmentInfoReader.java:51)
        at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:361)
        at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:457)
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:912)
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:758)
        at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:453)
        at org.apache.lucene.index.DirectoryReader.listCommits(DirectoryReader.java:277)
        at org.apache.lucene.index.IndexUpgrader.upgrade(IndexUpgrader.java:151)
        at org.apache.lucene.index.IndexUpgrader.main(IndexUpgrader.java:74)

Solution

  • It's always a good idea to run optimize on the index before running index upgrader - that way you'll get a clean index that the index upgrader can work with. The index files will be merged and rewritten as a single index, and any lingering deleted documents, etc. will be removed.

    You can generally call optimize by issuing an optimize command to the update handler:

    /update?optimize=true