]> git.proxmox.com Git - mirror_corosync.git/log
mirror_corosync.git
12 years agoquorum: don't leak memory on error
Fabio M. Di Nitto [Tue, 7 Feb 2012 09:20:27 +0000 (10:20 +0100)]
quorum: don't leak memory on error

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agotestvotequorum: fix test loop to break if votequorum goes away
Fabio M. Di Nitto [Tue, 7 Feb 2012 09:11:38 +0000 (10:11 +0100)]
testvotequorum: fix test loop to break if votequorum goes away

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoquorumtool: fix return code
Fabio M. Di Nitto [Tue, 7 Feb 2012 09:08:47 +0000 (10:08 +0100)]
quorumtool: fix return code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agotestquorum: check for quorum_dispatch return code
Fabio M. Di Nitto [Tue, 7 Feb 2012 09:05:07 +0000 (10:05 +0100)]
testquorum: check for quorum_dispatch return code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoquorumtools: check for quorum_dispatch return code
Fabio M. Di Nitto [Tue, 7 Feb 2012 08:53:30 +0000 (09:53 +0100)]
quorumtools: check for quorum_dispatch return code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agospecfile: ship new man pages
Fabio M. Di Nitto [Thu, 9 Feb 2012 12:24:34 +0000 (13:24 +0100)]
specfile: ship new man pages

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoman: add *quorum_track* devel man pages
Fabio M. Di Nitto [Thu, 9 Feb 2012 12:21:13 +0000 (13:21 +0100)]
man: add *quorum_track* devel man pages

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoquorum: drop dead code
Fabio M. Di Nitto [Thu, 9 Feb 2012 12:02:55 +0000 (13:02 +0100)]
quorum: drop dead code

spotted while writing man pages. There are no users for this struct

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoman: add quorum_overview.8 man page
Fabio M. Di Nitto [Thu, 9 Feb 2012 12:01:32 +0000 (13:01 +0100)]
man: add quorum_overview.8 man page

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoman: hook quorum and votequorum devel man pages with genman script
Fabio M. Di Nitto [Thu, 9 Feb 2012 10:01:28 +0000 (11:01 +0100)]
man: hook quorum and votequorum devel man pages with genman script

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoman: rename all devel man pages to .3.in
Fabio M. Di Nitto [Thu, 9 Feb 2012 09:35:38 +0000 (10:35 +0100)]
man: rename all devel man pages to .3.in

tidy up man/Makefile.am a bit in the process

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoman: add build infrastructure to generate devel man pages
Fabio M. Di Nitto [Thu, 9 Feb 2012 09:14:59 +0000 (10:14 +0100)]
man: add build infrastructure to generate devel man pages

this is useful to include ipc_common errors into all man pages

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agomove cs_strerror() to common_lib
Angus Salkeld [Tue, 7 Feb 2012 23:36:11 +0000 (09:36 +1000)]
move cs_strerror() to common_lib

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoTreat ENOBUFS as TRY_AGAIN
Angus Salkeld [Tue, 7 Feb 2012 23:31:22 +0000 (10:31 +1100)]
Treat ENOBUFS as TRY_AGAIN

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agomove hdb_error_to_cs to common_lib
Angus Salkeld [Tue, 7 Feb 2012 23:00:47 +0000 (10:00 +1100)]
move hdb_error_to_cs to common_lib

Note the previous inconsistent implementation.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoAdd a common library that can be shared between libs and corosync
Angus Salkeld [Wed, 8 Feb 2012 23:43:49 +0000 (10:43 +1100)]
Add a common library that can be shared between libs and corosync

We have always had this problem and worked around it by coping code
or using inline functions. Both not good IMO.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoRemove cs_config.h from global header install
Steven Dake [Wed, 8 Feb 2012 14:41:02 +0000 (07:41 -0700)]
Remove cs_config.h from global header install

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoRemove include/engine/quorum and integrate it into exec/engine.h
Steven Dake [Wed, 8 Feb 2012 14:38:38 +0000 (07:38 -0700)]
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>
12 years agoRemove swab.h from global headers
Steven Dake [Wed, 8 Feb 2012 14:17:21 +0000 (07:17 -0700)]
Remove swab.h from global headers

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoRemove list.h from global header install
Steven Dake [Wed, 8 Feb 2012 14:14:53 +0000 (07:14 -0700)]
Remove list.h from global header install

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoRemove mar_gen.h from global header install since it is not needed
Steven Dake [Wed, 8 Feb 2012 14:11:29 +0000 (07:11 -0700)]
Remove mar_gen.h from global header install since it is not needed

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoAdd CS_DISPATCH_ONE_NONBLOCKING dispatch type
Jan Friesse [Wed, 8 Feb 2012 13:57:54 +0000 (14:57 +0100)]
Add CS_DISPATCH_ONE_NONBLOCKING dispatch type

Add missing option for dispatch, which fills gap in combination of
block/nonblock and one/all dispatch types. New type doesn't mask
CS_ERR_TRY_AGAIN, and it means "no message was processed".

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agocorotype: drop deprecated CPG_ defines
Fabio M. Di Nitto [Wed, 8 Feb 2012 10:37:21 +0000 (11:37 +0100)]
corotype: drop deprecated CPG_ defines

the only user of those obsoleted defines is dlm master (already ported)
to use CS_ and cmirror (that needs full porting to new corosync either way).

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agocorotypes: drop deprecated QUORUM_ defines
Fabio M. Di Nitto [Wed, 8 Feb 2012 10:29:20 +0000 (11:29 +0100)]
corotypes: drop deprecated QUORUM_ defines

neither corosync or any of the dependencies use it.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agocorotypes: drop deprecated EVS_ defines
Fabio M. Di Nitto [Wed, 8 Feb 2012 10:25:25 +0000 (11:25 +0100)]
corotypes: drop deprecated EVS_ defines

none of our current dependencies use it.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoFree state variable allocated in wd_resource_state_is_ok
Steven Dake [Mon, 6 Feb 2012 20:08:42 +0000 (13:08 -0700)]
Free state variable allocated in wd_resource_state_is_ok

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoRemove leaked resource error from wd_resource_state_is_ok
Steven Dake [Mon, 6 Feb 2012 19:59:33 +0000 (12:59 -0700)]
Remove leaked resource error from wd_resource_state_is_ok

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoRemove use after free and free of uninit value in mainconfig error path
Steven Dake [Mon, 6 Feb 2012 19:52:50 +0000 (12:52 -0700)]
Remove use after free and free of uninit value in mainconfig error path

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoRemove use after free in corosync_main_config_set in error path
Steven Dake [Mon, 6 Feb 2012 19:51:07 +0000 (12:51 -0700)]
Remove use after free in corosync_main_config_set in error path

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agoRemove dead code in sam test agent
Steven Dake [Mon, 6 Feb 2012 19:35:35 +0000 (12:35 -0700)]
Remove dead code in sam test agent

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agovotequorum: fix quorum_ringid setting before any delivery occours
Fabio M. Di Nitto [Tue, 7 Feb 2012 11:48:00 +0000 (12:48 +0100)]
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>
12 years agoMake sure ipc functions return CS_ERR_TRY_AGAIN and not CS_ERR_TIMEOUT v1.99.2
Angus Salkeld [Tue, 7 Feb 2012 09:21:08 +0000 (20:21 +1100)]
Make sure ipc functions return CS_ERR_TRY_AGAIN and not CS_ERR_TIMEOUT

This is because most applications that use corosync do not test
for TIMEOUT but only for TRY_AGAIN.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-and-Tested-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoRemove deprecated function qb_util_set_log_function()
Angus Salkeld [Mon, 6 Feb 2012 21:29:38 +0000 (08:29 +1100)]
Remove deprecated function qb_util_set_log_function()

Use the standard qb_log api.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoLOG: add libqb as a "subsys"
Angus Salkeld [Mon, 6 Feb 2012 21:26:02 +0000 (08:26 +1100)]
LOG: add libqb as a "subsys"

So we can see libqb internal logs

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agocmap: Check RO flag in adjust int function
Jan Friesse [Mon, 6 Feb 2012 13:31:53 +0000 (14:31 +0100)]
cmap: Check RO flag in adjust int function

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCMAP man pages
Jan Friesse [Tue, 24 Jan 2012 11:32:01 +0000 (12:32 +0100)]
CMAP man pages

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCPG: Send CPG_REASON_PROCDOWN when really needed
Jiaju Zhang [Sun, 5 Feb 2012 17:41:39 +0000 (01:41 +0800)]
CPG: Send CPG_REASON_PROCDOWN when really needed

This patch fixes the issue that in some cases where cpg_finalize()
was called just after cpg_leave() was called, CPG_REASON_PROCDOWN
might also be sent while CPG_REASON_LEAVE had already been sent.
This behavior is not aligned with what the man page has described:
"CPG_REASON_PROCDOWN - the process left a group without calling
cpg_leave()."
And it will confuse CPG's clients in that one process left results
in two different reasons being sent.

