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

Tomás Fernández Löbbe commented on SOLR-11739:
----------------------------------------------

bq. Solr should assign the asyncIds and guarantee that they are unique
We now do something like this when async IDs are not provided, but *on the 
client side*. See 
https://github.com/apache/lucene-solr/blob/41644bdcdcc0734115ce08ec24d6b408e1f8cf28/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java#L150-L152
bq. It sounds like tomas is saying that there is existing code in solr that 
tries to reject duplicate asyncIds
Yes, here: 
https://github.com/apache/lucene-solr/blob/41644bdcdcc0734115ce08ec24d6b408e1f8cf28/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java#L282-L286
bq. Solr should happily let you specify the same asyncId multiple times
hmm I'm not sure. I think the fact that Solr won't re-execute the same request 
twice makes it much easier to write workflows that do collection operations. 
bq. isn't the amount of work / zk writes needed to generate a universally 
unique asyncId on the server side essentially the same as the amount needed to 
tell the client that the asyncId they specified isn't unique?
We now do a bunch of reads to check if the async IDs are in any of the current 
queues/maps (see the code I linked above). I was considering either writing to 
some ZooKeeper path the async ID  as part of a lock, before checking the 
existing queues and then deleting the lock, or moving completely the async IDs 
to it's own path, and starting using this as the source of truth of asyncIDs. 
The later would then make it easier to check if an async ID is currently in 
use, however it's a much bigger change and we'll need to consider back 
compatibility

> Solr can accept duplicated async IDs
> ------------------------------------
>
>                 Key: SOLR-11739
>                 URL: https://issues.apache.org/jira/browse/SOLR-11739
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Tomás Fernández Löbbe
>            Assignee: Tomás Fernández Löbbe
>            Priority: Minor
>         Attachments: SOLR-11739.patch
>
>
> Solr is supposed to reject duplicated async IDs, however, if the repeated IDs 
> are sent fast enough, a race condition in Solr will let the repeated IDs 
> through. The duplicated task is ran and and then silently fails to report as 
> completed because the same async ID is already in the completed map. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to