[ 
https://issues.apache.org/jira/browse/SOLR-17158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17891053#comment-17891053
 ] 

David Smiley commented on SOLR-17158:
-------------------------------------

Question:  if all shards time out and if shards.tolerant=true, then we don't 
truly have partial results to return to the user.  What should we do?  I argue 
failing is appropriate instead of 200 despite shards.tolerant.

 I created the following test method on TestDistributedSearch (where 
shards.tolerant is tested):
{code:java}
  public void testTimeAllowed() throws Exception {
    var cluster = new MiniSolrCloudCluster.Builder(1, createTempDir())
                      .addConfig("conf", 
configset("cloud-minimal")).configure();
    CloudSolrClient client = cluster.getSolrClient();
    String COLLECTION_NAME = "test_coll";
    CollectionAdminRequest.createCollection(COLLECTION_NAME, "conf", 2, 1)
        .setRouterName("implicit")
        .setShards("shard_1,shard_2")
        .process(cluster.getSolrClient());
    cluster.waitForActiveCollection(COLLECTION_NAME, 2, 2);    var query = new 
SolrQuery();
    query.setQuery("{!func}sleep(5000,0)");
    query.set(CommonParams.TIME_ALLOWED, 10);
    query.set(ShardParams.SHARDS_TOLERANT, "true");
    var response = client.query(COLLECTION_NAME, query);
    System.out.println(response);
    assertTrue(response.getElapsedTime() < 1000); // definitely less than a 
second
    cluster.shutdown();
  } {code}
And it fails, not actually timing out in the 10 milliseconds given for 
timeAllowed.  I expected this issue here would make this pass?

> Terminate distributed processing quickly when query limit is reached
> --------------------------------------------------------------------
>
>                 Key: SOLR-17158
>                 URL: https://issues.apache.org/jira/browse/SOLR-17158
>             Project: Solr
>          Issue Type: Sub-task
>          Components: Query Limits
>            Reporter: Andrzej Bialecki
>            Assignee: Gus Heck
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: main (10.0), 9.8
>
>          Time Spent: 8h 50m
>  Remaining Estimate: 0h
>
> Solr should make sure that when query limits are reached and partial results 
> are not needed (and not wanted) then both the processing in shards and in the 
> query coordinator should be terminated as quickly as possible, and Solr 
> should minimize wasted resources spent on eg. returning data from the 
> remaining shards, merging responses in the coordinator, or returning any data 
> back to the user.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to