Read the cluster's distribution version instead of returning a constant - #72
Merged
janhoy merged 1 commit intoSep 3, 2026
Conversation
cluster_distribution_version created a client and then ignored it, returning "9.10.1". That value selects the workload branch via versions.best_match, so a Solr 10 cluster was benchmarked with Solr 9 workloads silently. Use the client's get_version(), and fail with a SystemSetupError naming --distribution-version when the cluster cannot be read.
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.
Description
cluster_distribution_versionis documented as "Attempt to get the cluster's distribution version", but it created a client and then ignored it (solrorbit/builder/builder.py:272):Every externally provisioned run that does not pass
--distribution-versionwas therefore told the cluster is 9.10.1, whatever it actually is.That value is not informational — it selects the workload branch.
WorkloadRepository.updatefeeds it toversions.best_match(solrorbit/utils/repo.py:71):CONTRIBUTING.mdinsolr-orbit-workloadsdocuments that selection as intended — "solr-orbit automatically selects the workload branch that matches the Solr major version being tested" — so once a10branch exists there, a Solr 10 cluster gets benchmarked with the Solr 9 workloads and the run succeeds silently.This calls the client's existing
get_version(), which readslucene.solr-spec-versionfromGET /api/node/system. When the cluster cannot be read it raisesSystemSetupErrornaming--distribution-versionrather than substituting a constant, since a wrong value is worse than a stop.Verified against an unmodified
solr:latestcontainer (Solr 10.0.0,solr-impl 10.0.0 6c6c48a6f78, Lucene 10.3.2):One deliberate consequence: the
minimum_solr_versioncheck intest_run_orchestrator.setup()was inert, because it compared a constant against a constant. It now compares against the real cluster.min-version.txtis9.0.0, so 9.x and 10.x are unaffected and the only newly-rejected clusters are Solr 8 and older, which are already below the documented minimum.Issues Resolved
Fixes #70
Testing
Four tests in
tests/builder/mechanic_test.py: the version is read from the cluster, the resultingbest_matchpicks the cluster's own major, an unreachable cluster raisesSystemSetupErrornaming the flag, and a non-Solr client still returnsNone.Three of the four fail without the change (
'10.0.0' != '9.10.1','10' != '9',SystemSetupError not raised); the fourth is a regression guard on existing behaviour and passes either way.ruff check .clean; full unit suite 1108 passed / 5 skipped.make itwas not run.