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

Shalin Shekhar Mangar commented on SOLR-8371:
---------------------------------------------

[[email protected]] -- Looking at the following code in doRecovery:
{code}
          // if we can't get the lock, another recovery is running
          // we check to see if there is already one waiting to go
          // after the current one, and if there is, bail
          boolean locked = recoveryLock.tryLock();
          try {
            if (!locked) {
              if (recoveryWaiting.get() > 0) {
                return;
              }
              recoveryWaiting.incrementAndGet();
            } else {
              recoveryWaiting.incrementAndGet();
              cancelRecovery();
            }
            
            recoveryLock.lock();
            try {
              recoveryWaiting.decrementAndGet();
              ...
              ...
{code}

In the case where the tryLock fails, you bail out if the recoveryWaiting > 0 
but in case it is not -- we should increment recoveryWaiting and then again 
bail out if recoveryWaiting > 1 (and decrement recoveryWaiting). The idea is to 
run only the latest recovery request which has come in and no more. What do you 
think?

> Try and prevent too many recovery requests from stacking up and clean up some 
> faulty logic.
> -------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8371
>                 URL: https://issues.apache.org/jira/browse/SOLR-8371
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrCloud
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>             Fix For: 5.5, master
>
>         Attachments: SOLR-8371-2.patch, SOLR-8371.patch, SOLR-8371.patch, 
> SOLR-8371.patch, SOLR-8371.patch, SOLR-8371.patch, SOLR-8371.patch, 
> SOLR-8371.patch, SOLR-8371.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to