From b5ad3148358cea4f24abaacadbc9a4ae03f1b7c7 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Wed, 20 Dec 2017 12:48:04 +0100 Subject: [PATCH] LUCENE-8077: Fixed wrong modulo usage in CheckIndex. --- lucene/CHANGES.txt | 5 +++++ lucene/core/src/java/org/apache/lucene/index/CheckIndex.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index d8e1237b7c9..98cdcd9eeb9 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -94,6 +94,11 @@ Improvements * LUCENE-8093: TrimFilterFactory implements MultiTermAwareComponent (Alan Woodward) +Bug Fixes + +* LUCENE-8077: Fixed bug in how CheckIndex verifies doc-value iterators. + (Xiaoshan Sun via Adrien Grand) + ======================= Lucene 7.2.0 ======================= API Changes diff --git a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java index 028da241fb3..c676568b69f 100644 --- a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java +++ b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java @@ -2195,7 +2195,7 @@ public final class CheckIndex implements Closeable { throw new RuntimeException("dv iterator field=" + field + ": doc=" + (doc-1) + " has unstable advanceExact"); } - if (i % 1 == 0) { + if (i % 2 == 0) { int doc2 = it2.nextDoc(); if (doc != doc2) { throw new RuntimeException("dv iterator field=" + field + ": doc=" + doc + " was not found through advance() (got: " + doc2 + ")");