Add lucene-backward-codecs to the server classpath - #26978
Merged
Conversation
fpetersen-gl
approved these changes
Aug 14, 2026
fpetersen-gl
left a comment
Contributor
There was a problem hiding this comment.
Nice and easy. Thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Reading a Lucene index/segment written by an older Lucene major version requires
lucene-backward-codecson the classpath. Concretely, OpenSearch 2.x writes Lucene 9segments (codec
Lucene912), and reading those with the server's Lucene 10 (lucene-coreships only
Lucene104) fails with:This must live on the server classpath, next to
lucene-core: Lucene'sCodecSPIregistry is bound to
lucene-core's class loader. Providinglucene-backward-codecsonlyfrom a plugin (loaded in an isolated child class loader) leaves the older codecs invisible
to the SPI at read time — the plugin's copy is never resolved.
Approach
Add
lucene-backward-codecs(managed at${lucene.version}) as a dependency ofgraylog2-server, alongside the existinglucene-core/lucene-analysis-commondependencies, so it is shaded into
graylog.jarand available to the codec SPI for everyconsumer of the server classpath.
This is a prerequisite for the OpenSearch-snapshot archiving feature (Graylog2/graylog-plugin-enterprise#14922),
which reads OS 2.x (Lucene 9) snapshot segments directly with Lucene. That feature previously declared
the dependency in its own plugin, where the SPI could not see it.
/nocl