Repository navigation
SOLR-18432: SolrVersion tolerates prerelease qualifier - #5254
Conversation
- satisfies() ignores the prerelease qualifier; add withoutPrerelease() - ZkController version-compat check compares without prerelease - SystemInfoProvider solrImplVersion fallback uses LATEST_STRING Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
c764fda to
d59169c
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the prerelease-version handling and cluster compatibility changes.
No open issues 🎉
What changed in this PR
Makes Solr version handling tolerate prerelease qualifiers such as -SNAPSHOT in package constraints and cluster compatibility checks, while preserving strict version comparison and equality.
Changes:
- Ignore prerelease qualifiers in
satisfies()and addwithoutPrerelease()for cluster compatibility comparisons. - Use
LATEST_STRINGas the fallback Solr implementation version in system information. - Add regression tests and a changelog entry; generating
LATEST_STRINGfrom the build version remains deferred.
| File | Description |
|---|---|
solr/core/src/test/org/apache/solr/handler/admin/NodeSystemInfoProviderTest.java |
Update the expected implementation-version fallback. |
solr/core/src/java/org/apache/solr/handler/admin/SystemInfoProvider.java |
Fall back to LATEST_STRING for implementation version. |
solr/core/src/java/org/apache/solr/cloud/ZkController.java |
Compare cluster versions without prerelease qualifiers. |
solr/api/src/test/org/apache/solr/util/TestSolrVersion.java |
Test prerelease range matching, removal, and strict ordering. |
solr/api/src/java/org/apache/solr/client/api/util/SolrVersion.java |
Normalize prereleases for range matching and expose a removal helper. |
changelog/unreleased/SOLR-18432-solrversion-prerelease.yml |
Document the prerelease-handling fixes. |
Review effort: Balanced
janhoy
left a comment
There was a problem hiding this comment.
I get the usecase for satisfies and that it is different from compareTo. Question is if there will ever be a need for the former satisfies logic, say in a satisfiesStrict() method?
I don't think so? It sure looked wrong. |
|
🤖 AI text below 🤖 (reviewed by Nick Shanin) @dsmiley, the production changes in this PR look good to me. I have four additional Gradle unit tests in The test-only diff from your current head changes only Linux validation at 842b1fb: 14 tests passedValidated at
Four one-line mutations failed at their intended assertions: bypassing range normalization, retaining the prerelease, dropping build metadata, and collapsing patch versions. Their executed-test/failure counts were 1/1, 2/2, 2/2 and 1/1 respectively; none failed during compilation or setup. To take these unit tests without rewriting history: git switch SOLR-18432-solrversion-prerelease
git fetch https://github.com/nick-boss-tech/solr.git solr-18432-gradle-only
git merge --ff-only 842b1fb426860764d442c87738252b70eccf2c93I also wrote a BATS test that starts a release-version node, joins a snapshot node, and checks version registration, replication, local reads, and absence of the false older-version warning. I lack Docker, so it remains untested and is on the separate |
|
Thanks Nick; I took the non-BATS tests. |
SolrVersion now tolerates a prerelease qualifier such as -SNAPSHOT. Package version constraints are matched ignoring the qualifier, the cluster version-compatibility warning no longer treats a prerelease as older than its release, and /api/node/system reports the correct Solr implementation version. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Nick Shanin <nick.boss.us@gmail.com> (cherry picked from commit 852b427)
SolrVersion now tolerates a prerelease qualifier such as -SNAPSHOT. Package version constraints are matched ignoring the qualifier, the cluster version-compatibility warning no longer treats a prerelease as older than its release, and /api/node/system reports the correct Solr implementation version. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Nick Shanin <nick.boss.us@gmail.com> (cherry picked from commit 852b427) (cherry picked from commit 11ebc82) Omits the SystemInfoProvider change and its test; that class (SOLR-16458) is not on branch_9x.
🤖 https://issues.apache.org/jira/browse/SOLR-18432
SolrVersionand its callers don't tolerate a prerelease qualifier such as-SNAPSHOT, which blocks makingLATEST_STRINGmatch the build version. This fixes the three breakages first:SolrVersion.satisfies()now evaluates on the version with the prerelease cleared (semver4j otherwise rejects every range for a prerelease), and a newwithoutPrerelease()is added. This unblocksPackageManager's constraint check.compareTo/equalsstay strict semver.ZkController.checkClusterVersionCompatibilitycompares versions without the prerelease, so a dev node is not reported as older than a released node of the same x.y.z. Log and exception messages still print full versions.SystemInfoProviderfalls back toLATEST_STRINGrather thanLATEST.getPrereleaseVersion()forsolrImplVersion.Whether
LATEST_STRINGshould be generated from the Gradle version is left for a follow-up.🤖 Generated with Claude Code