Commit Graph

29 Commits

Author SHA1 Message Date
Fabio M. Di Nitto
8840113704 votequorum: fix variable init
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-02-09 16:49:25 +01:00
Fabio M. Di Nitto
e3ba920307 votequorum: fix possible memory corruption
nodeid = 0 is a valide nodeid and node associated with it should
not be freed

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-02-09 16:49:25 +01:00
Steven Dake
7592e3b61e Remove include/engine/quorum and integrate it into exec/engine.h
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-02-08 08:31:10 -07:00
Fabio M. Di Nitto
cff57430d6 votequorum: fix quorum_ringid setting before any delivery occours
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-02-07 14:07:09 +01:00
Fabio M. Di Nitto
3b77dd9d83 votequorum: fix expected votes manual override from quorumtools
votequorum internal quorum/expected_vote check was slightly too
conservative and was not done correctly when leave_remove feature
is enabled.

this fix allows admins to effectively override expected_votes
and drive ev_barrier as expected.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-02-03 10:33:33 +01:00
Fabio M. Di Nitto
230231fedb votequorum: add runtime internal data to icmap runtime.votequorum.*
specifically ev_barrier, two_node, lowest_node_id and wait_for_all_status
are values that change internally at runtime and keeping track
of those can make debugging rather easy, specially when LOG_DEBUG is not
set.

Also track our node id.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-By: Christine Caulfield <ccaulfie@redhat.com>
2012-02-02 16:36:57 +01:00
Fabio M. Di Nitto
46b7b155a4 votequorum: add leave_remove option
this also cleanup NODESTATE for good. JOINING was never used

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-31 16:58:08 +01:00
Fabio M. Di Nitto
c16086bead votequorum: honor onwire node flags change
internal flags were not propagated correctly in the node status

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-01-31 10:20:32 +01:00
Fabio M. Di Nitto
9fa83dabbe quorum: fix load/unload priority for quorum services
all main services are loaded at priority 1.
vfs_quorum and votequorum did not specify a priority and
automatically defaulting to 0, that has a special meaning
of being loaded last and unloaded last.

this is not correct behavior and limits what votequorum
can do at shutdown, for example notify other nodes that
it is leaving (something that cannot be gathered by
totem membership change callback).

fix vsf_quorum to load at priority 1 as the other
default services and bump votequorum to 2 (needs to
unload before everything else currently known).

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-01-31 10:16:52 +01:00
Fabio M. Di Nitto
fc61b20a8a votequorum: drop unnecessary flags
code inspection shows that those internal flags are never used

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-01-31 10:14:19 +01:00
Steven Dake
007e5c9458 Honor exec_init_fn call
exec_init_fn now either returns NULL (success) or a string which indicates
the error that occured during service engine initialization.  If an error
occurs, corosync will exit.  This patch adds ykd and makes other suggestions
from Fabio Di Nitto.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-30 14:05:09 -07:00
Fabio M. Di Nitto
ccd36af00e votequorum: rename qdisk to qdevice
a quorum device is not necessarely a disk and this also aligns
various names to be generic

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-By: Christine Caulfield <ccaulfie@redhat.com>
2012-01-27 11:17:02 +01:00
Fabio M. Di Nitto
b05477859f votequorum: fix expected_votes propagation
it is not correct to randomly accept expected_votes from any node in
the cluster. We can only allow expected_votes from quorate nodes.

A quorate cluster is "always" right and have the correct expected_votes.

One of the different bug triggers:

quorum {
  expected_votes: 8
  auto_tie_breaker: 1
  last_man_standing: 1
}

start all 8 nodes.
clean shut down 2 nodes.
wait for lms to kick in.
kill 3 nodes with highest nodeid
(we want to retain a quorate partition of 3 nodes)
start one node again -> cluster will be unquorate

This happens because the node rebooting/rejoining with
non current cluster status will propagate an expected_votes of 8,
while in reality the cluster is down to expected_votes: 3.

4 nodes are still < 5 (quorum for 8 nodes/votes).

In order to avoid this condition, we need to exchange expected_votes
information among nodes but we cannot randomly trust everybody.

1) Allow expected_votes to be changed cluster-wide only if the
   information is coming from a quorate node.
2) Fix node->expected_votes based on quorate status
3) allow a joining node to decrease quorum and expected_votes
   if the node is not yet quorate, but it's joining a quorate
   cluster

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-26 14:32:54 +01:00
Fabio M. Di Nitto
88e6830df1 votequorum: fix auto_tie_breaker design and simplify code a lot
auto_tie_breaker requires to know the lowest node id in the currently
quorate partition and not of the whole cluster.

