Skip to content

lucene_snapshot: Update to new Lucene 10.3 postings format #128240

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

Merged

Conversation

ChrisHegarty
Copy link
Contributor

@ChrisHegarty ChrisHegarty commented May 21, 2025

There are a few different things going on in this PR, all of which are required to get the lucene_snspahot branch building again, but the most substantial is the update to the new Lucene 10.3 postings format, Lucene103PostingsFormat.

The Lucene90BlockTreeTermsWriter class is used in the implementation of the 10.1 postings codec in Lucene. With the new 10.3 postings format that class is no longer needed, so it has been moved to a test-only location, in order to support backward compatibility testing.

In Elasticsearch we were using Lucene90BlockTreeTermsWriter (from Lucene) directly, through our copy of the Lucene 9.0 postings format, namely ES812PostingsFormat. So if you look at ES812PostingsFormat , you should that the imports should now show that we're using our own copy.

Additionally, changes are required because of the removal of deprecated methods in IOContext, as well as the override of hints for direct IO.

@ChrisHegarty ChrisHegarty added >non-issue :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team labels May 21, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments, thanks @ChrisHegarty !

@@ -817,6 +817,13 @@ public void testNumericSortOptimization() throws Exception {

Query q = LongPoint.newRangeQuery(fieldNameLong, startLongValue, startLongValue + numDocs);

// 0. test assertion - the query rewritten to a match all - https://github.com/apache/lucene/pull/14609/
// TODO: reflow total hits expectations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this refers to the other TODO below or is it something else?

Copy link
Member

@thecoop thecoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test comments can be addressed here, or after this is merged (to get the branch compiling again)

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a small comment, LGTM though

@ChrisHegarty
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/part-1

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChrisHegarty
Copy link
Contributor Author

While the CI is not completely green, there are some failures that seem unrelated, I'm going to merge this PR so that we can sync main into the branch also, and unblock further changes.

@ChrisHegarty ChrisHegarty merged commit 9b12969 into elastic:lucene_snapshot May 23, 2025
13 of 19 checks passed
@ChrisHegarty ChrisHegarty deleted the new_103_postings_format branch May 23, 2025 11:48
@ChrisHegarty ChrisHegarty added the lucene_10_3_dev Tracking issue that arise during the development of Lucene 10.3 label May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lucene_10_3_dev Tracking issue that arise during the development of Lucene 10.3 >non-issue :Search/Search Search-related issues that do not fall into other categories :StorageEngine/Codec Team:Search Meta label for search team Team:StorageEngine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants