-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster leader election multiple issues #860
Comments
Following on from this: if I restart a node in the cluster while all are running, the restarted node is always elected as leader. This should not happen if the weights were respected. If the leader is restarted the next-highest weighted node should become leader until the restart has completed and the higher-weighted node takes over. |
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. |
Is there a way of reopening this issue? I am seeing the same behaviour on v3 beta 4 (HA addon is beta 3): |
I re-opened the issue for transparency. I believe this won't be handled as fixes to the current mechanism though. Instead, #780 seems like the best way forward to me. |
Describe the bug
none
as cluster leader for newly-added nodes.To reproduce
I have 3 nodes:
office
,lounge
,workshop
. I have the peer IDs explicitly listed in each config file, auto discovery is disabled, each node is weighted as 10, 2, and 1, respectively. My MQTT broker is running on a different machine on the local network. Home assistant integration and room-assistant logs is used to view leader election.lounge
. Wait for discovery of devicesoffice
.office
reportslounge
is added to cluster butoffice
is not elected as leader.office
does not log any leader election change. Home Assistant reportsoffice
cluster leader asnone
with 2 instances in cluster.workshop
.lounge
andoffice
both reportworkshop
as added to cluster.lounge
andoffice
both logworkshop
as being elected as leader.workshop
does not log itself as being elected as leader.lounge
andoffice
then immediately logoffice
as elected as leader,workshop
does not log any leadership change. Home Assistant shows thelounge cluster leader
to belounge
whileoffice
andworkshop
show the cluster leader asoffice
.Relevant logs
lounge
office
workshop
Relevant configuration
All of the configs look like this. Only the
instanceName
andweight
differs.Expected behavior
lounge
should first log itself as leader. It's the only node.office
should be elected as leader when added to the cluster. It has the highest weight (10). However it was not.office
should publish the current value of the leader (even if incorrect) to MQTT, notnone
(which may be the absence of a publication) because no re-election has taken place.lounge
should log the addition ofoffice
to the cluster. It does not.workshop
should be added to the cluster but never elected as leader.office
as leader for the cluster as reported by each node's "cluster leader" sensor. It does not.Environment
office
is an Raspberry Pi 4 on ethernet,lounge
andworkshop
are Raspberry Pi Zero W on Wi-Fi. MQTT broker is hardwired home server running mosquitto in Docker on Ubuntu 21.04 on an Intel Core i5 10400, 32 GB RAM.The text was updated successfully, but these errors were encountered: