-
Notifications
You must be signed in to change notification settings - Fork 810
SOLR-16458: Node system info V2 api jersey resource #4078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add NodeSystemIfoApi (notice the lower-case last chars), to (eventually) replace Endpoint NodeSystemIfoAPI. Lo warning about deprecation. Add GetNodeSystemInfo, move the info-gathering logic to a separate class NodeSystemInfoProvider, adjust SystemInfoHandler. Known Issue: NodeSystemInfoResponse does not support responses from multiple nodes. More testing and clean-up to do.
Fix NodeSystemResponse to contain a map of node name to node info. Fix responses for Json and XML. TODO : nodes=all is ignored
Clean-up unused imports
forgot those in the previous commit
Fix log calls. Add unit tests for HTTP call.
Remove the Map from NodeSystemInfoResponse: the AdminHandlersProxy wraps all nodes responses into a map, it should not belong to the response class.
Replace the Map wrapper by just a single object wrapper: NodeSystemInfo. It provides some separation between the response header and the actual node info.
|
First off, thanks again for sharing this PR and tackling another v2 API!
I agree with some of your concerns about the "cosmetics" of the request and API-response as they are today. We're free to change v2 APIs and their responses as much as we'd like. But v1 APIs are required to be backwards-compatible: breaking changes can only occur on major-version upgrades. That's not to say that v1 can't be changed, just that if v1 has a "breaking change" then it can only go to 'main', not branch_10x. So we've got some options depending on how much we care about updating v1 vs. v2-only. What we've done in a few places elsewhere is make whatever improvements we want to the v2 response format, and then if the v1 codepath calls v2 code have the v1 code do some manual massaging to reshape the response into something that meets backwards compatibility. It's not pretty, but it meets the requirements and is code that will eventually go away when we are able to deprecate and remove some of these v1 endpoints. So that's probably what I'd recommend for these sort of smaller response-changes. I'm somewhat tempted, as I read your comments, to suggest overhauling this endpoint entirely and making it look radically different in our v2 API. Something like splitting it up into a few smaller paths, like |
Thanks for the feedback, @gerlowskija As for splitting the new V2 response into smaller paths, it could be a path parameter, at least for "block" of info, like "jvm", "gpu", what else? I'm not sure what |
https://issues.apache.org/jira/browse/SOLR-16458
Jira Ticket
The Excel spreadsheet links to SOLR-16458 for the V1 /solr/admin/info/system and V2 /api/node/system, although the ticket does not mention those URLs.
From the checklist below : "I have created a Jira issue and added the issue ID to my pull request title." - m'well, no. But keeping track of these V2 tickets is probably difficult enough without adding one more.
Sorry about the mix-up in the commit messages. I originally landed on the wrong ticket.
Description
Implementation of a Jersey resource to support getting the system info. This new resource should replace the home-brew "Endpoint" V2 resource.
DRAFT:
-- This PR wrap the system info in "nodeInfo":
<response><lst name="responseHeader"><!-- ... --></lst><lst name="nodeInfo"><str name="node">localhost:8983_solr</str><!-- ... --></lst></response>-- Ideally, IMHO, the "node" field should be named "name" (i.e.: the node name), and then the wrapper "nodeInfo" could be just "node"
-- AdminHandlersProxy wraps all proxied responses into a NamedList where the name is the node name (host:port_solr). This creates a structure with unpredictable (or not easily predictable) keys. If we do adopt a response with the "nodeInfo" wrapper, then, the proxied responses could be added to the list of "nodeInfo"... In a specific implementation of AdminHandlersProxy (ref.SOLR-16738: Refactor special-casing out of AdminHandlersProxy #3991). This is all a lot of changes, breaking changes for whoever is parsing the response already. Opinions?
Solution
Add NodeSystemInfoApi (in solr-api), implemented in GetNodeSystemInfo.
Class NodeSystemInfoProvider contains code to provide the system info, copied from SystemInfoHandler.
Clean-up SystemInfoHandler to use GetNodeSystemInfo.
Tests
Add unit tests for NodeSystemInfoProvider (note that the test class for SystemInfoHandler was actually only testing a method now found in NodeSystemInfoProvider).
Add unit tests for GetNodeSystemInfo.
Functional tests on a local instance (dev-slim, started with the "cloud" example)
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.