isaric opened a new pull request, #5401: URL: https://github.com/apache/solr/pull/5401
JIRA: [SOLR-18606](https://issues.apache.org/jira/browse/SOLR-18606) Target: `branch_10x` # Description The `branch_10x` backport of SOLR-18606 (0b2fa93853b) had to leave out `CloudHttp2SolrClientTest.testShardReplicationFactors` and `testShardReplicationFactorsWithoutRouteFactors`, because on `main` they read `CloudSolrClient.REPFACT_BY_ROUTE`, which comes from SOLR-18603 and is not on 10x. David suggested on SOLR-18603 that the coverage could be backfilled with a 10x PR instead. # Solution The two tests, adapted to how 10x computes the values: `getShardReplicationFactor` walks the per-route responses of a `RouteResponse`, and `getMinAchievedReplicationFactor` reads the condensed header first and falls back to the routes. The tests set the route responses explicitly, since `condenseResponse` does not attach them (only `request` does), and use real collections because the route walk looks up the collection's leaders. Covered: - condensed header carries the minimum `rf`, per-shard map and minimum match the routes - the fallback that derives the minimum from the routes when the header has no `rf` - routes without `rf`: empty map, `-1` - a plain `NamedList` that is not a `RouteResponse`: empty map, `-1` Test-only, no changelog entry. # Tests `CloudHttp2SolrClientTest.testShardReplicationFactors*` on this branch, plus `./gradlew tidy`. AI disclosure: drafted with Claude Code, reviewed by me. # Checklist Please review the following and check all that apply: - [x] I have reviewed the guidelines for [How to Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my code conforms to the standards described there to the best of my ability. - [x] I have created a Jira issue and added the issue ID to my pull request title. - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation) - [x] I have developed this patch against the `main` branch. (no: this PR targets `branch_10x` by design, see above) - [x] I have run `./gradlew check`. - [x] I have added tests for my changes. -- 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]
