This patch adds qdevice-net part of keep active partition tie breaker
functionality. It's enabled by default.
When tie happens prefer partition with members of
previously active (quorate) partition. This is hard-coded
behavior of LMS algorithm so this setting affects only
FFSplit algorithm. By default it is disabled for backwards
compatibility.
This solves problem with FFSplit when node A (with lowest id) is killed,
node B gets vote and then node A starts up and creates single node
membership and gets vote.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Previous patch 8dbf1bc8b0 was wrong
because it fixed the crash but made qdevice not work at all.
Correct solution is to test, if state is
QDEVICE_NET_INSTANCE_STATE_WAITING_INIT_REPLY.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Heuristics is designed to be component of its own, which doesn't depend
on qdevice_instance. Removing qdevice_instance pointer was easy as soon
as exec notifier got two user data pointers.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Qdevice may crash if server disconnect before connect
heuristics callback is processed.
This is quite hard to reproduce without adding sleep before
qdevice_net_heuristics_exec_after_connect call.
Solution is to check if qdevice is still connected and if it doesn't,
just throw away connect heuristics results.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Previously when heuristics result became PASS it was logged as an error.
It shouldn't be and error message so change it to LOG_NOTICE level.
Signed-off-by: liangxin1300 <XLiang@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>