epugh opened a new pull request, #5413:
URL: https://github.com/apache/solr/pull/5413
Found while testing the Schema Designer (#5412): deleting a configset that
is still used by a collection through the v2 API reports success but deletes
nothing.
```
$ curl -X DELETE localhost:8983/api/configsets/._designer_films
{"responseHeader":{"status":0,"QTime":36}} # HTTP 200, configset
still there
$ curl
"localhost:8983/solr/admin/configs?action=DELETE&name=._designer_films"
... "msg":"Can not delete ConfigSet as it is currently being used by
collection [._designer_films]", "code":400
```
### Cause
When the configset command runs through the Overseer,
`ConfigSetAPIBase.handleResponse` recorded a failure with
`rsp.setException(...)`. The v1 handler turns that into an error response, but
the v2 Jersey endpoints return their own `SolrJerseyResponse` and never look at
`rsp`, so the error was dropped. With the distributed command runner (no
Overseer) the failure is already thrown, which is why this only shows up in
Overseer mode.
### Fix
Throw the `SolrException` instead. v1 still returns the same 400 with the
Overseer's error details; v2 now returns the error too. This affects `DELETE
/api/configsets/{name}` and, for failures only detected in the Overseer, `POST
/api/configsets` (clone).
### Tests
`TestConfigSetsAPI.testDeleteErrorsV2` deletes an immutable configset
through the generated v2 client and expects the error. It fails without the fix
with `-Ptests.jvmargs=-Dsolr.cloud.overseer.enabled=true` (the test framework
otherwise randomizes Overseer mode). All `TestConfigSetsAPI*` and
`handler.configsets` tests pass in Overseer mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_018RwsEmM9zRWihYjszWDGK9
--
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]