New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LUCENE-9324: Add an ID to SegmentCommitInfo #1434
Conversation
Note: there is still a NOCOMMIT in this pr regarding BWC. It's just an idea we can build on or even move to using |
lucene/core/src/java/org/apache/lucene/index/SegmentCommitInfo.java
Outdated
Show resolved
Hide resolved
lucene/core/src/java/org/apache/lucene/index/SegmentCommitInfo.java
Outdated
Show resolved
Hide resolved
@mikemccand @jpountz I pushed new commits that preserves the null value as much as necessary until the segment actually changes. This way we will be able to fall back to different methods to figure out if segments are the same. please take another look |
lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
Outdated
Show resolved
Hide resolved
lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
Outdated
Show resolved
Hide resolved
lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
Outdated
Show resolved
Hide resolved
lucene/core/src/java/org/apache/lucene/index/SegmentCommitInfo.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @s1monw! Getter looks much more like a normal getter now :)
We already have IDs in SegmentInfo, as well as on SegmentInfos which are useful to uniquely identify segments and entire commits. Having IDs on SegmentCommitInfo is be useful too in order to compare commits for equality and make snapshots incremental on generational files. This change adds a unique ID to SegmentCommitInfo starting from Lucene 8.6. Older segments won't have an ID until the segment receives an update or a delete even if they have been opened and / or committed by Lucene 8.6 or above.
We already have IDs in SegmentInfo, as well as on SegmentInfos which are useful to uniquely identify segments and entire commits. Having IDs on SegmentCommitInfo is be useful too in
order to compare commits for equality and make snapshots incremental on generational files.
This change adds a unique ID to SegmentCommitInfo starting from Lucene 8.6. Older segments won't have an ID until the segment receives an update or a delete even if they have been opened and / or committed by Lucene 8.6 or above.