You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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
The text was updated successfully, but these errors were encountered: