Repository navigation
Conversation
circuitBreaker, initParams, listener, and updateRequestProcessorChain
are declared without REQUIRE_NAME in SolrConfig's plugin registry, so
SolrConfig#writeMap serializes them as a List rather than a name-keyed
Map. GetConfig#filterByComponentName's unconditional (Map) cast then
threw ClassCastException for any by-name lookup against these sections
(reachable both via v1's componentName query param, pre-existing, and
the new v2 GET /config/{component}/{componentName} path added here),
surfacing as an uncaught 500 instead of the documented 404 convention.
- filterByComponentName now checks the section's shape and throws a
clean NOT_FOUND when by-name filtering doesn't apply, fixing the v1
path that predates this PR.
- Also drop the 4 non-named sections from the v2 by-name @path regex,
since offering a route that can never find a match by name isn't a
useful API surface.
- cache has the same REQUIRE_NAME+MULTI_OK shape as the other sections
already pluralized here (listener->listeners, queryParser->
queryParsers, etc.) but was left singular; renamed to caches for
consistency.
Verified via a throwaway reproduction test: GET .../config/circuitBreaker/x
500'd with ClassCastException before this change, now returns a clean 404.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
|
Found a bug while reviewing this against `dev-docs/apis-v2-conventions.adoc`: `circuitBreaker`, `initParams`, `listener`, and `updateRequestProcessorChain` are declared without `REQUIRE_NAME` in `SolrConfig`'s plugin registry, so `SolrConfig#writeMap` serializes them as a `List` rather than a name-keyed `Map`. `GetConfig#filterByComponentName`'s unconditional `(Map)` cast then throws a `ClassCastException` for any by-name lookup against these sections — reachable both via v1's `componentName` query param (pre-existing bug, predates this PR) and the new v2 `GET /config/{component}/{componentName}` path this PR adds. That surfaces as an uncaught 500 instead of the documented NOT_FOUND/404 convention. Reproduced with a throwaway test: `GET .../config/circuitBreaker/x` 500'd with the ClassCastException before this fix, returns a clean 404 after. Pushed a fix:
All existing tests pass (`GetConfigTest`, `GetConfigSolrCloudTest`, `V2ConfigAPIMappingTest`, `TestSolrConfigHandler`, `TestSolrConfigHandlerCloud`). |
https://issues.apache.org/jira/browse/SOLR-16396
Description
Migrate remaining GET /config/{component} sections to JAX-RS
Solution
This will be a follow-up PR after: #5168
Will convert this from Draft -> ready-for-review once that PR is merged.
With this PR merged, all GET config sections will get be fully JAX-RS compatible.
Tests
TBA
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.