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

David Smiley commented on SOLR-8238:
------------------------------------

Suggested approach:
 * a core loads... at some point where it's ready to receive requests... 
 * asynchronously dispatch a command to node level executor of only 1 thread ...
 * Runnable logic:  
condition 1: we (this replica) are in state "ACTIVE" (we should already be but 
check just in case)
condition 2:  are we *not* the leader yet we are preferredLeader? continue...
condition 3:  Is the node holding the current leader a version of Solr greater 
than or equal to the current node? (avoids leaders upgrading too soon) 
continue...
Action:  tell the current leader to give up leadership.  Wait for the 
leadership transition to complete so that we don't prematurely free up a thread 
that could lead to many simultaneous index replications.  There's a 
cluster/http command to give up leadership; no ZK surgery.  The effect of this 
will be the current replica will become leader since a preferredLeader joins 
the election "at head" (thus next in line) instead of last.

Maybe this should be registered to occur just-in-time like a state watcher / 
event listener.  That's probably more elegant.

> Make Solr respect preferredLeader at startup
> --------------------------------------------
>
>                 Key: SOLR-8238
>                 URL: https://issues.apache.org/jira/browse/SOLR-8238
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrCloud
>    Affects Versions: 5.2.1
>            Reporter: Peter Morgan
>            Priority: Minor
>
> After setting preferredLeader property, noticed that upon restarting leaders 
> revert to wherever they were previously running before REBALANCE was called.  
>  I would expect the preferredLeader to influence the startup election, but it 
> appears it is not observed.



--
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