andyvuong opened a new pull request #1687:
URL: https://github.com/apache/lucene-solr/pull/1687


   # Description
   
   This fixes a bug in the solrj interface for the [COLSTATUS collection 
api](https://lucene.apache.org/solr/guide/8_6/collection-management.html#colstatus)
 as detailed in the [JIRA](https://issues.apache.org/jira/browse/SOLR-14658) 
such that using the class 
CollectionAdminRequest.collectionStatus(collectionName) to issue colstatus 
commands would return all collections vs just the one specified. This is an 
issue as the operation sends a request to all collections' shard leaders. 
   
   # Solution
   
   CollectionAdminRequest.collectionStatus(collectionName) will now only return 
one collection. To support getting the status for all collections, I've added 
CollectionAdminRequest.collectionStatuses(). The documented API still works 
exactly as it is detailed.
   
   # Tests
   
   I've added a new test case to test these new interfaces. I've also provided 
a snippet of code and steps for manual validation in the JIRA (to repro the 
bug) but i can be used to test the fix as well:
   ```
       String host = "http://localhost:8983/solr";;
       HttpSolrClient.Builder builder = new HttpSolrClient.Builder(host);
       HttpSolrClient solrClient = builder.build();
   
       String collection = "tes";
       final NamedList<Object> response = 
         
//solrClient.request(CollectionAdminRequest.collectionStatus(collection));
         solrClient.request(CollectionAdminRequest.collectionStatuses());
         response._forEachEntry((k,v) -> {
           System.out.println(k);
         });
       System.out.println(response);
   ```
   Using just the API and not solrj for verification:
   - 
http://localhost:8983/solr/admin/collections?action=COLSTATUS&collection=tester1
     - return one collection
   - http://localhost:8983/solr/admin/collections?action=COLSTATUS
     - return all collections
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to 
Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms 
to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request 
title.
   - [x] I have given Solr maintainers 
[access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
 to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `master` branch.
   - [x] I have run `ant precommit` and the appropriate test suite.
   - [x] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref 
Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) 
(for Solr changes only).
   


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

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