mikemccand commented on code in PR #12530:
URL: https://github.com/apache/lucene/pull/12530#discussion_r1390999456
##########
lucene/core/src/java/org/apache/lucene/index/CheckIndex.java:
##########
@@ -610,6 +610,39 @@ public Status checkIndex(List<String> onlySegments,
ExecutorService executorServ
return result;
}
+ // https://github.com/apache/lucene/issues/7820: also attempt to open any
older commit
+ // points (segments_N), which will catch certain corruption like missing
_N.si files
+ // for segments not also referenced by the newest commit point (which was
already
+ // loaded, successfully, above). Note that we do not do a deeper check of
segments
+ // referenced ONLY by these older commit points, because such corruption
would not
+ // prevent a new IndexWriter from opening on the newest commit point. but
it is still
+ // corruption, e.g. a reader opened on those old commit points can hit
corruption
+ // exceptions which we (still) will not detect here. progress not
perfection!
+
+ for (String fileName : files) {
+ if (fileName.startsWith(IndexFileNames.SEGMENTS)
+ && fileName.equals(lastSegmentsFile) == false) {
Review Comment:
OK I merged the two cases. It was a bit tricky because I still wanted to
first attempt to load the last commit point, before the older ones, so that if
both of them have problems, we always show the user the problem with the last
commit point first.
--
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]