Add support for node priority
Submission type
- Request for enhancement (RFE)
Enhancement Description
I think it would be a valuable feature to be able to give preference to a node (or nodes) for master election. This could be via a flag or a numeric value. This could be applied at a per keeper setting, or a cluster setting that says "try and keep master at this node."
My reasoning for this is that it could be cost efficient (this is my use case) to setup a cluster where one node is better specked than the others in order to better handle incoming writes. It would make sense for Stolon to try and make sure this node is always master. If it goes down, then Stolon would move master to another node, but when it comes back up, Stolon would move master back to this node.
I tried this in different places and tools and at first it feels okay, but in edge situations it makes things worse:
- if specific node is 'better' then it will force master node flapping - it's better to actually avoid failovers if possible
- if specific nodes are 'worse' then it's even more possible that given node will be overloaded if better node is not capable of the workload.
I short:
- do not force leader election if better node comes online
- better avoid single node with higher priority, or just get better hardware to have at least 2 nodes with higher priority.