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_r409812796
##########
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 think this case is a bit more complicated due to the changing nature of
this ID. For each change (DV, llive docs, fields) we need to move to a new ID.
Should we then just accept null and create a new ID once it changes or should
we stick with `null` on these segments until they are written first time?
Introducing `null` requires quite some changes in how we handle this which we
can do, for sure. I still wonder if we can get away with stealing the _parent_
ID and have a smooth upgrade path.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]