Commit Graph

28 Commits

Author SHA1 Message Date
Jan Friesse
f31a31f91a cmap: Assert copied string length
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-11-28 09:44:44 +01:00
Jan Friesse
5731af2782 logging: Add CS_PRI_NODE_ID and CS_PRI_RING_ID
Previously node id was logged ether as a %d (most often), %u, %x or
PRI.32 and ring id ether as %lld, %llx with various separators (., :, /)
between rep nodeid and seq. This seems to cause confusion.

This patch adds macros CS_PRI_NODE_ID, CS_PRI_RING_ID and
CS_PRI_RING_ID_SEQ (CS prefix = corosync, PRI modeled in spirit of
inttypes.h PRIx32) and makes code use them.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-07-03 10:53:52 +02:00
Jan Friesse
db7eebf817 stats: Fix delete of track
When cmap_track_delete was called to stats map (cmap created with
CMAP_MAP_STATS parameter) result was always ERR_BAD_HANDLE.

It turned out that corosync part of cmap is always calling icmap
function to get user data (where required hdb handle is stored)
instead of generalized map_fns.

After fixing this issue, valgrind showed error about jump depending on
unitialized data in stats_map_track_delete. Solution seems to be always
initialize tracker->events (so not only when track_type is add or
delete).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2018-11-16 11:47:22 +01:00
Jan Friesse
165d748c04 cmap: Remove noop highest config version check
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2017-10-11 17:11:33 +02:00
Jonathan Davies
2d0e8114ba cmap: don't shutdown highest config_version node
Scenario:
 1. node A starts corosync with config_version = 2, nodelist = {A, B}
 2. node B starts corosync with config_version = 1, nodelist = {A, B}

corosync.conf(5) says the config_version option is "used to prevent
joining old nodes with not up-to-date configuration."

So expected outcome is:
 * corosync on node A remains alive
 * corosync on node B exits

Actual outcome is:
 * corosync on node A exits
 * corosync on node B exits

Explanation of actual behaviour:
 * Host A will have cmap_my_config_version = 2 but
   cmap_highest_config_version_received = 1, so will shutdown in
   cmap_sync_activate because these are not equal.
 * Host B will have cmap_my_config_version = 1 but
   cmap_highest_config_version_received = 2, so will shutdown in
   cmap_sync_activate because these are not equal.

Instead, node A should consider its own config_version in the
calculation of the highest config_version, i.e.
cmap_highest_config_version_received = 2, and so not shutdown
in cmap_sync_activate.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2017-10-11 17:07:35 +02:00
Christine Caulfield
55c3dcb76d stats: Add map with on-demand statistics
Icmap is factored out so it's possible to add other
maps for cmap. API call to switch maps from application
end is added.

Corosync-cmapctl is enhanced with -m option.

Stats contains all statistics previously found in runtime.connections,
runtime.services and runtime.totem prefixes together with new knet
related. All stats are read only.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2017-07-27 15:53:04 +02:00
Takeshi MIZUTA
4939c75629 Remove redundant header file inclusion
Signed-off-by: Takeshi MIZUTA <miz.take4@gmail.com>
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2016-12-05 09:59:08 +01:00
Michael Jones
b4c06e52f3 list: Replace uses of list.h with qblist.h
Signed-off-by: Michael Jones <jonesmz@jonesmz.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2016-10-27 14:56:52 +02:00
Jan Friesse
1925074909 Fix few bugs found by coverity
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:43 +02:00
Christine Caulfield
3b8365e806 config: Fix typos
Fix several places where 'then' is used instead of 'than' in error
messages and a comment.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2014-07-24 10:27:45 +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
903e02875d Initialize item in cmap_mcast_send
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2013-06-13 10:53:56 +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
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
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
Angus Salkeld
023c4fa0cc Move hdb_error_to_cs to corotypes.h
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-02-14 11:10:14 +11: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
Jan Friesse
546aea23cf cmap: Check RO flag in adjust int function
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-02-06 16:37:00 +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
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
Steven Dake
e0f4757385 Silent a warning from coverity about handle being used without assign
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-16 17:21:56 -07:00
Steven Dake
aa879567bc 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:49 -07:00
Steven Dake
f431f6d46f Silent a coverity warning about handle being unset (when it really is)
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-16 17:21:34 -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