iverase commented on code in PR #13563:
URL: https://github.com/apache/lucene/pull/13563#discussion_r1681096883


##########
lucene/core/src/java/org/apache/lucene/index/CheckIndex.java:
##########
@@ -3301,17 +3301,17 @@ private static void checkDocValueSkipper(FieldInfo fi, 
DocValuesSkipper skipper)
       if (skipper.maxDocID(0) == NO_MORE_DOCS) {
         break;
       }
+      if (skipper.minDocID(0) < doc) {
+        throw new CheckIndexException(
+            "skipper dv iterator for field: "
+                + fieldName
+                + " reports wrong minDocID, got "
+                + skipper.minDocID(0)
+                + " < "
+                + doc);
+      }
       int levels = skipper.numLevels();
       for (int level = 0; level < levels; level++) {
-        if (skipper.minDocID(level) < doc) {
-          throw new CheckIndexException(
-              "skipper dv iterator for field: "
-                  + fieldName
-                  + " reports wrong minDocID, got "
-                  + skipper.minDocID(level)
-                  + " < "
-                  + doc);
-        }

Review Comment:
   The current condition is `skipper.minDocID(level) < doc` where the doc is 
the provided doc on advance. So the provided doc needs to be lower than or 
equal to the minDocID not to trigger the error.  I
   
   It checks we have advance to the closer interval forward. This check is 
strange as it is only valid for implementations with exact bounds and it is 
clearly not valid for levels above 0.
   



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to