aparnasuresh85 commented on code in PR #2571:
URL: https://github.com/apache/solr/pull/2571#discussion_r1695690868
##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java:
##########
@@ -246,6 +260,58 @@ public void testAliasHandling() throws Exception {
2, client.query(null,
paramsWithMixedCollectionAndAlias).getResults().getNumFound());
}
+ @Test
+ @LogLevel("org.apache.solr.servlet.HttpSolrCall=DEBUG")
+ public void testHttpCspPerf() throws Exception {
+
+ String collectionName = "HTTPCSPTEST";
+ CollectionAdminRequest.createCollection(collectionName, "conf", 2, 1)
+ .process(cluster.getSolrClient());
+ cluster.waitForActiveCollection(collectionName, 2, 2);
+
+ try (LogListener entireClusterStateLogs =
+
LogListener.info(HttpSolrCall.class).regex(PATTERN_WITHOUT_COLLECTION);
+ LogListener collectionClusterStateLogs =
+
LogListener.info(HttpSolrCall.class).regex(PATTERN_WITH_COLLECTION);
+ LogListener adminRequestLogs =
LogListener.info(HttpSolrCall.class).substring("[admin]");
+ CloudSolrClient solrClient = createHttpCSPBasedCloudSolrClient(); ) {
+ SolrInputDocument doc = new SolrInputDocument("id", "1", "title_s", "my
doc");
+ solrClient.add(collectionName, doc);
+ solrClient.commit(collectionName);
+ for (int i = 0; i < 3; i++) {
+ assertEquals(
+ 1, solrClient.query(collectionName, params("q",
"*:*")).getResults().getNumFound());
+ }
+
+ // 1 call to fetch entire cluster state via BaseHttpCSP.fetchLiveNodes()
+ // 1 call to LISTALIASES via getAliases() from CSC.sendRequest() ->
(CSC.directUpdate ->
+ // 1 call to fetch CLUSTERSTATUS for collection via getDocCollection()
(first collection
+ // lookup)
+ assertLogCount(adminRequestLogs, 3);
+ // 1 call to fetch CLUSTERSTATUS for collection via getDocCollection()
(first collection
+ // lookup)
+ assertLogCount(collectionClusterStateLogs, 1);
+ // 1 call to fetch entire cluster state from HttpCSP.fetchLiveNodes()
Review Comment:
This issue to be addressed by
https://issues.apache.org/jira/browse/SOLR-17381
--
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]