Commit Graph

336 Commits

Author SHA1 Message Date
Jan Friesse
45dd9861ff Properly check result of symlink
Error message is displayed when it's impossible to create symlink to
fdata file.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2014-01-14 11:24:31 +01:00
Jan Friesse
5c54f941ac Fix cppchecks warning
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2014-01-14 11:24:29 +01:00
Jan Friesse
178c0d82d9 Close devnull file handler
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2014-01-14 11:24:26 +01:00
Jan Friesse
b88c0766fe logsys: Make logging of totem work again
Because of change in libqb (9abb686) logging of TOTEM subsystem stopped
working.

Instead of rely on previous behavior (implicit substring match), all
totem files are now explicitly given.

Also QB subsystem now uses comma separated filelist instead of previous
function calling.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2013-11-04 12:32:35 +01:00
Christine Caulfield
bc47c583bd Reload: Make coroparse use a designated icmap hash table
Pass an icmap hashtable into coroparse so we can load it into
a temporary one during reload

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2013-09-12 16:09:06 +01:00
Christine Caulfield
8567887abb [PATCH] Replace freopen with open/dup2 when daemonizing
This patch replaces the existing freopen method of
forcing stdin/out/err to /dev/null with the more
usual system of open/dup2.

While I don't like posting patches I don't fully understand,
this patch seems to fix a problem where stdout/err get
assigned to a socket causing double logging output
on systemd.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2013-09-10 15:33:31 +01:00
Christine Caulfield
3663622576 Add log message to exit signal handler
I've seen a few instances where corosync has shut down for
apparently 'no reason'. In fact most of the time the shutdown
has been caused by an external source (often an init script)
but it's not been obvious what has happened and people
implicate the deamon

This patch simply adds a log message to the signal handler
when it is called so that the cause of the shutdown is obvious.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2013-09-03 14:04:50 +01:00
Michael Chapman
2740cfd1ea Fix scheduler pause-detection timeout
qb_loop_timer_add expects the timeout to be in nanoseconds, but we were
passing the value in milliseconds. Scale the timeout appropriately.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2013-08-19 09:03:24 +02:00
Jan Friesse
615d7592fb Log: Output parse errors to syslog
When corosync was started in daemon mode and there was parse error, no
way existed how to find out what happened (this is usual situation with
systemd enabled systems). Solution seems to be output to syslog by
default.

Also redundant line with setting logsys is removed because it's no
longer needed, because FORK and THREADED mode options has no longer
effect. FORK is handled by libqb by default and THREADED mode is forced
by calling logsys_thread_start.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2013-06-21 11:21:42 +02:00
Jan Friesse
8429d01389 Detect big scheduling pauses
Add poll timer scheduler to be called 3 times per token timeout.
If poll timer was not called for more then 0.8 * token timeout, it means
corosync process was not scheduled and ether token_timeout should be
increased or load should be reduced (useful for VM, where host is
overcommitted so VM is not scheduled as expected).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2013-04-08 09:58:42 +02:00
Kazunori INOUE
1ad21e384e log: move Corosync started log messages
"Corosync Cluster Engine ... started" message is shown after
logsys is full configured.

Signed-off-by: Kazunori INOUE <inouekazu@intellilink.co.jp>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2013-01-14 11:52:26 +01:00
Fabio M. Di Nitto
ed6bca3293 crypto: drop < 2.3 protocols and onwire compat
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2013-01-14 11:49:32 +01:00
Jan Friesse
6127be1806 Move qb_loop creation after daemonization
Creating qb_loop before daemonization is not problem for poll or epoll
type loops, but it's problem for kqueue, because kqueue is not shared
in child with parent after fork.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-12-12 11:47:42 +01:00
Jan Friesse
dd588d004e Add option to specify ip version
Default is ipv4.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-12-03 14:02:32 +01:00
Steven Dake
402638929e Fix problem with sync operations under very rare circumstances
This patch creates a special message queue for synchronization messages.
This prevents a situation in which messages are queued in the
new_message_queue but have not yet been originated from corrupting the
synchronization process.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-11-22 11:47:57 +01:00
Fabio M. Di Nitto
220d659b38 totemcrypto: implement crypto packet format 2.2 and crypto_compat: config opt
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-11-22 11:13:30 +01:00
Jan Friesse
3cd4f9a1f5 Add support for selecting IPC type
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-11-08 12:16:11 +01: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
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
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
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
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
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
9fb7979370 Introduce SERVICES_COUNT_MAX macro
Sync/service was using maximal number of services in ehter numberic form
(magic constant) or inconsistently, this means using
SERVICE_HANDLER_MAXIMUM_COUNT which means maximal number of handlers.

