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

Amrit Sarkar commented on SOLR-18589:
-------------------------------------

Attached a patch with two failing tests on main, one for each mode:
* 
{{OverseerCollectionConfigSetProcessorTest.testLockTaskResolvesFollowedAlias}}: 
with {{collA}} locked, {{lockTask}} still grants a lock for a message naming 
{{aliasA}} (an alias of {{collA}}) with {{followAliases=true}}. It returns 
{{aliasA/shard1}} instead of null.
* {{AliasCollectionApiLockTest}} (Overseer disabled): holds the collection lock 
on the real collection, then sends async {{DELETEREPLICA 
collection=<alias>&followAliases=true}}. On main the command goes to RUNNING 
while the lock is held.

Affected commands are the ones that pass the alias name through and resolve it 
inside the command: DELETE, DELETESHARD, DELETEREPLICA, SPLITSHARD, 
MOVEREPLICA, MIGRATE, REINDEXCOLLECTION, RENAME. ADDREPLICA, CREATESHARD and 
BACKUP resolve the alias in the API layer, so they already lock the real 
collection.

Both tests pass when the alias is resolved before the lock key is computed. I'm 
working on a fix.

> Collection API lock is taken on the alias name when followAliases=true
> ----------------------------------------------------------------------
>
>                 Key: SOLR-18589
>                 URL: https://issues.apache.org/jira/browse/SOLR-18589
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Amrit Sarkar
>            Priority: Major
>         Attachments: SOLR-18589-failing-tests.patch
>
>
> When a Collection API request names an alias and sets {{followAliases=true}}, 
> the lock is taken on the alias name, not on the collection it resolves to. 
> This happens in both the distributed and the Overseer modes:
> * {{DistributedCollectionConfigSetCommandRunner}} locks on 
> {{getCollectionName(message)}}
> * {{OverseerCollectionMessageHandler.lockTask}} locks on 
> {{getTaskKey(message)}}, i.e. {{collection}} or {{name}} from the message
> So {{DELETE name=aliasA&followAliases=true}} and a concurrent {{ADDREPLICA 
> collection=realColl}} hold different locks and can run at the same time on 
> the same collection.
> Expected: resolve the alias before taking the lock, so both requests 
> serialize on the real collection.
> Found while reviewing SOLR-17895 
> ([#5161|https://github.com/apache/solr/pull/5161]).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to