Hello.

We would like to upgrade from solr 4.8.1 to 4.10.4 and for existing collections 
(at least initially) continue to use the 4.8 lucene format rather than the 
latest 4.10 format.

Two main reasons for the preference:
(a) no need to worry about a not-yet-upgraded 4.8 replica recovering from an 
already-upgraded 4.10 replica.
(b) more options if it were to be necessary to downgrade from 4.10 back to 4.8 
in a hurry.

[As an aside, we have seen that 4.10.4 creates a 
/configs/<configName>/_rest_managed.json znode which 4.8 does not like, so any 
downgrading would need to consider that also, on dev just re-uploading the 
<configName> config to zookeeper appears to work.]

Questions:

Q1a: Is it possible (for a 4.8.1 to 4.10.4 upgrade) to have this "stay with 
lucene-4.8" behaviour, out of the box or with a recommended patch?

Q1b: It appears making LiveIndexWriterConfig.matchVersion public and having 
DocumentsWriterPerThread use it instead of Version.LATEST could work. Has 
anyone used such a patch approach and/or can think of reasons why it would not 
work or not be a good idea?

Q2: Has anyone encountered something similar more generally i.e. with 
other/later versions of solr-lucene? (LUCENE-5871 removed the use of Version in 
IndexWriterConfig from version 5.0 onwards.)

Regards,

Christine

---------------------------------------------

the potential patch referred to in Q1b above:

--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
@@ -178,7 +178,7 @@ class DocumentsWriterPerThread {
     pendingUpdates.clear();
     deleteSlice = deleteQueue.newSlice();
    
-    segmentInfo = new SegmentInfo(directoryOrig, Version.LATEST, segmentName, 
-1, false, codec, null);
+    segmentInfo = new SegmentInfo(directoryOrig, 
this.indexWriterConfig.matchVersion, segmentName, -1, false, codec, null);
     assert numDocsInRAM == 0;
     if (INFO_VERBOSE && infoStream.isEnabled("DWPT")) {
       infoStream.message("DWPT", Thread.currentThread().getName() + " init 
seg=" + segmentName + " delQueue=" + deleteQueue);  

--- a/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java
+++ b/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java
@@ -96,7 +96,7 @@ public class LiveIndexWriterConfig {
   protected volatile int perThreadHardLimitMB;
 
   /** {@link Version} that {@link IndexWriter} should emulate. */
-  protected final Version matchVersion;
+  public final Version matchVersion;
 
   /** True if segment flushes should use compound file format */
   protected volatile boolean useCompoundFile = 
IndexWriterConfig.DEFAULT_USE_COMPOUND_FILE_SYSTEM;

Reply via email to