Commit Graph

1667 Commits

Author SHA1 Message Date
Jan Friesse
fc50443f5f Make totemiba compile again
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2012-10-08 17:44:09 +02:00
Jan Friesse
b7635ab9f7 Return back "Totem is unable to form..." message
This patch returns back SUBJ functionality. It rely on fact, that
sendmsg will return error, and if such error is returned for long time,
it's probably because of firewall.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-08 16:53:35 +02:00
Jan Friesse
d042671369 Move "Totem is unable to form..." message to main
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-08 16:53:33 +02:00
Jan Friesse
6c3b337b37 Use unix socket for local multicast loop
Instead of rely on multicast loop functionality of kernel, we now use
unix socket created by socketpair to deliver multicast messages to
local node. This handles problems with improperly configured local
firewall. So if output/input to/from ethernet interface is blocked, node
is still able to create single node membership.

Dark side of the patch is fact, that membership is always created, so
"Totem is unable to form a cluster..." will never appear (same applies
to continuous_gather key).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-08 16:53:30 +02:00
Jan Friesse
4354ed6ecb Store config_version of other nodes
Config version of other nodes is stored in
runtime.totem.pg.mrp.srp.members.NODEID.config_version key. Also when
local config_version is changed, all nodes are informed.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-03 11:26:35 +02:00
Jan Friesse
d2a85593c4 Support for check of config version on start
Config version is requested from other nodes. If our config version is
not 0 and differes from highest config version of other nodes, corosync
quits.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-02 16:04:32 +02:00
Jan Friesse
73b0fe688d Make cmap_mcast_send return correct error code
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-02 16:04:28 +02:00
Jan Friesse
a273be58ae Make service_build contain correct number of msgs
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-02 16:04:24 +02:00
Jan Friesse
3c019f2130 Align items in cmap_mcast_send
Aligning function (kernel style magic) MAR_ALIGN_UP is used for
aligning of items in req_exec_cmap_mcast message.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-02 16:04:20 +02:00
Jan Friesse
2214a60639 Support for flt and dbl in mcast_endian_convert
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-02 16:04:17 +02:00
Jan Friesse
cbaa2977ae Add support for sending cmap values to wire
Function is little more complex, but it is designed to be used in future
without big changes.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-02 16:04:07 +02:00
Jan Friesse
6825c1d39b Parse config_version as 64-bit uint
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-10-02 16:04:02 +02:00
Jan Friesse
373ded0652 Don't access invalid mem in totemconfig interfaces
When ringnumber in config file was set to value bigger or equal to
INTERFACE_MAX, we are using this big value as index to totemconfig
interfaces array, resulting to access to invalid memory and segfault.

Instead of that, ringnumber is now checked and proper error message is
printed if value is too big.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-09-27 13:54:39 +02:00
Jan Friesse
5ce59f49ba Move some totem and cpg messages to trace level
Messages which are flow messages, rather then lifecycle are now logged
in trace level.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-09-19 11:03:16 +02:00
Jan Friesse
5717655019 Add support for debug level trace in config file
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-09-19 11:03:10 +02:00
Fabio M. Di Nitto
8a2e936381 icmap: fix mapping return codes
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-12 08:18:50 +02:00
Fabio M. Di Nitto
bb5946babb build: clean AM_CFLAGS and AM_CPPFLAGS usage around
also set commont include dirs.

fPIC and DPIC are automatically detected and added
as required by libtool. We don't need to carry it around.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-09-07 09:04:07 +02:00
Fabio M. Di Nitto
fa92e4068a totemconfig: drop unnecessary includes
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-09-07 09:04:06 +02:00
Jan Friesse
7fe307383f Remove newline in logsys_config_file_set_unlocked
Also remove commented leftover.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-09-06 09:39:18 +02:00
Jan Friesse
bd30fe3dcd Make threaded log work
Previous two log releated patches tried to solve few problems with
threaded libqb, but introduced regressions when running in daemon mode.

This patch takes bigger hammer and hopefully solves all problems.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-09-06 09:39:15 +02:00
Jan Friesse
bd138085ca Ensure qb_log thread is started
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-09-05 09:10:57 +02:00
Jan Friesse
7026fffdf9 Ensure no garbage left in msghdr for sendmsg call
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-09-03 09:34:37 +02:00
Jan Friesse
120b7fac7b Use uint8_t in setsockopt when needed
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-09-03 09:34:35 +02:00
Jan Friesse
ee59122ad7 OpenBSD getifaddrs returns netmask without sa_family
So we relax netmask check and set to same family as ipaddr
if needed

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-09-03 09:34:33 +02:00
Jan Friesse
932829bfca Add header files when needed
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-09-03 09:34:31 +02:00
Angus Salkeld
0e86aa4ac6 Fix cpg_membership_get()
The wrong size was getting set in exec/cpg.c

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-31 14:48:35 +10:00
Fabio M. Di Nitto
6d28d51284 build: bring SOLARIS up to the same standard as other OSes
drop all SOLARIS specific ifdefs and replace them with feature checks

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-30 15:00:27 +02:00
Fabio M. Di Nitto
a0a14c68e3 totemip: clean up headers a lot more
getifaddrs is always available if there is freeifaddr.

all BSD and openindiana have it defined in ifaddr.h.

