]> git.proxmox.com Git - mirror_corosync.git/log
mirror_corosync.git
6 years agocts: Make code compatible with Python 3
Bin Liu [Thu, 4 Jan 2018 03:12:41 +0000 (11:12 +0800)]
cts: Make code compatible with Python 3

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocorosync-notifyd: make SNMP work again
Bin Liu [Tue, 5 Dec 2017 05:47:40 +0000 (13:47 +0800)]
corosync-notifyd: make SNMP work again

rrp_faulty_fn in notify_callbacks no longer exists, and now become
link_faulty_fn, and also link_faulty_fn needs 5 arguments while
rrp_faulty_fn needs 4.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agobuild: Add the headers necessary for RPM build
yuskiida [Thu, 11 Jan 2018 08:27:31 +0000 (17:27 +0900)]
build: Add the headers necessary for RPM build

Signed-off-by: yuskiida <yusk.iida@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoconfig: if local node addr is wrong, fail with a sensible message
Christine Caulfield [Mon, 8 Jan 2018 11:05:46 +0000 (11:05 +0000)]
config: if local node addr is wrong, fail with a sensible message

If no valid local address is found in corosync.conf then corosync
exits with: "parse error in config: No multicast port specified"

This is because of the config change for knet that always populates
the interfaces. The old error of "no interfaces found" was only
slightly better anyway IMHO.

This patch adds an explicit check that local_node_pos has been
set in icmap and uses that to determine if a valid local address
has been found.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agototemknet: Drop truncated packets on receive
Jan Friesse [Fri, 5 Jan 2018 15:19:45 +0000 (16:19 +0100)]
totemknet: Drop truncated packets on receive

This is backport of part of "totemudpu: Scale receive buffer" patch.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agototemudp: Make use of UDP_RECEIVE_FRAME_SIZE_MAX
Jan Friesse [Fri, 5 Jan 2018 15:10:30 +0000 (16:10 +0100)]
totemudp: Make use of UDP_RECEIVE_FRAME_SIZE_MAX

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agototemudpu: Export and rename UDPU_FRAME_SIZE_MAX
Jan Friesse [Fri, 5 Jan 2018 15:05:36 +0000 (16:05 +0100)]
totemudpu: Export and rename UDPU_FRAME_SIZE_MAX

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agototemconfig: Fix UDP autogeneration of mcast addr
Jan Friesse [Fri, 5 Jan 2018 15:04:24 +0000 (16:04 +0100)]
totemconfig: Fix UDP autogeneration of mcast addr

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agototemudpu: Scale receive buffer
Jan Friesse [Thu, 4 Jan 2018 16:07:20 +0000 (17:07 +0100)]
totemudpu: Scale receive buffer

Receive buffer should be based on PROCESSOR_COUNT_MAX and not static
buffer.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agoconfig: Allow selection of crypto_model
Christine Caulfield [Fri, 5 Jan 2018 10:13:17 +0000 (10:13 +0000)]
config: Allow selection of crypto_model

KNET has options for nss or openssl crpyto libraries, make this
available to corosync.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agolibcpg: Fix issue with partial big packet assembly
Rytis Karpuška [Thu, 28 Dec 2017 13:17:12 +0000 (15:17 +0200)]
libcpg: Fix issue with partial big packet assembly

Packet assembly is done seperately for each nodeid, pid pair, therefore
multiple packets are not mixed into single buffer.

Signed-off-by: Rytis Karpuška <rytisk@neurotechnology.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoqdevice: mv free(str) after port validation
Bin Liu [Wed, 27 Dec 2017 10:21:34 +0000 (18:21 +0800)]
qdevice: mv free(str) after port validation

in the previous code of qdevice_net_instance_init_from_cmap:
   host_port = strtol(str, &ep, 10);

   free(str);

   if (host_port <= 0 || host_port > ((uint16_t)~0) || *ep != '\0')

before free, *ep is '\0'. But after free, *ep changed to 'U', so mv
free behind the comparison.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocorosync.aug: Add missing options
Toki Winter [Fri, 15 Dec 2017 00:49:35 +0000 (18:49 -0600)]
corosync.aug: Add missing options

Knet related options are not yet included.

Signed-off-by: Toki Winter <toki@linuxfoundation.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoconfig: Allow links to have different ip_versions
Christine Caulfield [Tue, 12 Dec 2017 14:01:57 +0000 (14:01 +0000)]
config: Allow links to have different ip_versions

knet allows links to have different IP versions - proivided they
all match per link. So don't force them all to be the same.

I've added a check here to make sure that all nodes on the same
link are using the same IP version.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoFix compile errors in qdevice and vqsim on FreeBSD
Bin Liu [Tue, 5 Dec 2017 07:28:54 +0000 (15:28 +0800)]
Fix compile errors in qdevice and vqsim on FreeBSD

Some header files need to be specified on FreeBSD, otherwise there
are compile errors. These files does not affect Linux compilation.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocmapctl: mention the Clear stats option in usage message
Christine Caulfield [Thu, 16 Nov 2017 14:30:05 +0000 (14:30 +0000)]
cmapctl: mention the Clear stats option in usage message

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocorosync-cfgtool: refactor cli parameters handling
Bin Liu [Wed, 29 Nov 2017 06:41:37 +0000 (14:41 +0800)]
corosync-cfgtool: refactor cli parameters handling

use the idea from corosync-cmapctl to set ACTION and params in the first
swtich, and add another swtich to call function based on ACTION and the
params.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agowd: fix snprintf warnings
Bin Liu [Fri, 1 Dec 2017 02:58:50 +0000 (10:58 +0800)]
wd: fix snprintf warnings

When running ./configure --enable-watchdog, gcc 7.2.1 will report
warnings for snprintf. This patch fixes the warnings.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agototemsrp: Revert totemsrp_get_ifaces() changes
Christine Caulfield [Thu, 30 Nov 2017 14:56:35 +0000 (14:56 +0000)]
totemsrp: Revert totemsrp_get_ifaces() changes

In my enthusiasm for removing code while integrating knet I
also deleted the correct code for returning IP address for a node,
so that only the IP addres of the local node was ever returned.

This commit restores the the previous code.

Also, because we always return INTERFACE_MAX interfaces now (they don't
have to be contiguous) set ss_family to zero if that interface is not
in use so that downstream apps know and don't display a lot of 0.0.0.0

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoman: Add note about corosync not using name option
Jan Friesse [Thu, 30 Nov 2017 15:19:21 +0000 (16:19 +0100)]
man: Add note about corosync not using name option

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agocorosync.conf: publicize nodelist.node.name
Jan Pokorný [Wed, 29 Nov 2017 19:01:48 +0000 (20:01 +0100)]
corosync.conf: publicize nodelist.node.name

It was discovered that pacemaker has been occassionaly relying on
those items configured in corosync.conf (and documenting so), while
backpropagation got stuck somewhere.  As the option is deemed generally
beneficial, rectify this gap now and make it standard,
public part of the configuration space, possibly also for other
client SW to use now.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoman: fixes for corosync.conf man page
Bin Liu [Wed, 29 Nov 2017 08:20:03 +0000 (16:20 +0800)]
man: fixes for corosync.conf man page

