mikemccand 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_r409553076
########## File path: lucene/core/src/java/org/apache/lucene/index/IndexWriter.java ########## @@ -3081,7 +3081,7 @@ private SegmentCommitInfo copySegmentAsIs(SegmentCommitInfo info, String segName info.info.getUseCompoundFile(), info.info.getCodec(), info.info.getDiagnostics(), info.info.getId(), info.info.getAttributes(), info.info.getIndexSort()); SegmentCommitInfo newInfoPerCommit = new SegmentCommitInfo(newInfo, info.getDelCount(), info.getSoftDelCount(), info.getDelGen(), - info.getFieldInfosGen(), info.getDocValuesGen()); + info.getFieldInfosGen(), info.getDocValuesGen(), info.getId()); Review comment: This happens during `IndexWriter.addIndexes(Directory[])` right? I wonder whether we should give a new id instead of reusing the old one? E.g. the segment (likely) now has a new name, and is in a different `Directory`, and is copied/forked from a prior segment, so maybe it should get a new `id`? ---------------------------------------------------------------- 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