serhiy-bzhezytskyy opened a new pull request, #72:
URL: https://github.com/apache/solr-orbit/pull/72

   ### Description
   
   `cluster_distribution_version` is documented as "Attempt to get the 
cluster's distribution version", but it created a client and then ignored it 
(`solrorbit/builder/builder.py:272`):
   
   ```python
   client_instance = client_factory(hosts, client_options).create()
   if isinstance(client_instance, client.SolrClient):
       return "9.10.1"
   return None
   ```
   
   Every externally provisioned run that does not pass `--distribution-version` 
was therefore told the cluster is 9.10.1, whatever it actually is.
   
   That value is not informational — it selects the workload branch. 
`WorkloadRepository.update` feeds it to `versions.best_match` 
(`solrorbit/utils/repo.py:71`):
   
   ```
   versions.best_match(["main", "9", "10"], "9.10.1")  -> '9'
   versions.best_match(["main", "9", "10"], "10.0.0")  -> '10'
   ```
   
   `CONTRIBUTING.md` in `solr-orbit-workloads` documents that selection as 
intended — "solr-orbit automatically selects the workload branch that matches 
the Solr major version being tested" — so once a `10` branch 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 reads 
`lucene.solr-spec-version` from `GET /api/node/system`. When the cluster cannot 
be read it raises `SystemSetupError` naming `--distribution-version` rather 
than substituting a constant, since a wrong value is worse than a stop.
   
   Verified against an unmodified `solr:latest` container (Solr 10.0.0, 
`solr-impl 10.0.0 6c6c48a6f78`, Lucene 10.3.2):
   
   ```
   cluster_distribution_version()  ->  '10.0.0'      (was '9.10.1')
     best_match(['main','9','10'], '10.0.0') -> '10'  (was '9')
   
   unreachable host -> SystemSetupError: Could not determine the distribution 
version of the
     cluster at [{'host': 'localhost', 'port': 9999}]. Specify it with 
--distribution-version.
     Cause: HTTPConnectionPool(...)
   ```
   
   One deliberate consequence: the `minimum_solr_version` check in 
`test_run_orchestrator.setup()` was inert, because it compared a constant 
against a constant. It now compares against the real cluster. `min-version.txt` 
is `9.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
   
   - [x] New functionality includes testing
   
   Four tests in `tests/builder/mechanic_test.py`: the version is read from the 
cluster, the resulting `best_match` picks the cluster's own major, an 
unreachable cluster raises `SystemSetupError` naming the flag, and a non-Solr 
client still returns `None`.
   
   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 it` was 
not run.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to