Open angadsingh opened 4 years ago
Yeah, I fear the leader election needs some work and I probably either need to fork the underlying library or build something else for this. Thanks for the detailed issue reports!
There hasn't been any activity on this issue recently. In an effort to provide a better overview of current issues we automatically clean some of the old ones. Many of them may already be resolved in newer versions of room-assistant. This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug I have a 2 node setup - node1 and node2. I have set one of the nodes (
node1
) to have a weight of20
, which I prefer to become the leader, and the other (node2
) to10
. Because of another issue (https://github.com/mKeRix/room-assistant/issues/262), i ended up specifying thepeerAddresses
insidecluster
config, after which leader gets elected correctly. So, after i start both the nodes, I can see that the leader gets correctly asnode1
when i hit the /entities API on both the nodes. Perfect. But whenever i restart one of the nodes, the log on the other node shows that the other has become the leader - even though the API shows the correct election:To reproduce Setup up two nodes as per the config below Start/restart both nodes - leader will be elected properly, as per the entities API Restart one of the nodes - logs will show that leader as elected, even though API shows the correct leader, as per weight
Relevant logs
Relevant configuration
node1
node2
Expected behavior Logs should show the same leader as the API
Environment
node1
on Hass.io,node2
on NodeJSnode1
on Raspberry Pi 4B,node2
on Raspberry Pi Zero Wnode2
on Raspberry OS