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

Erick Erickson commented on SOLR-8238:
--------------------------------------

OK, you're asking me to get in the way-back machine here, but I still get 
e-mails from JIRAs I haven't stopped watching, generally ones from a long time 
ago....

Before the preferredleader  and rebalanceleaders code was put in, it was 
possible to put hundreds of leaders on a single SOLR instance. This was a 
situation where there were a gazillion shards and the cluster was restarted and 
a particular SOLR instance had a replica from many shards and came up first. 
There was no way to move the leaders off that SOLR instance. And (IIRC), the 
added load on that instance was noticeable cluster wide. The preferredleader 
option and rebalanceleader command were put in to fix this (rare) situation. So 
the situation this was designed to address was before PREFERREDLEADER was an 
option.

By and large, being concerned about how many shards had a leader on the same 
node is unnecessary.

Now, that said, this was years ago. Whether this is necessary in modern code is 
left "as an exercise for the reader" ;) Also (and my memory may not be accurate 
here) this was before TLOG replicas were a thing.

Imagine that there are hundreds of shards and a replica of each shard is on 
some SOLR instance and that instance is the first one started. How many leaders 
would be on that SOLR instance. And remember that this case had _hundreds_ of 
shards, so was an outlier back then (although I'm far enough out of the loop 
that I don't know how common such a situation is now)...

Back to retirement ;)

> 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: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to