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