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


##########
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 once MIN_SUPPORTED_MAJOR is bumped up 
in the future, 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 at index 
open should happen against SegmentInfo.minVersion instead of 
SegmentInfos.indexCreatedVersionMajor. This change should ideally have been 
part of #14607 , but I seem to have missed it. 



-- 
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