zacharymorn commented on a change in pull request #128: URL: https://github.com/apache/lucene/pull/128#discussion_r634953443
########## File path: lucene/core/src/java/org/apache/lucene/index/CheckIndex.java ########## @@ -488,8 +519,35 @@ public Status checkIndex() throws IOException { * quite a long time to run. */ public Status checkIndex(List<String> onlySegments) throws IOException { + ExecutorService executorService = + Executors.newFixedThreadPool(threadCount, new NamedThreadFactory("async-check-index")); + try { + return checkIndex(onlySegments, executorService); + } finally { + executorService.shutdown(); + try { + executorService.awaitTermination(5, TimeUnit.SECONDS); + } catch ( + @SuppressWarnings("unused") Review comment: Yeah agreed. Updated. ########## File path: lucene/core/src/java/org/apache/lucene/index/CheckIndex.java ########## @@ -701,104 +765,196 @@ public Status checkIndex(List<String> onlySegments) throws IOException { if (reader.hasDeletions()) { if (reader.numDocs() != info.info.maxDoc() - info.getDelCount()) { throw new RuntimeException( - "delete count mismatch: info=" + segmentId + + "delete count mismatch: info=" + (info.info.maxDoc() - info.getDelCount()) + " vs reader=" + reader.numDocs()); } if ((info.info.maxDoc() - reader.numDocs()) > reader.maxDoc()) { throw new RuntimeException( - "too many deleted docs: maxDoc()=" + segmentId + + "too many deleted docs: maxDoc()=" + reader.maxDoc() + " vs del count=" + (info.info.maxDoc() - reader.numDocs())); } if (info.info.maxDoc() - reader.numDocs() != info.getDelCount()) { throw new RuntimeException( - "delete count mismatch: info=" + segmentId + + "delete count mismatch: info=" + info.getDelCount() + " vs reader=" + (info.info.maxDoc() - reader.numDocs())); } } else { if (info.getDelCount() != 0) { throw new RuntimeException( - "delete count mismatch: info=" + segmentId + + "delete count mismatch: info=" + info.getDelCount() + " vs reader=" + (info.info.maxDoc() - reader.numDocs())); } } if (checksumsOnly == false) { + // This redundant assignment is done to make compiler happy + SegmentReader finalReader = reader; + // Test Livedocs - segInfoStat.liveDocStatus = testLiveDocs(reader, infoStream, failFast); + CompletableFuture<Void> testliveDocs = + runAysncSegmentPartCheck( Review comment: Oops. Fixed. -- 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. 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