New macro solves this.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-08-02 09:32:05 +02:00
Jan Friesse
2766e57ce5 Store fdata with timestamp and pid in name
This should allow easier handling of various blackbox dumps. Original
fdata name is now symlink to latest created dump.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-06-05 12:19:42 +02:00
Fabio M. Di Nitto
f008cf442c rename mainconfig to logconfig
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-05-29 09:36:00 +02:00
Fabio M. Di Nitto
1dcb2d43d9 icmap: fix a valgrind errors (pass 1)
clean up a lot of allocated blocks at exit.
those changes has no runtime effects, but it makes valgrind
output a bit more useful by dropping over 700 errors/warnings to skip
over every single run.

there are still a few icmap related valgrind errors but those need
some more complex and timeconsuming investigation.

pre patch:

==21844== HEAP SUMMARY:
==21844==     in use at exit: 1,229,321 bytes in 1,516 blocks
==21844==   total heap usage: 7,191 allocs, 5,675 frees, 3,819,853 bytes allocated

==21844== LEAK SUMMARY:
==21844==    definitely lost: 3,617 bytes in 11 blocks
==21844==    indirectly lost: 21,960 bytes in 11 blocks
==21844==      possibly lost: 1,080,101 bytes in 131 blocks
==21844==    still reachable: 123,643 bytes in 1,363 blocks
==21844==         suppressed: 0 bytes in 0 blocks

==21844== ERROR SUMMARY: 136 errors from 136 contexts (suppressed: 0 from 0)

post patch:

==25793== HEAP SUMMARY:
==25793==     in use at exit: 1,185,870 bytes in 808 blocks
==25793==   total heap usage: 9,427 allocs, 8,619 frees, 4,156,841 bytes allocated

==25793== LEAK SUMMARY:
==25793==    definitely lost: 3,697 bytes in 12 blocks
==25793==    indirectly lost: 22,248 bytes in 13 blocks
==25793==      possibly lost: 1,079,655 bytes in 113 blocks
==25793==    still reachable: 80,270 bytes in 670 blocks
==25793==         suppressed: 0 bytes in 0 blocks

==25793== ERROR SUMMARY: 119 errors from 119 contexts (suppressed: 0 from 0)

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-04-24 09:28:23 +02:00
Fabio M. Di Nitto
b34c1e2870 ipcs: allow connections only after all services are ready
this fixes a rather annoying race condition at startup where a client
connects to corosync "too fast" before the service is ready to operate
and client gets some random data during initialization phase.

With this fix, we allow connections to ipc only after the main engine
is operational and configured (and after the first totem transition).

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-16 13:39:03 +02:00
Jan Friesse
7a0a39b949 Mark few more icmap keys as read only
Also most of the key settings are now centralized in one function, so
it's easier to audit.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-03-16 09:37:25 +01:00
Fabio M. Di Nitto
e0e27e3d12 utils: cleanup main daemon exit codes
some of them are not in use anymore and can be dropped.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-03-09 11:15:44 +01:00
Fabio M. Di Nitto
8f6e5ff530 sync: kill evil and syncv1 in one shot
this change breaks onwire compatibility.

cpg is the only user of sync_* interface and it's the only
service that will require extra testing.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-03-09 11:15:08 +01:00
Jan Friesse
c30c088597 Tweak nodeid warning
Nodeid warning now appears only when both totem.nodeid and nodelist
nodeid exists. When nodelist nodeid is not defined, totem.nodeid is
used.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-02-21 16:33:56 +01:00
Steven Dake
2ad0cdc832 Update copyright header dates in exec directory
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-13 17:05:04 -07:00
Angus Salkeld
14fd1c927a 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>
2012-01-25 11:33:09 +11: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
Angus Salkeld
61c0995e1c Shorten some really long lines in main.c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-23 13:08:23 +11:00
Jan Friesse
d6cbdd9b84 Support for dynamic nodelist udpu member change
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-20 11:08:35 +01:00
Jan Friesse
16007acbef Use nodeid provided in nodelist
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-20 11:08:35 +01:00
Jan Friesse
de70c0007c Support udpu members in nodelist
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-20 11:08:35 +01:00
Fabio M. Di Nitto
b713a68a40 main: drop unrequired vars
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
98bba25cd0 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:04 -07:00
Steven Dake
0d675a3496 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:20:56 -07:00
Steven Dake
ef1febd03c Remove main_get_config_modules since it is no longer needed
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-16 09:31:25 -07:00
Steven Dake
bb849be586 Get rid of external config loader in include/engine/config.h
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-16 09:30:50 -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
Jan Friesse
848f24d903 Use fast inc for service statistics
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-13 11:13:43 +01:00
Fabio M. Di Nitto
8128cfbaf1 main: drop unrequired call to totem_get_stats
and shut up another gcc warning

Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-01-13 09:01:40 +01:00
Steven Dake
7e1c9771f2 unshare exec/icmap.so
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-12 07:29:41 -07:00
Steven Dake
7c8e83ac34 Change all ais references to corosync
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-12 07:29:15 -07:00