The root cause of this issue is cpg_leave() will return after
adding the LEAVE message to the sending queue, but the cpg's group
name has not been cleared yet. Just at that time, cpg_finalize()
is being called, then it determines if there is the calling of
cpg_leave() happened only by the checking of cpg's group name, so
this method is not sufficient.

Signed-off-by: Jiaju Zhang <jjzhang@suse.de>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoquorumtool: fix return codes for show_status and monitor
Fabio M. Di Nitto [Fri, 3 Feb 2012 09:11:36 +0000 (10:11 +0100)]
quorumtool: fix return codes for show_status and monitor

correct return codes should be:
 1 if node is quorate
 0 if node is not quorate
-1 if there is any error gather info on the node

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
12 years agoquorumtools: fix nodes display on status
Fabio M. Di Nitto [Fri, 3 Feb 2012 08:58:01 +0000 (09:58 +0100)]
quorumtools: fix nodes display on status

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
12 years agovotequorum: fix expected votes manual override from quorumtools
Fabio M. Di Nitto [Fri, 3 Feb 2012 08:45:08 +0000 (09:45 +0100)]
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>
12 years agoBetter checks of integer values in coroparse
Jan Friesse [Thu, 2 Feb 2012 15:28:27 +0000 (16:28 +0100)]
Better checks of integer values in coroparse

Instead of atoi, strtol is used. This allows detection of typical
problems like empty value of key and incorrectly entered numbers.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agovotequorum: add runtime internal data to icmap runtime.votequorum.*
Fabio M. Di Nitto [Thu, 2 Feb 2012 08:50:37 +0000 (09:50 +0100)]
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>
12 years agoWait for corosync-notifyd exit in init script
Jan Friesse [Wed, 1 Feb 2012 16:45:35 +0000 (17:45 +0100)]
Wait for corosync-notifyd exit in init script

Without wait for real exit of corosync-notifyd it can happen, that new
corosync-notifyd is killed. To prevent such condition, stop now wait for
process to die, before exit of stop function.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoShow correct error when open of logfile failed
Jan Friesse [Wed, 1 Feb 2012 16:14:22 +0000 (17:14 +0100)]
Show correct error when open of logfile failed

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoStore error str if can't open logfile
Jan Friesse [Wed, 1 Feb 2012 16:13:20 +0000 (17:13 +0100)]
Store error str if can't open logfile

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoIPC: reference count the connection whilst flushing the outq
Angus Salkeld [Thu, 2 Feb 2012 00:34:26 +0000 (11:34 +1100)]
IPC: reference count the connection whilst flushing the outq

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agobuild: fix make dist and make rpm
Fabio M. Di Nitto [Wed, 1 Feb 2012 08:55:49 +0000 (09:55 +0100)]
build: fix make dist and make rpm

do some cleanup around to include all files that need to be shipped
and honor conditional builds properly

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoIPC: allow for failures in the connection_created callback
Angus Salkeld [Tue, 31 Jan 2012 21:50:20 +0000 (08:50 +1100)]
IPC: allow for failures in the connection_created callback

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agovotequorum: add leave_remove option
Fabio M. Di Nitto [Tue, 31 Jan 2012 15:31:24 +0000 (16:31 +0100)]
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>
12 years agovotequorum: honor onwire node flags change v1.99.1
Fabio M. Di Nitto [Tue, 31 Jan 2012 08:48:24 +0000 (09:48 +0100)]
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>
12 years agoquorum: fix load/unload priority for quorum services
Fabio M. Di Nitto [Tue, 31 Jan 2012 08:45:21 +0000 (09:45 +0100)]
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>
12 years agoservice: fix service unload regression introduced by lcrso dropping
Fabio M. Di Nitto [Tue, 31 Jan 2012 08:42:17 +0000 (09:42 +0100)]
service: fix service unload regression introduced by lcrso dropping

service exec_exit_fn was not honored because the loop was looking
into the wrong icmap key

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agovotequorum: fix possible string overflow (-1) in qdevice_register
Fabio M. Di Nitto [Mon, 30 Jan 2012 15:51:53 +0000 (16:51 +0100)]
votequorum: fix possible string overflow (-1) in qdevice_register

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agovotequorum: drop unnecessary flags
Fabio M. Di Nitto [Mon, 30 Jan 2012 15:45:56 +0000 (16:45 +0100)]
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>
12 years agoCTS: cleanup the cpg test agent
Angus Salkeld [Mon, 30 Jan 2012 02:32:46 +0000 (13:32 +1100)]
CTS: cleanup the cpg test agent

