apache / apache/lucene

Now that we track the code version at the segment level, we can stop tracking it also in each file level [LUCENE-2921]

Open
#3,995 4 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major module:core/index type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Now that we track the code version that created the segment at the segment level, we can stop tracking versions in each file. This has several major benefits:
1. Today the constant names that use to track versions are confusing - they do not state since which version it applies to, and so it's harder to determine which formats we can stop supporting when working on the next major release.
1. Those format numbers are usually negative, but in some cases positive (inconsistency) – we need to remember to increase it "one down" for the negative ones, which I always find confusing.
1. It will remove the format tracking from all the \*Writers, and the \*Reader will receive the code format (String) and work w/ the appropriate constant (e.g. Constants.LUCENE_30). Centralizing version tracking to SegmentInfo is an advantage IMO.

It's not urgent that we do it for 3.1 (though it requires an index format change), because starting from 3.1 all segments track their version number anyway (or migrated to track it), so we can safely release it in follow-on 3x release.

---
Migrated from [LUCENE-2921](https://issues.apache.org/jira/browse/LUCENE-2921) by Shai Erera (@shaie), updated Jan 29 2013

Contributor guide

Open the contributing guide

Research direction

Start by tracing SegmentInfo, the *Writers, the *Reader, and the version constants such as Constants.LUCENE_30. Review how segment-level versions are read and how each file currently tracks its format. Done means file-level version tracking is removed, readers use the segment code format, and the index-format implications are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.