fix(solr): detect version mismatch at startup + add make check-solr#12795
Open
mekarpeles wants to merge 2 commits into
Open
fix(solr): detect version mismatch at startup + add make check-solr#12795mekarpeles wants to merge 2 commits into
mekarpeles wants to merge 2 commits into
Conversation
Adds a 60s timeout around the temp Solr start in ol-local-solr-start.sh so the container fails fast with an actionable message instead of hanging when the data volume is incompatible with the current Solr major version (e.g. after the Solr 9 -> 10 upgrade in #12786). Also adds `make check-solr` to detect the mismatch while containers are already running, by comparing the live Solr version API against the image tag in compose.yaml. Closes #12792
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves local developer experience around Solr major-version upgrades by making Solr volume incompatibility failures fast and actionable, and by adding a helper command to detect a running-version mismatch against the repository’s expected Solr image version.
Changes:
- Add a 60s timeout + clearer error messaging around the temporary Solr start used during schema-change core recreation.
- Add
make check-solrto compare the running Solr major version (via the admin API) against the expected version incompose.yaml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Makefile |
Adds check-solr target to detect major-version mismatches between a running Solr and the expected Docker image tag. |
docker/ol-local-solr-start.sh |
Wraps the temp Solr startup/readiness wait in timeout 60 and prints an actionable error if it can’t come up (e.g., stale/incompatible volume). |
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.
Summary
After the Solr 9 → 10 upgrade (#12786), developers with existing data volumes hit silent search failures. The root cause:
ol-local-solr-start.shtries to start Solr on a temp port to count documents before wiping the core — if Solr 10 can't read Solr 9 data, that step hangs indefinitely with no output.This PR makes the failure fast and visible, and adds a runtime check for developers who haven't restarted yet.
Changes
docker/ol-local-solr-start.sh— wrap the temp Solr start intimeout 60:Makefile— addmake check-solr:http://localhost:8983/solr/admin/info/system(running version)image: solr:X.Y.Zline incompose.yaml(expected version)Example output
After a major version bump,
docker compose logs solrwill show:And
make check-solrwhile already running:Testing
The timeout path is hard to trigger without a stale volume, but the happy path (schema unchanged, or schema changed + Solr starts fine) is unaffected — only the error branch is new code.
make check-solrcan be tested locally with Solr running: it should print✓ Solr version OK (X.Y.Z).Closes #12792