Skip to content

Conversation

@drempapis
Copy link
Contributor

@drempapis drempapis commented Jan 3, 2025

The correspondence between the ES version, Lucene Version, and Lucene codec is as follows.

ES Version    Lucene Version      Codec
7.0.0-7.5.2     8.0.0-8.3.0      lucene80

7.6.0-7.8.1     8.4.0-8.5.1      lucene84

7.9.0-7.9.3     8.6.0-8.6.2      lucene86

7.10.0-7-17.26  8.7.0-8.11.3     lucene87

Each Codec version has a wrapper class handling the underlying Lucene codec.

Closes #117042

@drempapis drempapis self-assigned this Jan 3, 2025
@drempapis drempapis added v8.18.0 Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations >bug labels Jan 3, 2025
@drempapis drempapis marked this pull request as ready for review January 3, 2025 12:21
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @drempapis, I've created a changelog YAML for you.

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 two minors, LGTM otherwise. This was not an easy one, thanks for bearing with me!

pointCount = metaIn.readVLong();
docCount = metaIn.readVInt();

// This code has been introduced to process IndexInput created with Lucene86Codec+
Copy link
Member

Choose a reason for hiding this comment

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

Maybe explain that we are good ignoring additional fields with older formats, just to leave a trace of our analysis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do thanks

Copy link
Member

Choose a reason for hiding this comment

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

Could you clarify this comment and add the context from my previous comment around why we conditionally read, and why nothing fails if you remove the conditional? I can see how we may be asking ourselves this same question in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added this; I will extend it with more words.

 // This code has been introduced to process IndexInput created with Lucene86Codec+. This is not necessary
 // in the read-only version for older formats.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an additional pr to address the issues post-merge issues #125666

@drempapis
Copy link
Contributor Author

Thanks for reviewing this @javanna. I learned a lot of stuff working on this!

@drempapis drempapis added v9.0.0 auto-backport Automatically create backport pull requests when merged and removed v8.19.0 labels Mar 20, 2025
@drempapis drempapis merged commit 9dfe7ab into elastic:main Mar 21, 2025
17 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0

drempapis added a commit to drempapis/elasticsearch that referenced this pull request Mar 21, 2025
Added BWCLucene8*Codecs wrapper classes for the  lucene8* equivalents. A BWC wrapper is initialized for archive indices and provides read-only capabilities for an index.
@javanna
Copy link
Member

javanna commented Mar 21, 2025

I think that this needs to be backported to 8.x, 8.18 and 8.17 as well, but you'll get conflicts and it may be easier to do it manually. Let me know if you need help.

afoucret pushed a commit to afoucret/elasticsearch that referenced this pull request Mar 21, 2025
Added BWCLucene8*Codecs wrapper classes for the  lucene8* equivalents. A BWC wrapper is initialized for archive indices and provides read-only capabilities for an index.
elasticsearchmachine pushed a commit that referenced this pull request Mar 21, 2025
Added BWCLucene8*Codecs wrapper classes for the  lucene8* equivalents. A BWC wrapper is initialized for archive indices and provides read-only capabilities for an index.
if (codec == null) return null;

return switch (codec.getClass().getSimpleName()) {
case "Lucene70Codec" -> new BWCLucene70Codec();
Copy link
Member

Choose a reason for hiding this comment

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

hey @drempapis I missed this during review, not a huge deal, but wrapping Lucene70Codec is not required here. Lucene70Codec is no longer shipped with Lucene 10.0, we rather ship it, and it's already extending BWCCodec. I would instead check that the codec we get extends from BWCCodec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true; I passed it from the debugger to verify it. I'll create a pr to adjust this.

Copy link
Member

Choose a reason for hiding this comment

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

++ thanks, ping me for review, it'll be quicker this time :)

smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Mar 21, 2025
Added BWCLucene8*Codecs wrapper classes for the  lucene8* equivalents. A BWC wrapper is initialized for archive indices and provides read-only capabilities for an index.
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
Added BWCLucene8*Codecs wrapper classes for the  lucene8* equivalents. A BWC wrapper is initialized for archive indices and provides read-only capabilities for an index.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for 7.x segments as archive in Elasticsearch 8.x

4 participants