epugh commented on code in PR #5178:
URL: https://github.com/apache/solr/pull/5178#discussion_r4304712451


##########
solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigSolrCloudTest.java:
##########
@@ -77,6 +82,33 @@ public void testGetZnodeVersionFromCollection() throws 
Exception {
     assertTrue(response.znodeVersion.params >= -1);
   }
 
+  /**
+   * Reproduces a bug where a v2 "/config" request proxied internally to the 
node actually hosting
+   * the collection fails with "Cannot find API for the path", because Solr 
forwards such requests
+   * using the short "/c/{collection}/..." alias, but {@code 
Constants.INDEX_PATH_PREFIX}'s JAX-RS
+   * {@code @Path} regex only recognizes "cores" or "collections", not "c".
+   */

Review Comment:
   Trimmed the javadoc — agreed, the method name says it all.
   
   Answering the "is this specific to config?" question: no. 
`INDEX_PATH_PREFIX` is shared by `ConfigApi`, `GetSchemaApi`, `SelectApi`, 
`TasksApi`, and `UpdateSchemaApi` — any JAX-RS resource built on it would hit 
the same 404 whenever a request gets proxied cross-node. Just happened to find 
it via config.
   
   Reproduced it manually too, outside the test suite, with a packaged build:
   
   ```
   bin/solr start -e cloud -y   # 2 nodes, ports 8983 and 7574
   
   # force a 1-shard/1-replica collection so it only lands on ONE node
   curl 
"http://localhost:8983/solr/admin/collections?action=CREATE&name=repro&numShards=1&replicationFactor=1&collection.configName=gettingstarted";
   # -> landed on localhost:7574 in my run
   
   # hit the OTHER node (8983), forcing an internal proxy
   curl -i "http://localhost:8983/api/collections/repro/config/overlay";
   ```
   
   Before this fix: `404 {"...":"Cannot find API for the path: 
/config/overlay"}`
   After this fix: `200 {"overlay":{"znodeVersion":-1}}`



-- 
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]

Reply via email to