improve the diagnostic log messages

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: make the systemd logic more reliable
Angus Salkeld [Tue, 31 Jan 2012 00:47:25 +0000 (11:47 +1100)]
CTS: make the systemd logic more reliable

rely on positive logic as there can be multiple
failure reasons.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoHonor exec_init_fn call
Steven Dake [Mon, 30 Jan 2012 17:29:09 +0000 (10:29 -0700)]
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>
12 years agoReturn an exit code of 1 if an interface is faulty in corosync-cfgtool
Steven Dake [Wed, 25 Jan 2012 15:43:56 +0000 (08:43 -0700)]
Return an exit code of 1 if an interface is faulty in corosync-cfgtool

Signed-off-by: Oren Nechustan <theoren28@hotmail.com>
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
12 years agocmap: add iterator finalize
Angus Salkeld [Mon, 30 Jan 2012 01:30:38 +0000 (12:30 +1100)]
cmap: add iterator finalize

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agocmap: add -D option to getopt
Angus Salkeld [Mon, 30 Jan 2012 01:29:59 +0000 (12:29 +1100)]
cmap: add -D option to getopt

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agovotequorum: rename qdisk to qdevice
Fabio M. Di Nitto [Fri, 27 Jan 2012 09:47:50 +0000 (10:47 +0100)]
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>
12 years agoquorum: drop quorum.quorate config option
Fabio M. Di Nitto [Fri, 27 Jan 2012 08:21:57 +0000 (09:21 +0100)]
quorum: drop quorum.quorate config option

it's unused / unnecessary

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-By: Christine Caulfield <ccaulfie@redhat.com>
12 years agoCTS: add test VoteQuorumWaitForAll
Angus Salkeld [Fri, 27 Jan 2012 06:49:41 +0000 (17:49 +1100)]
CTS: add test VoteQuorumWaitForAll

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: remove test service config
Angus Salkeld [Fri, 27 Jan 2012 04:15:27 +0000 (15:15 +1100)]
CTS: remove test service config

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoaugeas: update the lense (rm amf & add update quorum options)
Angus Salkeld [Fri, 27 Jan 2012 03:45:15 +0000 (14:45 +1100)]
augeas: update the lense (rm amf & add update quorum options)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: be consistent with the cpg group name
Angus Salkeld [Fri, 27 Jan 2012 02:50:48 +0000 (13:50 +1100)]
CTS: be consistent with the cpg group name

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: make the status command more accurate
Angus Salkeld [Fri, 27 Jan 2012 02:49:56 +0000 (13:49 +1100)]
CTS: make the status command more accurate

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: remove SamTestQuorum as there is not test_quorum anymore
Angus Salkeld [Fri, 27 Jan 2012 02:49:10 +0000 (13:49 +1100)]
CTS: remove SamTestQuorum as there is not test_quorum anymore

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: ignore blackbox shm
Angus Salkeld [Fri, 27 Jan 2012 00:27:10 +0000 (11:27 +1100)]
CTS: ignore blackbox shm

(only whilst running as it is still visable)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: delete resourses recursively
Angus Salkeld [Thu, 26 Jan 2012 22:10:22 +0000 (09:10 +1100)]
CTS: delete resourses recursively

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: init votequorum by default
Angus Salkeld [Fri, 27 Jan 2012 06:46:11 +0000 (17:46 +1100)]
CTS: init votequorum by default

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoCTS: account for change in sam resource path.
Angus Salkeld [Wed, 25 Jan 2012 06:33:12 +0000 (17:33 +1100)]
CTS: account for change in sam resource path.

This was:
process_name:pid
now:
pid

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCTS: handle socket exceptions better
Angus Salkeld [Tue, 24 Jan 2012 23:56:26 +0000 (10:56 +1100)]
CTS: handle socket exceptions better

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCTS: fix shell script variable name
Angus Salkeld [Tue, 24 Jan 2012 23:55:35 +0000 (10:55 +1100)]
CTS: fix shell script variable name

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoupdate TODO list
Fabio M. Di Nitto [Thu, 26 Jan 2012 13:26:34 +0000 (14:26 +0100)]
update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
12 years agovotequorum: fix expected_votes propagation
Fabio M. Di Nitto [Thu, 26 Jan 2012 12:14:26 +0000 (13:14 +0100)]
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>
12 years agovotequorum: fix auto_tie_breaker design and simplify code a lot
Fabio M. Di Nitto [Thu, 26 Jan 2012 11:22:47 +0000 (12:22 +0100)]
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>
12 years agovotequorum: drop NODESTATE_LEAVING
Fabio M. Di Nitto [Thu, 26 Jan 2012 10:17:10 +0000 (11:17 +0100)]
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>
12 years agoupdate TODO list
Fabio M. Di Nitto [Wed, 25 Jan 2012 12:16:07 +0000 (13:16 +0100)]
update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
12 years agovotequorum: add documentation and man pages
Fabio M. Di Nitto [Wed, 25 Jan 2012 12:15:00 +0000 (13:15 +0100)]
votequorum: add documentation and man pages

