gerlowskija commented on code in PR #3955:
URL: https://github.com/apache/solr/pull/3955#discussion_r2640237534
##########
solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java:
##########
@@ -142,14 +143,15 @@ public void addRepository(String repoName, String uri)
throws Exception {
public void addKey(byte[] key, String destinationKeyFilename) throws
Exception {
// get solr_home directory from info servlet
- NamedList<Object> systemInfo =
- solrClient.request(
- new GenericSolrRequest(SolrRequest.METHOD.GET, "/solr" +
SYSTEM_INFO_PATH));
- String solrHome = (String) systemInfo.get("solr_home");
+ // This method is only called from PackageTool ("add-repo", or "add-key"),
where the Solr URL is
+ // normalized to remove the /solr path part
+ // So might as well ping the V2 API "/node/system" instead.
+ // Otherwise, this SystemInfoRequest ctr would need to set the full
/solr/admin/info/system path
+ SystemInfoResponse sysResponse = new
SystemInfoRequest("/node/system").process(solrClient);
Review Comment:
Another factor in where we use "v2" on the server side is that, currently,
users can disable the v2 API with a system property: `solr.api.v2.enabled`.
I think we're ready to remove that capability, so that we can start relying
on "v2" endpoints being available for inter-node calls, tooling, etc. But
while it exists it's probably brittle to have tooling, etc. use v2 endpoints.
Coincidentally, the package-store code here is one of the few places that
assuming v2 is "safe". The package-manager **only** has v2 APIs. So it's safe
for us to call other v2 endpoints from the package store code, because if v2 is
disabled then all this code is unreachable anyways.
--
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]