Add Solr 10 compatibility support#827
Open
danielmeint wants to merge 4 commits intoapache:mainfrom
Open
Conversation
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>
07b2d15 to
c48f428
Compare
Remove SolrMajorVersion(tag) and standalone IsSolr10OrLater(tag) functions. Version detection is now driven entirely by the required solrMajorVersion CRD field (validated 8–10), eliminating misdetection of custom image tags like '261.162.1' as Solr 261.
|
This looks great, I'll see if I can give it a whirl in our test cluster. |
Adds a new `solrMajorVersion` value (default 9, matching the default image.tag of 9.10.0) and renders it under spec.solrMajorVersion. Uses Helm's `required` so the chart fails fast with a clear message if a user explicitly unsets it. Documents the new value in the chart README and adds a v0.10.0 upgrade note covering both the CRD field and the new chart value. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ction Drops "Required by the operator" from the chart README row since the table already shows a default of 9, which reads as contradictory at the chart layer. The CRD field is still required at the API layer; the chart just hands it a default. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Add Solr 10 compatibility support
Adds version-conditional Solr 10 support to the operator while preserving Solr 9.x behavior. All major operator-managed flows (bootstrap, scaling, security, TLS, backups, ingress, rolling upgrades) work against Solr 10.0.
Builds on #826 and addresses #821. Prometheus exporter is out of scope:
solr-exporterwas removed in Solr 10 (#820).Warning
Breaking change: introduces a new required field
spec.solrMajorVersion(int, 8–10). Existing SolrCloud CRs must add it (e.g.solrMajorVersion: 9) before upgrading the operator; CRD validation rejects CRs that omit it. This is intentional: implicit detection from image tags was unreliable for custom/internal tags. The Helm chart values/templates are updated in this PR so chart users aren't broken.What changed
Version detection is driven by
(*SolrCloud).IsSolr10OrLater(), which readsspec.solrMajorVersion. No image-tag parsing.solr.xmlDefaultSolrXMLForSolr10template, dropsgenericCoreNodeNames,hostContext,allowPaths,metricsEnabled; switcheshostto${solr.host.advertise:}SOLR_HOST_ADVERTISEenv var (replaces deprecatedhostsysprop)SOLR_MODULESenv var;sharedLibskips removed/opt/solr/contrib/<module>/liband/opt/solr/disthostPortsyspropsetUrlSchemeClusterPropCmdusessolr zk cpinstead of removedcloud-scripts/zkcli.shuseSecureProbeusessolr api --solr-url …instead of removed-getcallSolrApiInPoduses--solr-urland--credentials user:pass(Solr 10 dropped-Dbasicauth=…viaJAVA_TOOL_OPTIONS)Test plan
IsSolr10OrLater, bothsolr.xmltemplates, both branches ofuseSecureProbeNotes
Solr 10 logs a
"deprecated system property host"warning at startup. After investigation this is a Solr-side false positive (bin/solrin 10 doesn't translateSOLR_HOSTto-Dhost, and Solr 10's stocksolr.xmlships with the same<str name="host">${solr.host.advertise:}</str>). RemovingSOLR_HOSTfrom the pod spec doesn't silence it. Left as-is.