drop a bunch of obsoleted headers.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-30 15:00:27 +02:00
Fabio M. Di Nitto
18929089d1 build: drop MAP_ANONYMOUS check from configure
define it only in case it's not there

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-30 15:00:27 +02:00
Fabio M. Di Nitto
5c5db34e56 build: make libstatgrab the facto default for monitoring service
drop duplicate code and remove the last COROSYNC_LINUX ifdefs
around

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-30 15:00:27 +02:00
Fabio M. Di Nitto
a1c154e6fa build: use MADV_NOSYNC only when it's defined
so far only FreeBSD defines it.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-30 15:00:27 +02:00
Fabio M. Di Nitto
6098ef2c14 build: make exec/totemip os detection free
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-30 15:00:27 +02:00
Jan Friesse
dbe0e9e382 Log: Use threaded mode for syslog and file log
Syslog and file log can block, so it's good idea to use libqb threaded
mode to prevent it.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-30 09:46:48 +02:00
Jan Friesse
9f6e6a990b Use native IPC mechanism
Instead of hardcoded SHM, we should use NATIVE, so libqb is able to find
out what is best/availiable mechanism.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-30 09:45:46 +02:00
Fabio M. Di Nitto
427fdd4558 build: fix build on openindiana 151a
openindiana toolchain is rather messy. This is the first cut only

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-28 15:14:49 +02:00
Fabio M. Di Nitto
9f7181b533 build: drop more dlopen leftovers from dinosaur era...
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-28 15:14:49 +02:00
Fabio M. Di Nitto
dd4d7f86e6 build: make monitoring optional in corosync exec
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-28 15:14:49 +02:00
Fabio M. Di Nitto
8f96347100 build: respect watchdog conditional when building corosync exec
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-28 15:14:49 +02:00
Fabio M. Di Nitto
76d18f964d build: use libtool for linking
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-28 15:14:48 +02:00
Tim Beale
6129ce5b59 Remove redundant default-config code
We were checking 'hold_timeout == 0' in 3 different places when setting up
the default totem config.

Signed-off-by: Tim Beale <tlbeale@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-21 14:26:50 +02:00
Tim Beale
77ea036c72 Remove unused structure
Nowhere in the corosync codebase references this structure.

Signed-off-by: Tim Beale <tlbeale@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-21 14:11:48 +02:00
Jan Friesse
397cc89f01 Make logging of WD and MON service correct
MON and WD services are using fsm.h, which calls log function. Such
messages were incorrectly logged as SERV (or random service) which made
debugging hard.

Solution is to add callback parameter to fsm functions and do actual
logging there.

Handling of failure states is also done in calback now.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-16 14:45:15 +02:00
Jan Friesse
e3cef955bf IPC: Call lib function only when it's possible
send_ok was incorrectly tested as boolean, even it's errno type
variable.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-09 15:10:52 +02:00
Jan Friesse
8014b2facf Close sockets after deleting from poll
This will remove (non critical) debug message from QB about polling on
closed FD.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-09 15:10:44 +02:00
Jan Friesse
2d10e2bbea cpg: Check input param name_t length
IPC is using buffer of CS_MAX_NAME_LENGTH for name. If user calls
function with longer string, such string can be passed to service
incomplete.

Solution is to not allow string larger then CS_MAX_NAME_LENGTH
and return error.

Same applies to cpg service.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-09 15:10:35 +02:00
Jan Friesse
6f6988afff Handle sync and service unload correctly
When sync started and service is unloaded in meantime, it can happen that
sync will call sync_* functions on unloaded service.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-09 15:10:26 +02:00
Jan Friesse
dfe34d330c service: remove leftovers from mt corosync
Multithreaded corosync used to use many ugly workarounds. One of them is
shutdown process, where we had to solve problem with two locks. This was
solved by scheduling jobs between service exit_fn call and actual
service unload. Sadly this can cause to receive message from other node
in that meantime causing corosync to segfault on exit.

Because corosync is now single threaded, we don't need such hacks any
longer.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-09 15:10:16 +02:00
Fabio M. Di Nitto
423e37b4ca votequorum: change init/clean up to deal with exit races
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-08 09:03:57 +02:00
Fabio M. Di Nitto
50308cb08d quorumtool: make output more meaningful
there is really no point to have a per node view of (vote)quorum
since all the info are always there.

drop the -n option for status/display nodes and improve
the output to provide a full cluster view at any given time.

Old format:

[root@fedora-master-node2 ~]# corosync-quorumtool -s
Quorum information
------------------
Date: Mon Aug 6 10:22:27 2012
Quorum provider: corosync_votequorum
Nodes: 2
Ring ID: 8
Quorate: Yes

Votequorum information
----------------------
Node ID: 3254954176
Node state: Member
Node votes: 1
Qdevice votes: 1
Expected votes: 3
Highest expected: 3
Total votes: 3
Quorum: 2
Flags: Quorate Qdevice

Membership information
----------------------
Nodeid Votes Name
3238176960 1 fedora-master-node1.int.fabbione.net
3254954176 1 fedora-master-node2.int.fabbione.net
         0 1 QDEVICE (Alive/Voting/NoMasterWins)

New format:

[root@fedora-master-node1 tools]# ./corosync-quorumtool -s
Quorum information
------------------
Date:             Mon Aug  6 15:50:03 2012
Quorum provider:  corosync_votequorum
Nodes:            2
Ring ID:          48
Quorate:          Yes

Votequorum information
----------------------
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2
Flags:            Quorate Qdevice

Membership information
----------------------
    Nodeid      Votes    Qdevice Name
3238176960          1     A,V,MW fedora-master-node1.int.fabbione.net
3254954176          1         NR fedora-master-node2.int.fabbione.net
         0          1            QDEVICE

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-07 11:07:17 +02:00
Fabio M. Di Nitto
6b270c6cd1 votequorum: make the last QDEVICE define name consistent with everything else
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-08-07 11:07:17 +02:00