Skip to content

Solr 10 support#826

Open
tomaszpolachowski wants to merge 1 commit intoapache:mainfrom
PL-BYD-BDS-TI:main
Open

Solr 10 support#826
tomaszpolachowski wants to merge 1 commit intoapache:mainfrom
PL-BYD-BDS-TI:main

Conversation

@tomaszpolachowski
Copy link
Copy Markdown

It refers to issue #821

There 2 issue around running Solr Operator againt Solr 10:

  • host parameter deprecated completely - must be solr.host.advertise instead
  • Number of items in default solr.xml are no longer valid - rewritten

Copy link
Copy Markdown
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

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

Looks good, we will have to ensure the integration tests look good.

@@ -377,6 +377,10 @@ func GenerateStatefulSet(solrCloud *solr.SolrCloud, solrCloudStatus *solr.SolrCl
Name: "SOLR_HOST",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we get rid of this now? Since we have SOLR_HOST_ADVERTISE? Or will it be used by the CLI when we interact with it via other commands?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's for backward compatibility only. Depends if support for versions before introducing solr.host.advertise is necessary. If not then along with removal some tests and probeCommand in solr_security_util.go would require update.

@janhoy janhoy added this to the v1.0.0 milestone Apr 7, 2026
@janhoy
Copy link
Copy Markdown
Contributor

janhoy commented Apr 7, 2026

I tagged this with the 1.0.0 milestone. Will try to add a few other issues that are needed/wanted for next major..

danielmeint added a commit to danielmeint/solr-operator that referenced this pull request Apr 27, 2026
Solr 10 introduced several breaking changes that prevent the operator
from successfully starting and managing SolrClouds. This change adds
version-conditional behavior for Solr 10 while preserving full backwards
compatibility with Solr 9.x.

Major changes covered:

* solr.xml — Solr 10 removed several `<solrcloud>` parameters
  (genericCoreNodeNames, hostContext, allowPaths, metricsEnabled).
  A new `DefaultSolrXMLForSolr10` template, mirroring the stock Solr 10
  template, is selected when the image tag indicates Solr 10+.

* Host advertise — the `host` system property was renamed to
  `solr.host.advertise`. A `SOLR_HOST_ADVERTISE` env var is now set on
  Solr 10 pods.

* Modules — Solr 10 removed `/opt/solr/contrib/<module>/lib` and
  `/opt/solr/dist`. Modules are now loaded via the `SOLR_MODULES` env
  var, and the operator no longer emits contrib paths in `sharedLib`
  for Solr 10.

* hostPort sysprop — `-DhostPort` is no longer needed in Solr 10 and
  is skipped.

* zkcli.sh removed — `setUrlSchemeClusterPropCmd` (TLS setup) now uses
  `solr cluster --property` and `solr zk cp` for Solr 10 instead of
  the removed `cloud-scripts/zkcli.sh`.

* `solr api` CLI — `-get URL` was replaced with `--solr-url URL`.
  Secure probes (`useSecureProbe`) and the e2e helper
  (`callSolrApiInPod`) emit the new flag for Solr 10.

* Basic auth — Solr 10 no longer honors the deprecated
  `-Dbasicauth=user:pass` JAVA_TOOL_OPTIONS path. The e2e helper now
  uses the native `--credentials user:pass` flag for Solr 10.

Version detection lives on the `SolrCloud` type as
`(*SolrCloud).IsSolr10OrLater()`, which parses the major version from
the image tag and treats unparseable tags (e.g. "latest", "nightly")
and a nil `SolrImage` as pre-10 for backwards compatibility. A
package-level `IsSolr10OrLater(imageTag string)` is also exported for
callers that only have a raw image string.

Unit tests cover the version parser, both `solr.xml` templates,
`setUrlSchemeClusterPropCmd` for both branches, the env vars emitted
by `GenerateStatefulSet` for Solr 9 vs Solr 10, and both branches of
`useSecureProbe`. End-to-end tests have been verified against
Solr 10.0.0 across Basic, Scaling (with replica migration),
Security JSON (provided + bootstrapped), TLS (Secrets and Mounted Dir,
including ClientAuth Need/Want, CheckPeerName, VerifyClientHostname),
Local-directory backups (recurring + single), Ingress, and Managed
Rolling Upgrades. Solr 9.8.0 Basic was verified as a regression
baseline.

The Prometheus exporter is not covered: `solr-exporter` was removed
from the Solr distribution in 10, and metrics are now expected to be
scraped from Solr's built-in endpoint. That work is tracked separately
in apache#820.

Refs apache#821, apache#826.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants