Skip to content
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

[Enhancement] Support for bwc codecs #909

Closed
dreamer-89 opened this issue May 24, 2023 · 2 comments
Closed

[Enhancement] Support for bwc codecs #909

dreamer-89 opened this issue May 24, 2023 · 2 comments
Labels
Enhancements Increases software capabilities beyond original client specifications Severity-Blocker

Comments

@dreamer-89
Copy link
Member

Coming from core opensearch-project/OpenSearch#3881 issue, the existing rolling upgrades does not work nicely for segment replication enabled indices. This is because of the fact that replica syncs segment files from primary shard. Thus, when primary and replica runs on different underlying Lucene codec implementation and replica shard on non-upgraded node fails the round of segment replication with below error.

Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene95' does not exist.  You need to add the corresponding JAR file supporting this SPI to your classpath.  The current classpath supports the following names: [Lucene94, Lucene80, Lucene84, Lucene86, Lucene87, Lucene70, Lucene90, Lucene91, Lucene92]
	at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:113) ~[lucene-core-9.4.2.jar:9.4.2 858d9b437047a577fa9457089afff43eefa461db - jpountz - 2022-11-17 12:56:39]
	at org.apache.lucene.codecs.Codec.forName(Codec.java:118) ~[lucene-core-9.4.2.jar:9.4.2 858d9b437047a577fa9457089afff43eefa461db - jpountz - 2022-11-17 12:56:39]
	at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:511) ~[lucene-core-9.4.2.jar:9.4.2 858d9b437047a577fa9457089afff43eefa461db - jpountz - 2022-11-17 12:56:39]
	at org.apache.lucene.index.SegmentInfos.parseSegmentInfos(SegmentInfos.java:404) ~[lucene-core-9.4.2.jar:9.4.2 858d9b437047a577fa9457089afff43eefa461db - jpountz - 2022-11-17 12:56:39]
	at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:363) ~[lucene-core-9.4.2.jar:9.4.2 858d9b437047a577fa9457089afff43eefa461db - jpountz - 2022-11-17 12:56:39]
	at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:310) ~[lucene-core-9.4.2.jar:9.4.2 858d9b437047a577fa9457089afff43eefa461db - jpountz - 2022-11-17 12:56:39]
	at org.opensearch.indices.replication.SegmentReplicationTarget.lambda$finalizeReplication$4(SegmentReplicationTarget.java:226) ~[opensearch-2.8.0-SNAPSHOT.jar:2.8.0-SNAPSHOT]

This is not a problem when primary shard is running on older OpenSearch version and replica shard on upgraded OpenSearch version. This is because of Lucene backward compatibility guarantees where segments file written in N-1 version can be read.

Fix on core

This is resolved on core by running the primary shard in bwc mode by loading older Lucene codecs till the time there are replicas on non-upgraded node.

Existing issue on plugin

Plugins today reads the current Lucene version and doesn't provide capability to read older Lucene codecs. As part of this change, we need to modify the behavior where it is possible to load older Lucene codec implementations even when node is running on upgraded node.

Issue on core

opensearch-project/OpenSearch#7668

@dreamer-89 dreamer-89 added Enhancements Increases software capabilities beyond original client specifications untriaged Severity-Blocker labels May 24, 2023
@dreamer-89
Copy link
Member Author

Identified a bug where segment replication fails for kNN plugin.

@vamshin vamshin removed the untriaged label Jun 22, 2023
@dreamer-89
Copy link
Member Author

There was a bug with approach of downgrading codecs in IndexWriter across major lucene versions as mentioned here. Right now, we are exploring other options to solve this problem, that wouldn't possibly need any change on plugin. Thus, closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancements Increases software capabilities beyond original client specifications Severity-Blocker
Projects
None yet
Development

No branches or pull requests

2 participants