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

Yuntong Qu commented on SOLR-6122:
----------------------------------

I believe there could be 2 possible approach to handle this. 

Apporach 1:
 * Make another queue for collection-queue-cancel
 * collection handle submit cancel request as Znode to collection-queue-cancel
 * In Overseer, during each 
[run()|https://github.com/apache/solr/blob/383d21bac694d17ae64ddae5af30cfb9b5a0c615/solr/core/src/java/org/apache/solr/cloud/OverseerTaskProcessor.java#L168]
 in OverseerTaskProcessor, we view items from collection-queue-cancel and 
decide in Overseer if requested. task cancel should be removed from 
collection-queue-work and running map. 

Cons:

- not treating cancel task as a normal collection api call, requiring a 
seperate queue, seperate code path to submit and read Znode
- also need code to handle the case where we are running distributed Collection 
API  


Approach 2:
 * submit cancel to collection-queue-work
 * make a new CollectionApiCommand, CancelCmd, which is going to modify  
collection-queue-work and running map if nessesary

Cons: 
- 
[CollectionApiCommand|https://github.com/apache/solr/blob/f5b012912aa9313c801d20835a1de05e0407a6b1/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java#L117]
 have no direct ways for interacting with overseer queues. And doing it through 
CollectionApiCommand somewhat break the assumption that those cmd should not 
care about overseer queue implementation. 

 In my opinion that it should be 
[OverseerTaskProcesser|https://github.com/apache/solr/blob/f5b012912aa9313c801d20835a1de05e0407a6b1/solr/core/src/java/org/apache/solr/cloud/OverseerTaskProcessor.java#L168]
 class's responsiblity to handle add/remove item from overseer queue as it 
currently does, so i am leaning towards apporach 1. 

> API to cancel an already submitted/running Collections API call
> ---------------------------------------------------------------
>
>                 Key: SOLR-6122
>                 URL: https://issues.apache.org/jira/browse/SOLR-6122
>             Project: Solr
>          Issue Type: Wish
>          Components: SolrCloud
>            Reporter: Anshum Gupta
>            Priority: Major
>
> Right now we can trigger a long running task with no way to cancel it 
> cleanly. 
> We should have an API that interrupts the already running/submitted 
> collections API call.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to