fix a few typos on the way and separate config / library bits

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
12 years agovotequorum: change quorum.expected_votes override behavior
Fabio M. Di Nitto [Wed, 25 Jan 2012 11:08:47 +0000 (12:08 +0100)]
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>
12 years agovotequorum: two_node should enable wait_for_all by default
Fabio M. Di Nitto [Wed, 25 Jan 2012 05:55:29 +0000 (06:55 +0100)]
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>
12 years agoCTS: make basic tests config-generic
Angus Salkeld [Tue, 24 Jan 2012 13:00:19 +0000 (00:00 +1100)]
CTS: make basic tests config-generic

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCTS: fix starting/stopping of test_agents
Angus Salkeld [Tue, 24 Jan 2012 12:20:39 +0000 (23:20 +1100)]
CTS: fix starting/stopping of test_agents

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCTS: tidy up the shutdown of cpg_test_agent
Angus Salkeld [Mon, 23 Jan 2012 02:51:32 +0000 (13:51 +1100)]
CTS: tidy up the shutdown of cpg_test_agent

it is not neccessary to close the fd and remove it
from the mainloop

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCTS: temp comment out quorum tests
Angus Salkeld [Tue, 24 Jan 2012 12:57:31 +0000 (23:57 +1100)]
CTS: temp comment out quorum tests

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCTS: fix quourm command
Angus Salkeld [Tue, 24 Jan 2012 12:21:04 +0000 (23:21 +1100)]
CTS: fix quourm command

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoCTS: fix up the formt strings
Angus Salkeld [Mon, 23 Jan 2012 04:19:31 +0000 (15:19 +1100)]
CTS: fix up the formt strings

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoAdd debug log messages to corosync for join/leave
Angus Salkeld [Tue, 24 Jan 2012 12:54:17 +0000 (23:54 +1100)]
Add debug log messages to corosync for join/leave

This is needed by cts.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agoLOG: make sure that debug works to syslog
Angus Salkeld [Mon, 23 Jan 2012 05:51:55 +0000 (16:51 +1100)]
LOG: make sure that debug works to syslog

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agototemiba: Remove unused wthread.h include
Jan Friesse [Tue, 24 Jan 2012 12:38:47 +0000 (13:38 +0100)]
totemiba: Remove unused wthread.h include

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoMake xmlconf in SPEC conditional
Jan Friesse [Tue, 24 Jan 2012 12:33:48 +0000 (13:33 +0100)]
Make xmlconf in SPEC conditional

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoChange the last references from objctl to cmapctl v1.99.0
Angus Salkeld [Mon, 23 Jan 2012 22:46:40 +0000 (09:46 +1100)]
Change the last references from objctl to cmapctl

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12 years agoUpdate TODO list
Fabio M. Di Nitto [Mon, 23 Jan 2012 10:12:28 +0000 (11:12 +0100)]
Update TODO list

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
12 years agovotequorum: add support for nodelist config bits
Fabio M. Di Nitto [Mon, 23 Jan 2012 10:06:47 +0000 (11:06 +0100)]
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>
12 years agoRemove all unneccessary "\n" from log messages
Angus Salkeld [Mon, 23 Jan 2012 01:31:59 +0000 (12:31 +1100)]
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>
12 years agoShorten some really long lines in main.c
Angus Salkeld [Mon, 23 Jan 2012 01:02:55 +0000 (12:02 +1100)]
Shorten some really long lines in main.c

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agocmap: add a delete with prefix (needed by cts)
Angus Salkeld [Mon, 23 Jan 2012 00:35:23 +0000 (11:35 +1100)]
cmap: add a delete with prefix (needed by cts)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agocmap: change -t and -T around (capital == with prefix)
Angus Salkeld [Mon, 23 Jan 2012 00:32:22 +0000 (11:32 +1100)]
cmap: change -t and -T around (capital == with prefix)

I want to add a prefic delete option and then these will
not be consistent.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
12 years agocmap: tweek the usage text
Angus Salkeld [Mon, 23 Jan 2012 00:29:46 +0000 (11:29 +1100)]
cmap: tweek the usage text

1) It wasn't obvious to me what -b did
2) -a has been removed

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>