this allow us to determine the lowest node id as soon as we are quorate
and remove the complexity to read it from WFA or nodelist. Add
the same time it adds the flexibility for dynamic nodeids in a cluster.

drop requirement on WFA if nodelist is not specified

update man page

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-26 14:32:54 +01:00
Fabio M. Di Nitto
40aa40ed84 votequorum: drop NODESTATE_LEAVING
this is another leftover from cman compatibility layer

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-26 14:32:54 +01:00
Fabio M. Di Nitto
269e0c4970 votequorum: change quorum.expected_votes override behavior
as agreed on the mailing list, quorum.expected_votes should override
automatically calculated expected_votes from nodelist.

Also simplify the code to handle expected_votes. "silly defaults" is now
unnecessary because votequorum does config sanity checks upfront.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-25 14:06:27 +01:00
Fabio M. Di Nitto
efbf5282f9 votequorum: two_node should enable wait_for_all by default
This avoids fencing races at startup of a cluster.

It is still possible to override WFA by explicitly setting
wait_for_all: 0

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-25 07:04:24 +01:00
Fabio M. Di Nitto
78edc1f24b votequorum: add support for nodelist config bits
expected votes is now calculated automatically and quorum.expected_votes
can be used to override nodelist calculation. The highest of the two
value is used for runtime.

quorum_votes can be specified either in the node list or in quorum.votes.
The node list has priority over global.

propagate votequorum initalization errors (due to config inconsistencies)
back to vsf_quorum.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-01-23 11:46:34 +01:00
Angus Salkeld
3131601ce2 Remove all unneccessary "\n" from log messages
These look ugly, are inconsistently done and just have
to be removed later in libqb before calling syslog.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-23 13:08:23 +11:00
Fabio M. Di Nitto
de2e5be755 votequorum: drop protocol versioning in favour of extra space on the wire
protocol needs to stay compatible across a corosync MAJOR release.
Implementing internal protocol version compat is at best suicidal.

Add extra space to the net struct and we can use flags to determine
feature sets.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-19 14:37:35 +01:00
Fabio M. Di Nitto
2cd6ad9922 votequorum: ifdef qdiskd API out
as agreed, the API has not been tested yet. Adding later is better than
removing it.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-18 14:23:06 +01:00
Fabio M. Di Nitto
9150921ad4 votequorum: be slightly more efficent and consistent
reduce req_exec_quorum_nodeinfo from 40 to 16 bytes (onwire)

add 4 bytes to req_exec_quorum_reconfigure to be consisent
with feature/version checking (onwire data)

make all nodeid definition "unsigned int" instead of some random mix.

reduce size of different vars

remove lots of unnecessary swab due to reducing size of data

drop join_time from cluster_node, it's never used

fix printing of nodeids from random mix to uint for consistency

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-18 13:50:25 +01:00
Fabio M. Di Nitto
74619e9550 quorum: fix votequorum service initialization
the problem is that votequorum was listed as part of default
services.

At service_link_and_init, votequorum library and exec were being
made available, even when votequorum was not in used at all, creating
all kind of problems.

By changing the service_link_and_init to be clever, we restore the
original and wanted behavior to link the service only when required.

This also fixed N*votequorum API calls segfaults, init segfaults
and a few dozen other small issues...

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-17 14:49:55 +01:00
Fabio M. Di Nitto
3bf1ae7718 quorum: integrate votequorum and ykd correctly
the problem is mostly in votequorum here, where votequorum_exec is
initialized with or without votequorum being configured as quorum
provider.

re-establish init order (regression from dropping lcrso) and make
sure we init correctly only the module configured.

ykd changes are for consistency only at this point in time.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-17 12:40:42 +01:00
Fabio M. Di Nitto
1f64773645 votequorum: fix standalone build
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-17 12:40:42 +01:00
Fabio M. Di Nitto
b9af50474e votequorum: check for parameters and return proper error
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-17 12:40:42 +01:00
Steven Dake
5d17eb3c37 Silent a warning from coverity about icmap_track being used without assign
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-16 17:21:20 -07:00
Steven Dake
e423e43bc6 Finish up quorum integration
Signed-off-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Fabio Di Nitto <fdinitto@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-16 09:31:01 -07:00
Steven Dake
f763d3ba4a Initial removal of plugins
Quorum is broken in this patch.
service.h needs to be cleaned up significantly

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-16 09:30:26 -07:00