rahulgoswami commented on code in PR #16741:
URL: https://github.com/apache/lucene/pull/16741#discussion_r4226508523


##########
lucene/core/src/java/org/apache/lucene/util/Version.java:
##########
@@ -154,7 +259,10 @@ public final class Version {
 
   /**
    * Constant for the minimal supported major version number of an index. This 
version is defined by
-   * the major version number that initially created the index.
+   * the major version number that initially created the index. An index can 
be opened if its {@code
+   * indexCreatedVersionMajor} is >= this constant, regardless of how many 
major version numbers

Review Comment:
   Strictly speaking, this has changed to "... if for each segment of this 
index, its SegmentInfo.minVersion is >= this constant.." . Alternatively ,to 
keep it simpler, the original statement could be left unchanged and we could 
get rid of the second sentence altogether.



##########
lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBasicBackwardsCompatibility.java:
##########
@@ -871,11 +873,11 @@ public void testFailOpenOldIndex() throws IOException {
   public void testOpenModeAndCreatedVersion() throws IOException {
     Directory dir = newDirectory(directory);
     int majorVersion = 
SegmentInfos.readLatestCommit(dir).getIndexCreatedVersionMajor();
-    if (majorVersion != Version.MIN_SUPPORTED_MAJOR && majorVersion != 
Version.LATEST.major) {
+    if (majorVersion < Version.MIN_SUPPORTED_MAJOR || majorVersion > 
Version.LATEST.major) {

Review Comment:
   #14607 moves the check for index compatibility from SegmentInfos level to 
SegmentInfo.minVersion. Which means that it is possible for an index to have 
createdVersionMajor < MIN_SUPPORTED_MAJOR and yet have SegmentInfo.minVersion 
>= MIN_SUPPORTED_MAJOR, and hence be readable/writable.
    
   Basically all index compatibility check for MIN_SUPPORTED_MAJOR should 
happen against SegmentInfo.minVersion instead of 
SegmentInfos.indexCreatedVersionMajor.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to