1. multicast address/port is only for UDP
2. change kronosnet to Kronosnet
3. nodeid must be set with KNET, not UDPU

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocmapctl: add "-m" option into help message
Bin Liu [Wed, 29 Nov 2017 08:53:32 +0000 (16:53 +0800)]
cmapctl: add "-m" option into help message

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agototemconfig: remove duplicate aes256 test
Bin Liu [Wed, 29 Nov 2017 08:10:59 +0000 (16:10 +0800)]
totemconfig: remove duplicate aes256 test

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agofix output format for corosync-cfgtool with knet (#283)
Bin Liu [Mon, 27 Nov 2017 08:35:40 +0000 (16:35 +0800)]
fix output format for corosync-cfgtool with knet (#283)

Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agosync: Call sync_init of all services at once
Jan Friesse [Mon, 13 Nov 2017 16:38:54 +0000 (17:38 +0100)]
sync: Call sync_init of all services at once

This patch solves situation which can happen very rearly:
- Node B is running
- Node A is started and tries to create singleton membership. It also
  initialize service S which tries to send message during initialization
- Just before node A finished move to operational state, it gets
  Node B multicast message so moves to gather state
- Node A and B creates membership and moves to operational state and
  sync is started
- Node A and B receives message sent by node A during initialization of
  service S
- Node A exits before sync of service is finished

In this situation, node B may never execute sync_init for
service S. So node B service S is not aware of existence of node A but
it received message from it.

Similar situation can theoretically also happen during merge.

Solution is to change flow of sync, so now it looks like:

- Build service_list
- Call sync_init for all local services
- Send service_list
- Receive service_list from all members and send barier
- For all services:
  - Receive barier
  - Call sync_activate if this is not first service
  - Call sync_process for next service or finish sync if previous
    this service is the last one
  - Send barier

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agosync: Remove unneeded determine sync code
Jan Friesse [Mon, 13 Nov 2017 15:05:26 +0000 (16:05 +0100)]
sync: Remove unneeded determine sync code

Code was used for compatibility with old sync v1 (in needle this was
deleted and previous version 2 became v1), and it's no longer needed.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agostats: Add some missing knet stats
Christine Caulfield [Tue, 14 Nov 2017 10:28:42 +0000 (10:28 +0000)]
stats: Add some missing knet stats

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoman: Add note about qdevice parallel cmds start
Jan Friesse [Tue, 14 Nov 2017 08:39:58 +0000 (09:39 +0100)]
man: Add note about qdevice parallel cmds start

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
6 years agoman: corosync-qdevice: some more stylistics
Jan Pokorný [Thu, 9 Nov 2017 15:55:57 +0000 (16:55 +0100)]
man: corosync-qdevice: some more stylistics

Following the well-used scheme:
- expressly given defaults: italics (underline in standard terminals)
- key cross-references: bold (as well as the originals)

+ fix missing paragraph delimiters
+ s/what/which/ and s/on/one/ where appropriate

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agosystemd: corosync-qdevice can not run without corosync
Ferenc Wágner [Thu, 9 Nov 2017 10:29:58 +0000 (11:29 +0100)]
systemd: corosync-qdevice can not run without corosync

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoman: corosync-qdevice: fix formatting vs. punctuation
Jan Pokorný [Wed, 8 Nov 2017 11:42:47 +0000 (12:42 +0100)]
man: corosync-qdevice: fix formatting vs. punctuation

Previously, some enumerations were hard to follow, as they were marked
up all at once, including punctuation and connectives. Also mark up
some expressly given defaults.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoconfigure: kill off INITWRAPPERSDIR
Ferenc Wágner [Mon, 30 Oct 2017 20:55:06 +0000 (21:55 +0100)]
configure: kill off INITWRAPPERSDIR

When configured for systemd, don't install the SysV init scripts at all.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocorosync-qdevice: send startup notification to systemd
Ferenc Wágner [Tue, 8 Nov 2016 21:36:53 +0000 (22:36 +0100)]
corosync-qdevice: send startup notification to systemd

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocorosync-qnetd: send startup notification to systemd
Ferenc Wágner [Mon, 19 Dec 2016 13:27:08 +0000 (14:27 +0100)]
corosync-qnetd: send startup notification to systemd

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoSend corosync-notifyd startup notification to systemd
Ferenc Wágner [Mon, 30 Oct 2017 21:12:14 +0000 (22:12 +0100)]
Send corosync-notifyd startup notification to systemd

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoMake systemd stop corosync-notifyd if corosync is stopped
Ferenc Wágner [Mon, 30 Oct 2017 21:12:09 +0000 (22:12 +0100)]
Make systemd stop corosync-notifyd if corosync is stopped

Otherwise is just exits successfully (which should probably be fixed
eventually), leading to confusion.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agocorosync.spec: Add system-devel build requirement
Jan Friesse [Wed, 8 Nov 2017 14:39:34 +0000 (15:39 +0100)]
corosync.spec: Add system-devel build requirement

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Ferenc Wágner <wferi@debian.org>
6 years agoSend corosync startup notification to systemd
Ferenc Wágner [Mon, 30 Oct 2017 21:11:56 +0000 (22:11 +0100)]
Send corosync startup notification to systemd

This enables starting the daemon directly in the service file, because
dependent units won't be started until initialization is complete.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoquorumtool: Use full buffer size in snprintf
Jan Friesse [Tue, 7 Nov 2017 14:55:30 +0000 (15:55 +0100)]
quorumtool: Use full buffer size in snprintf

Thanks Bin Liu <bliu@suse.com> for this patch.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agocpghum: Mark print/log functions with printf attr
Jan Friesse [Tue, 7 Nov 2017 14:54:36 +0000 (15:54 +0100)]
cpghum: Mark print/log functions with printf attr

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agocpg_test_agent: Fix snprintf compiler warnings
Jan Friesse [Tue, 7 Nov 2017 14:53:45 +0000 (15:53 +0100)]
cpg_test_agent: Fix snprintf compiler warnings

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agosam: Fix snprintf compiler warnings
Jan Friesse [Tue, 7 Nov 2017 14:53:21 +0000 (15:53 +0100)]
sam: Fix snprintf compiler warnings

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
6 years agocoroparse: Do not convert empty uid, gid to 0
Jan Friesse [Mon, 6 Nov 2017 08:22:41 +0000 (09:22 +0100)]
coroparse: Do not convert empty uid, gid to 0

When uid (or gid) value was empty string it was incorrectly converted to
0. Solution is to check input string emptines.

Thanks Bin Liu <bliu@suse.com> for reporting the bug.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Bin Liu <bliu@suse.com>
6 years agocmapctl: Add option to clear the stats
Christine Caulfield [Thu, 2 Nov 2017 16:01:36 +0000 (16:01 +0000)]
cmapctl: Add option to clear the stats

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agostats: Don't display errors when reading knet stat
Christine Caulfield [Thu, 2 Nov 2017 13:16:00 +0000 (13:16 +0000)]
stats: Don't display errors when reading knet stat

Only add the knet handle stat keys if we are actually running knet. This
prevents errors occurring when iterating through all of the stats keys

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agomake the output of "corosync-cfgtool -s" more readable (#269)
Bin Liu [Fri, 3 Nov 2017 09:50:29 +0000 (17:50 +0800)]
make the output of "corosync-cfgtool -s" more readable (#269)

6 years agocfg: nodeid should be unsigned int
Bin Liu [Wed, 1 Nov 2017 08:23:41 +0000 (16:23 +0800)]
cfg: nodeid should be unsigned int

nodeid in struct req_lib_cfg_get_node_addrs is "unsigned int",
so the function corosync_cfg_get_node_addrs should have its param
"nodeid" to be unsigned int.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoquorumtool: remove duplicated help message
Bin Liu [Wed, 1 Nov 2017 03:30:54 +0000 (11:30 +0800)]
quorumtool: remove duplicated help message

Option "-p" was included twice, so remove one of them.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoman: fix cpg_mcast_joined.3.in
Jonathan Davies [Wed, 1 Nov 2017 14:36:40 +0000 (14:36 +0000)]
man: fix cpg_mcast_joined.3.in

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoman: Add stats.clear keys to the cmap_keys man pg
Christine Caulfield [Tue, 31 Oct 2017 11:47:41 +0000 (11:47 +0000)]
man: Add stats.clear keys to the cmap_keys man pg

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agostats: Add cmap key to clear the various stats.
Christine Caulfield [Tue, 31 Oct 2017 10:54:43 +0000 (10:54 +0000)]
stats: Add cmap key to clear the various stats.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
6 years agoUse RuntimeDirectory instead of tmpfiles.d
Ferenc Wágner [Mon, 28 Nov 2016 13:47:05 +0000 (14:47 +0100)]
Use RuntimeDirectory instead of tmpfiles.d

This reverts part of commit 32123f6bb2ebc4f9ac7865945cc85a9c9b903dc6.

A simple directive is a much lighter solution to the same problem, and
automatically follows the specified User.  I copied the 0770 modes from
the corresponding init scripts; they could use a little documentation.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agototemconfig: generate mcast icmap items for UDP
Bin Liu [Thu, 26 Oct 2017 09:29:43 +0000 (17:29 +0800)]
totemconfig: generate mcast icmap items for UDP

Generating mcastaddr and mcastport in icmap make
sense only for UDP transport.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoUse static case blocks to determine distro flavor
Ferenc Wágner [Tue, 24 Oct 2017 12:05:03 +0000 (14:05 +0200)]
Use static case blocks to determine distro flavor

This is a configure-time decision, avoid live filesystem checks.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoconfigure: add --with-initconfigdir option
Ferenc Wágner [Thu, 24 Nov 2016 11:06:37 +0000 (12:06 +0100)]
configure: add --with-initconfigdir option

Default value is /etc/sysconfig and resulting
INITCONFIGDIR is used to reduce duplication in init system
integration code.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agototemconfig: add nodeid check for knet
Bin Liu [Thu, 26 Oct 2017 07:57:12 +0000 (15:57 +0800)]
totemconfig: add nodeid check for knet

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoman: support SOURCE_DATE_EPOCH
Ferenc Wágner [Tue, 24 Oct 2017 14:06:37 +0000 (16:06 +0200)]
man: support SOURCE_DATE_EPOCH

Make reproducible builds possible by supporting
https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoman:fix in corosync-qdevice.8
Bin Liu [Tue, 24 Oct 2017 09:29:42 +0000 (17:29 +0800)]
man:fix in corosync-qdevice.8

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoman: must set nodeid for knet in nodelist
Bin Liu [Tue, 24 Oct 2017 06:12:08 +0000 (14:12 +0800)]
man: must set nodeid for knet in nodelist

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agologsys: Avoid redundant callsite section checking
Jan Pokorný [Wed, 18 Oct 2017 19:59:22 +0000 (21:59 +0200)]
logsys: Avoid redundant callsite section checking

Previously, corosync executable was repeatedly (proportionally to the
count of LOGSYS_DECLARE_SUBSYS macro applications involved in the
constituent source files) checking the same for no gain in the pre-main
startup. This is not needed since nothing changes with static data
shared withing the same program space (it may have been a different
story once upon a time if loadable modules were in use), so make that
happen in (one-off per executable) LOGSYS_DECLARE_SYSTEM instead.

Libqb offers it's own ready-made macro to that
effect, simply to isolate the inner percularities from the library user
(that should not be required to understand anything about the orphan
sections and respective autocreated symbols to denote their boundaries).
As it is compile-time conditionalized in the same way, just use it
directly instead. As a value added, corosync will be kept up to date
about the possibly growing set of the logging-sanity checks as it gets
compiled with newer and newer libqb versions (their header files, for
that matter).

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoconfig: Fix memory leak
Christine Caulfield [Fri, 20 Oct 2017 08:16:45 +0000 (09:16 +0100)]
config: Fix memory leak

totem_volatile_config_set_string_value was not properly freeing memory.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoknet: Add support for knet compression
Christine Caulfield [Fri, 13 Oct 2017 13:53:21 +0000 (14:53 +0100)]
knet: Add support for knet compression

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoqdevice: Add support for heuristics
Jan Friesse [Thu, 10 Nov 2016 17:49:09 +0000 (18:49 +0100)]
qdevice: Add support for heuristics

Heuristics are set of commands executed locally on startup, cluster
membership change, successful connect to corosync-qnetd and optionally
also at regular times. When all commands finish successfully
(their return error code is zero) on time, heuristics have passed,
otherwise they have failed. The heuristics result is sent to
corosync-qnetd and there it's used in calculations to determine which
partition should be quorate.

Right know, there are some problems (bugs):
- Regular heuristics is supported only by ffsplit. This is not a
problem for clusters with power fencing, but deployments where
non-quorate partition continues to operate may see this as a problem.
- Qdevice-tool status doesn't contain detailed information about
heuristics.
- Qdevice-tool doesn't have a possibility to trigger heuristics
re-execute.

Thanks Chrissie Caulfield for Englishify the man pages.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agoSpec: fix arch-qualified dependencies
Keisuke MORI [Wed, 18 Oct 2017 08:22:52 +0000 (08:22 +0000)]
Spec: fix arch-qualified dependencies

needed along with commit 30af25294e019678c4f31e3368b19266f69b8254

Signed-off-by: Keisuke MORI <kskmori@intellilink.co.jp>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agocmap: Remove noop highest config version check
Jan Friesse [Wed, 11 Oct 2017 15:11:33 +0000 (17:11 +0200)]
cmap: Remove noop highest config version check

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
7 years agocmap: don't shutdown highest config_version node
Jonathan Davies [Tue, 10 Oct 2017 14:53:41 +0000 (15:53 +0100)]
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>
7 years agototemudp: Remove memb_join discarding
Kazunori INOUE [Tue, 26 Sep 2017 08:36:09 +0000 (17:36 +0900)]
totemudp: Remove memb_join discarding

This is already implemented in totemsrp in much cleaner way (added
by commit ab8942f6260fde93824ed2a18e09e572b59ceb25).

Signed-off-by: Kazunori INOUE <inouekazu@intellilink.co.jp>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agovotequorum: make atb consistent on nodelist reload
Edwin Torok [Fri, 22 Sep 2017 16:28:54 +0000 (17:28 +0100)]
votequorum: make atb consistent on nodelist reload

When the cluster changes from even sized to odd sized corosync
disables auto-tie-breaker if wait_for_all is not enabled.
However when changing from odd sized to even sized it doesn't reenable
it, causing auto_tie_breaker to be inconsistent across the cluster:
the newly added node and any nodes that restart corosync
will have it, but all the previously running nodes won't.

Signed-off-by: Edwin Torok <edvin.torok@citrix.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agototem: Remove unnecessary NSS headers
Fabio M. Di Nitto [Fri, 22 Sep 2017 08:25:40 +0000 (10:25 +0200)]
totem: Remove unnecessary NSS headers

Also fix corosync.spec.in to depend on libknet.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoconfig: Allow dynamic link configuration
Christine Caulfield [Fri, 15 Sep 2017 12:12:01 +0000 (13:12 +0100)]
config: Allow dynamic link configuration

Now we are using knet, it's possible to dynamically add, remove and
reconfigure links on the fly.

Also print 'n' for non-existant knet links. This will show up
only on loopback links >0. But it looks better than 'status ='

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agototemudp: Retry if bind fails
Masse Nicolas [Fri, 15 Sep 2017 14:52:15 +0000 (16:52 +0200)]
totemudp: Retry if bind fails

If bind call fails it's retried for BIND_MAX_RETRIES.
If it's still unsuccessful, corosync exists instead
of working incorrectly.

Slightly modified by reviewer.

Signed-off-by: Masse Nicolas <nicolas.masse@stormshield.eu>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agocorosync.conf.5: watchdog support is conditional
Ferenc Wágner [Wed, 13 Sep 2017 13:29:32 +0000 (15:29 +0200)]
corosync.conf.5: watchdog support is conditional

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agowd: default to not using a watchdog
Ferenc Wágner [Mon, 11 Sep 2017 16:44:56 +0000 (18:44 +0200)]
wd: default to not using a watchdog

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agowd: remove extra capitalization typo
Ferenc Wágner [Mon, 11 Sep 2017 16:26:33 +0000 (18:26 +0200)]
wd: remove extra capitalization typo

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agocorosync.conf.5: add warning about slow watchdogs
Ferenc Wágner [Mon, 11 Sep 2017 11:40:05 +0000 (13:40 +0200)]
corosync.conf.5: add warning about slow watchdogs

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agototemknet: fix debug message typo
Jonathan Davies [Thu, 7 Sep 2017 08:21:08 +0000 (10:21 +0200)]
totemknet: fix debug message typo

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agocorosync.conf.5: Fix watchdog documentation
Ferenc Wágner [Wed, 6 Sep 2017 12:43:00 +0000 (14:43 +0200)]
corosync.conf.5: Fix watchdog documentation

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agowd: fix typo
Ferenc Wágner [Thu, 8 Jun 2017 09:17:37 +0000 (11:17 +0200)]
wd: fix typo

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agoInclude fcntl.h for F_* and O_* defines
Khem Raj [Thu, 31 Aug 2017 00:28:55 +0000 (17:28 -0700)]
Include fcntl.h for F_* and O_* defines

Fixes errors like
utils.c:95:22: error: use of undeclared identifier 'O_WRONLY'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agostats: add knet 'handle' stats
Christine Caulfield [Tue, 22 Aug 2017 08:22:07 +0000 (09:22 +0100)]
stats: add knet 'handle' stats

knet handle stats show compression and crypto statistics. With these
you can see the effectiveness of compression and the overheads of both
crypto and compression.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agomain: use syslog & printf directly for early log messages
Christine Caulfield [Tue, 22 Aug 2017 08:51:09 +0000 (09:51 +0100)]
main: use syslog & printf directly for early log messages

libqb seems funny about logging things before its fully configured.
This corosync commit didn't help either:
8b6bd86a55b8bda9f3a8ff67bdff908263976fa3

So to make sure that messages about the config file not being opened
get delivered to the user/syslog we send them directly.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agototempg: Allow space for incoming overflow
Christine Caulfield [Mon, 14 Aug 2017 13:04:31 +0000 (14:04 +0100)]
totempg: Allow space for incoming overflow

totempg needs to store the current message + any
overflow for the next message which can be up to (nearly) the MTU size.
in knet that's large, but for UDP it's just 1500.

The reason we've never seen it before is because the actual max message
size is 1024 less than 1MB and after all the headers are stripped out the overflow is
usually 1024 bytes or less.
The 1024*1024 size of the assembly buffer is large enough to hold a max message (1047552) +
1024 bytes of a new UDP message. So we never saw any problems.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agocpghum: Add options to change flood start/mult/end sizes (#237)
Chrissie Caulfield [Fri, 11 Aug 2017 14:28:02 +0000 (15:28 +0100)]
cpghum: Add options to change flood start/mult/end sizes (#237)

I ran out of sensible short options for cpghum so added some long
ones to cope with them.

Also added is the ability to specify most size values in a sensible format
eg 64M for 64 Megabytes or 48K for 48 Kilobytes.

Strictly those are MiB and KiB of course, but I'm old-fashioned.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agototemknet: Use knet's LOOPBACK transport (#236)
Chrissie Caulfield [Fri, 4 Aug 2017 11:59:16 +0000 (12:59 +0100)]
totemknet: Use knet's LOOPBACK transport (#236)

knet now has a built-in LOOPBACK transport so use that
rather than special-casing it for ourself.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agoCFG: Remove ring-reenable code
Christine Caulfield [Thu, 3 Aug 2017 08:58:27 +0000 (09:58 +0100)]
CFG: Remove ring-reenable code

RRP doesn't exist any more so all the ring re-enable code is redundant.

I've removed it from the library and all the code that does anything,
but I've left the hole in the IPC just in case old libraries are
hanging around.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agomain: Add support for libcgroup
Jan Friesse [Fri, 28 Jul 2017 14:32:58 +0000 (16:32 +0200)]
main: Add support for libcgroup

When corosync is started in environment where it ends in cgroup without
properly set rt_runtime_us it's impossible to get RT priority.

Already implemented workaround is to use higher non-RT priority.

This patch implements another solution. It moves corosync into root cpu
cgroup. Root cpu cgroup hopefully has enough RT budget.

Another solution was mentioned on ML
https://lists.freedesktop.org/archives/systemd-devel/2017-July/039353.html
but this means to generate some "random" values.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
(cherry picked from commit c56086c701d08fc17cf6d8ef603caf505a4021b7)

7 years agostats: Add map with on-demand statistics
Christine Caulfield [Mon, 3 Jul 2017 13:54:33 +0000 (14:54 +0100)]
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>
7 years agoipc: Check for the libraries sending invalid message IDs
Christine Caulfield [Fri, 14 Jul 2017 13:06:49 +0000 (14:06 +0100)]
ipc: Check for the libraries sending invalid message IDs

If the library sent an invalid (ie too high) message ID to
corosync, then it could cause the daemon to crash.

Now we check the message ID before indexing the function array

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
7 years agomain: Add option to set priority
Jan Friesse [Fri, 7 Jul 2017 15:49:46 +0000 (17:49 +0200)]
main: Add option to set priority

Option -P takes numeric value with same meaning
as nice or values min / max, meaning maximal / minimal priority (so
minimal / maximal nice value).

Scheduler / priority setting is moved in code so it is now executed
after logsys is configured so errors are logged.

Setting maximal priority is also used as fallback when realtime
scheduling is requested and sched_setscheduler fails.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
(cherry picked from commit a008448efb2b1d45c432867caf08f0bcf2b4b9b0)

7 years agototemknet: Prevent dead-loop in log_flush_messages
Jan Friesse [Mon, 3 Jul 2017 13:40:29 +0000 (15:40 +0200)]
totemknet: Prevent dead-loop in log_flush_messages

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
7 years agocorosync-keygen: Display number of needed bits
Jan Friesse [Mon, 3 Jul 2017 11:16:33 +0000 (13:16 +0200)]
corosync-keygen: Display number of needed bits

Instead of currently read bits, number of already read bits is
displayed to let the user know how long it's needed to "press keys"

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agototemknet: Flush knet log messages
Jan Friesse [Fri, 30 Jun 2017 08:35:57 +0000 (10:35 +0200)]
totemknet: Flush knet log messages

When initialization fails knet logs messages into pipe. Previously they
were never processed. Solution is to add log_flush_messages which takes
care to call log_deliver_fn.

Call of log_flush_messages is also added to totemknet_finalize because
this removes log pipe fd from qb_loop so similar problem can happen.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agocorosync-keygen: Make less-secure default
Jan Friesse [Fri, 23 Jun 2017 12:31:53 +0000 (14:31 +0200)]
corosync-keygen: Make less-secure default

/dev/urandom is good enough for crypto keys and it's not blocking. If
superb randomness is really needed, it's possible to use newly added
option -r.

Also manpage is reworked a bit to use .nf instead of many .br.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agocorosync-keygen: Adapt to knet key sizes
Jan Friesse [Fri, 23 Jun 2017 12:18:08 +0000 (14:18 +0200)]
corosync-keygen: Adapt to knet key sizes

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agototemconfig: Make crypto work again
Jan Friesse [Fri, 23 Jun 2017 09:22:09 +0000 (11:22 +0200)]
totemconfig: Make crypto work again

Knet needs longer key and supports various key lengths. Split
TOTEM_PRIVATE_KEY_LEN into TOTEM_PRIVATE_KEY_LEN_MIN and
TOTEM_PRIVATE_KEY_LEN_MAX (both using KNET_*_KEY_LEN).

Fix incorrect "Could only read..." message.

Make sure key is properly initialized/zeroed.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agoknet: Compile with latest knet API
Christine Caulfield [Thu, 29 Jun 2017 09:02:21 +0000 (10:02 +0100)]
knet: Compile with latest knet API

extra parameter added to knet_link_get_status()

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agototem: Propagate totem initialization failure
Jan Friesse [Thu, 15 Jun 2017 09:07:19 +0000 (11:07 +0200)]
totem: Propagate totem initialization failure

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agototemknet: Use new knet_link_set_config() API
Christine Caulfield [Fri, 9 Jun 2017 12:28:46 +0000 (13:28 +0100)]
totemknet: Use new knet_link_set_config() API

TC_PRIO_INTERACTIVE is now a link option in knet, so we have
to provide it at link config time.

This needs the latest knet git to compile as this is an updated API.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
7 years agocoroapi: Use size_t for private_data_size
Michael Jones [Thu, 25 May 2017 18:29:19 +0000 (13:29 -0500)]
coroapi: Use size_t for private_data_size

Unsigned int and size_t represent two different concepts.

Same problem was present in ipc_glue.

Signed-off-by: Michael Jones <jonesmz@jonesmz.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>