Seems like a bug to me! Recommended reading: https://issues.apache.org/jira/browse/SOLR-6491 There's a treasure trove of information in JIRA to learn about how code comes to be; what were the intentions behind features; what alternatives were explored; pros & cons.
~ David Smiley Apache Lucene/Solr Search Developer http://www.linkedin.com/in/davidwsmiley On Mon, Feb 20, 2023 at 9:04 AM Bruno Roustant <bruno.roust...@gmail.com> wrote: > After many tests and deployments, it appears the preferredLeader flag > described in the RebalanceLeader command doc [1] is not useful. > It is taken into account only during the rebalance command. Afterwards, if > there is a leader election or some node restart, it is ignored. > > Is this preferredLeader useless? > I thought to use it to make leadership kind of sticky, but in practice the > leadership assignment quickly returns to randomness. So, what was the > purpose of this flag for the rebalance command, really a one-shot leader > assignment, ignored after? Or is it a bug? > > Indeed only the rebalance leader command doc talks about this replica > property. It is not mentioned elsewhere. But if it is ignored elsewhere, > it's not of a great help. > > Should I enter a bug on preferredLeader property not respected during > leader elections? > > [1] > > https://solr.apache.org/guide/solr/latest/deployment-guide/collection-management.html#rebalanceleaders >