s1monw commented on a change in pull request #1434: LUCENE-9324: Add an ID to SegmentCommitInfo URL: https://github.com/apache/lucene-solr/pull/1434#discussion_r409851521
########## File path: lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java ########## @@ -374,7 +376,15 @@ public static final SegmentInfos readCommit(Directory directory, ChecksumIndexIn if (softDelCount + delCount > info.maxDoc()) { throw new CorruptIndexException("invalid deletion count: " + softDelCount + delCount + " vs maxDoc=" + info.maxDoc(), input); } - SegmentCommitInfo siPerCommit = new SegmentCommitInfo(info, delCount, softDelCount, delGen, fieldInfosGen, dvGen); + final byte[] sciId; + if (format > VERSION_74) { + sciId = new byte[StringHelper.ID_LENGTH]; + input.readBytes(sciId, 0, sciId.length); + } else { + sciId = infos.id; + // NOCOMMIT can we do this? it would at least give us consistent BWC but we can't identify the same SCI in different commits Review comment: > I don't understand the idea of stealing the parent ID, wouldn't it cause Lucene to consider commits equal when they are not, which would be a much worse problem than considering commits different when they are equal? the idea was to use the `SegmentInfos` ID which is different for every commit as a default. It would not cause Lucene to consider commits equal when they are not. I just moved to using null instead, it was an idea that has downsides too we can just go with null. The real question is when do we assign an ID then? Once we write the SCI again even if it didn't change? I think we should but that would then bring back the same problem with the fallback. ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org