You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Erick Erickson (JIRA)" <ji...@apache.org> on 2015/11/04 20:24:27 UTC

[jira] [Commented] (SOLR-8238) Make Solr respect preferredLeader at startup

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

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

The intention here is that the preferredLeader role has two functions:

1> Cause the cluster to _tend_ toward the preferredLeader role coinciding with the actual leader.

2> allow pathological out-of-balance situations to be rectified.

It accomplishes <1> by the following: As a node comes up, if it has the preferredLeader role set and another node _is_ the leader, it inserts itself as the next-in-line for leadership election for its shard. So any time the current leader abdicates its leadership role, this node will become the leader. That's why we called it "preferredLeader rather than something like "requiredLeader".

2> is the REBALANCELEADERS command. But this noticeably impacted performance in a situation where literally hundreds of replicas on a single Solr instance were leaders, very special circumstances.

Unless we come up with a use case where the current functionality is demonstrably affecting performance, I think the added complexity (especially in the case where the entire cluster is being restarted) is not worth the risk. I can be talked out of that opinion but it'd have to be for more then aesthetic reasons.

In the general case, the leader role imposes a small amount of additional work on a node that it can usually be ignored.

> 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
(v6.3.4#6332)

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