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>
To match the specification add heartbeat timeout only when requested.
Also add qdevice client method to send option message.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
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>
With default config of running dpd timer every 10 second and waiting for
2 * client_timeout to clear message received flag and then waiting
another 2 * client_timeout without message received it was possible that
client was marked as a dead after more than 40 seconds making qdevice to
stop sending votequorum hearbeat for too long so corosync lost votes
from qdevice.
This patch is simpler solution which just changes default dpd timer to
1 second and timeout to 1.2 * client_timeout.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
When events is set to 0 and set_events return -2 it was changed to -1.
Solution is to check, if return code was 0 and only if so, change return
code to -1 if events is 0.
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>
IPC and TLS sockets are read only, so write callbacks should never
happen (specifically tested in pr-poll-loop test) so remove them.
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>
Instead of copying parts of git-version-gen for spec target use
git-version-gen directly and parse final version into components
(rpmver, alphatag, numcomm) and use them.
Main reason is to simplify code a bit (sed scripts are a bit repetitive
tho), reuse the code and also allow building of RPM from dist tarball
generated from non-tagged commit or dirty git (not very useful).
The code relies on fact, that hyphen is never used in tagged release
name.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@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>