diff --git a/.corosync.metadata b/.corosync.metadata index 8d3dc4a..9920934 100644 --- a/.corosync.metadata +++ b/.corosync.metadata @@ -1 +1 @@ -7c93022516960e96be6823cd17c8300964641036 SOURCES/corosync-2.3.4.tar.gz +f3c764a3b7fa805250d2ef35fd1d199b14367bd2 SOURCES/corosync-2.4.0.tar.gz diff --git a/.gitignore b/.gitignore index a5a4ad7..dd8fafe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/corosync-2.3.4.tar.gz +SOURCES/corosync-2.4.0.tar.gz diff --git a/SOURCES/bz1078361-1-manpage-Fix-English.patch b/SOURCES/bz1078361-1-manpage-Fix-English.patch deleted file mode 100644 index d3d0cfd..0000000 --- a/SOURCES/bz1078361-1-manpage-Fix-English.patch +++ /dev/null @@ -1,381 +0,0 @@ -From f77a61ac1795e794244440e1bfe804f02cc5d2b6 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Mon, 13 Oct 2014 10:28:27 +0200 -Subject: [PATCH] manpage: Fix English - -While I was looking at the above man page changes I thought I'd review -the rest of it. So here are some more English fixes for the cmap_keys.8 -man page - -Signed-off-by: Christine Caulfield -Reviewed-by: Jan Friesse ---- - man/cmap_keys.8 | 154 +++++++++++++++++++++++++++--------------------------- - 1 files changed, 77 insertions(+), 77 deletions(-) - -diff --git a/man/cmap_keys.8 b/man/cmap_keys.8 -index 16b7d46..bda6615 100644 ---- a/man/cmap_keys.8 -+++ b/man/cmap_keys.8 -@@ -1,5 +1,5 @@ - .\"/* --.\" * Copyright (c) 2012-2013 Red Hat, Inc. -+.\" * Copyright (c) 2012-2014 Red Hat, Inc. - .\" * - .\" * All rights reserved. - .\" * -@@ -39,135 +39,135 @@ cmap_keys \- Overview of keys stored in the Configuration Map - - .SH OVERVIEW - .P --There are roughly 3 types of keys stored in CMAP: -+There are 3 main types of keys stored in CMAP: - .PP --* Mapping of values stored in config file. -+* Mapping of values stored in the config file. - .PP - * Runtime statistics. - .PP - * Other user created values. - --In this man page, wild-cards are used with usual meaning. -+In this man page, wild-cards have the usual meaning. - - .SH KEYS - .TP - internal_configuration.* --Internal configuration data. This keys (whole prefix) is read only. --It's only useful for getting list of loaded services. -+Internal configuration data. All keys in this prefix are read only. -+It's only useful for getting a list of loaded services. - - .TP - logging.* --Values read from configuration file. It's possible to change them at runtime. --If subsystem specific configuration is needed, key must be in form --logging.logger_subsys.SERVICE.key, where SERVICE is upper case name of service and --key is same as in configuration file. All values are of string type. -+Values read from the configuration file. It's possible to change them at runtime. -+If subsystem specific configuration is needed, the key must be in the form -+logging.logger_subsys.SERVICE.key, where SERVICE is upper case name of the service and -+key is same as in the configuration file. All values are of string type. - - .TP - nodelist.* --Values read from configuration file. Each node element in configuration file gets --assigned it's position starting from zero. So first node from config file has --nodelist.node.0. prefix. To be valid entry, each node must have -+Values read from the configuration file. Each node element in the configuration file gets -+assigned it's position starting from zero. So the first node from the config file has -+nodelist.node.0. prefix. To be a valid entry, each node must have - .B ring0_addr - key. --For change of -+To change the - .B nodeid --key, use u32 data type. -+key, use a u32 data type. - - Local node position is stored in - .B local_node_pos - key (RO), so it's easy to find --out nodeid/ring addresses of local node directly from cmap. -+out nodeid/ring addresses of the local node directly from cmap. - - .TP - runtime.blackbox.* --Trigger keys for store fplay data. It's recommended to use corosync-blackbox command -+Trigger keys for storing fplay data. It's recommended that you the corosync-blackbox command - to change keys in this prefix. - - .TP - runtime.connections.* --There are informations about total number of active connections in given moment in -+This is information about total number of active connections in a given moment in the - .B active --key, number of closed connections during whole runtime of corosync in -+key, number of closed connections during whole runtime of corosync in the - .B closed --key and informations about each active IPC connection. All keys in this prefix are read-only. -+key and information about each active IPC connection. All keys in this prefix are read-only. - - .TP - runtime.connections.ID.* --Each IPC connection has unique ID. This is in form [[short_name:][PID:]internal_id. On some -+Each IPC connection has a unique ID. This is in the form [[short_name:][PID:]internal_id. On some - platforms, short_name and PID are not filled and only internal_id is used. - --Typical keys in prefix are: -+Typical keys in this prefix are: - - .B client_pid - containing PID of IPC connection (unavailable on some platforms). - - .B dispatched --with number of dispatched messages. -+number of dispatched messages. - - .B invalid_request --is number of requests made by IPC which are invalid (calling non-existing call, ...). -+number of requests made by IPC which are invalid (calling non-existing call, ...). - - .B name --containing short name of IPC connection (unavailable on some platforms). -+contains short name of the IPC connection (unavailable on some platforms). - - .B overload - is number of requests which were not processed because of overload. - - .B queue_size --contains number of messages in queue waiting for send. -+contains the number of messages in the queue waiting for send. - - .B recv_retries --is total number of interrupted receives. -+is the total number of interrupted receives. - - .B requests --contains number of requests made by IPC. -+contains the number of requests made by IPC. - - .B responses --is number of responses sent to IPC client. -+is the number of responses sent to the IPC client. - - .B send_retries --contains total number of interrupted sends. -+contains the total number of interrupted sends. - - .B service_id --contains ID of service which IPC is connected to. -+contains the ID of service which the IPC is connected to. - - .TP - runtime.services.* - Prefix with statistics for service engines. Each service has it's own - .B service_id --key in prefix with name runtime.services.SERVICE., where SERVICE is lower case --name of service. Inside service prefix is number of received and send messages --by corosync engine in format runtime.services.SERVICE.EXEC_CALL.rx and --runtime.services.SERVICE.EXEC_CALL.tx, where EXEC_CALL is internal id of service -+key in the prefix with the name runtime.services.SERVICE., where SERVICE is the lower case -+name of the service. Inside the service prefix is the number of messages received and sent -+by the corosync engine in the format runtime.services.SERVICE.EXEC_CALL.rx and -+runtime.services.SERVICE.EXEC_CALL.tx, where EXEC_CALL is the internal id of the service - call (so for example 3 in cpg service is receive of multicast message from other - nodes). - - .TP - runtime.totem.pg.mrp.srp.* --Prefix with statistics about totem. All keys there are read only. -+Prefix containing statistics about totem. All keys here are read only. - Typical key prefixes: - - .B commit_entered --Number of times processor entered COMMIT state. -+Number of times the processor entered COMMIT state. - - .B commit_token_lost --Number of times processor lost token in COMMIT state. -+Number of times the processor lost token in COMMIT state. - - .B consensus_timeouts --How many times processor timeouted making consensus about membership. -+How many times the processor timed out forming a consensus about membership. - - .B continuous_gather --How many times was processor not able to reach consensus. -+How many times the processor was not able to reach consensus. - - .B firewall_enabled_or_nic_failure --Set to 1 when processor was not able to reach consensus for long time. Usual --reason is badly configured firewall or connection failure. -+Set to 1 when processor was not able to reach consensus for long time. The usual -+reason is a badly configured firewall or connection failure. - - .B gather_entered --Number of times processor entered GATHER state. -+Number of times the processor entered GATHER state. - - .B gather_token_lost --Number of times processor lost token in GATHER state. -+Number of times the processor lost token in GATHER state. - - .B mcast_retx - Number of retransmitted messages. -@@ -203,13 +203,13 @@ Number of received orf tokens. - Number of transmitted orf tokens. - - .B recovery_entered --Number of times processor entered recovery. -+Number of times the processor entered recovery. - - .B recovery_token_lost --Number of times token was lost in recovery state. -+Number of times the token was lost in recovery state. - - .B rx_msg_dropped --Number of received messages which was dropped because they were not expected -+Number of received messages which were dropped because they were not expected - (as example multicast message in commit state). - - .B token_hold_cancel_rx -@@ -223,14 +223,14 @@ Mean transit time of token in milliseconds. In other words, time between - two consecutive token receives. - - .B avg_token_workload --Average time in milliseconds of holding time of token on current processor. -+Average time in milliseconds of holding time of token on the current processor. - - .B avg_backlog_calc --Average number of not yet sent messages of current processor. -+Average number of not yet sent messages on the current processor. - - .TP - runtime.totem.pg.mrp.srp.members.* --Prefix containing members of totem single ring protocol. Each member -+Prefix containing members of the totem single ring protocol. Each member - keys has format runtime.totem.pg.mrp.srp.members.NODEID.KEY, where key is - one of: - -@@ -238,35 +238,35 @@ one of: - IP address of member. It's stored in format r(RING_ID) ip(IP_ADDRESS). - - .B join_count --Number of times processor joined membership with local processor. When -+Number of times the processor joined membership with local cluster. When - processor fails and rejoins again, this value is incremented. - - .B status --Status of processor. Can be one of joined and left. -+Status of the processor. Can be one of joined and left. - - .B config_version --Config version of member node. -+Config version of the member node. - - .TP - resources.process.PID.* - Prefix created by applications using SAM with CMAP integration. --It contains following keys: -+It contains the following keys: - - .B recovery --Recovery policy of process. Can be one of quit or restart. -+Recovery policy of the process. Can be one of quit or restart. - - .B poll_period --Value passed in sam_initialize as time_interval. -+Value passed in sam_initialize as a time_interval. - - .B last_updated --Last time when SAM received heartbeat from client. -+Last time SAM received a heartbeat from the client. - - .B state --State of client. Can be one of failed, stopped, running and waiting for quorum. -+State of the client. Can be one of failed, stopped, running and waiting for quorum. - - .TP - uidgid.* --Informations about users/groups which are allowed to do IPC connection to -+Informations about users/groups which are allowed to make IPC connections to - corosync. - - .TP -@@ -276,7 +276,7 @@ to unblock quorum if notes are known to be down. for pcs use only. - - .TP - config.reload_in_progress --This value will be set to 1 (or created) when corosync.conf reload is started, -+This value will be set to 1 (or created) when a corosync.conf reload is started, - and set to 0 when the reload is completed. This allows interested subsystems - to do atomic reconfiguration rather than changing each key. Note that - individual add/change/delete notifications will still be sent during a reload. -@@ -285,33 +285,33 @@ individual add/change/delete notifications will still be sent during a reload. - config.totemconfig_reload_in_progress - This key is similar to - .B config.totemconfig_reload_in_progress --but changed after totem config trigger is processed. It is useful (mainly) -+but changed after the totem config trigger is processed. It is useful (mainly) - for situations when - .B nodelist.local_node_pos --must be first correctly reinstated. -+must be correctly reinstated before anything else. - - .SH DYNAMIC CHANGE USER/GROUP PERMISSION TO USE COROSYNC IPC --Is very same as in configuration file. To add UID 500 use -+Is the same as in the configuration file. eg: to add UID 500 use - - .br - # corosync-cmapctl -s uidgid.uid.500 u8 1 - --GID is similar, so to add GID use -+GID is similar, so to add a GID use - - .br - # corosync-cmapctl -s uidgid.gid.500 u8 1 - --For removal of permission, simply delete key -+For removal of permissions, simply delete the key - - .br - # corosync-cmapctl -d uidgid.gid.500 - - .SH DYNAMIC ADD/REMOVE OF UDPU NODE --We will need to add node with address 10.34.38.108 -+Eg. To add the node with address 10.34.38.108 - and nodeid 3. This node is called NEW and it's not running corosync yet. - - .PP --* Find a node position in node list which is not used yet. It's recommended to -+* Find a node position in the node list which is not used yet. It's recommended that you - use highest_number + 1. Let's say output of corosync-cmapctl looks like: - - .br -@@ -327,32 +327,32 @@ nodelist.node.1.ring0_addr (str) = 10.34.38.107 - - So next node position will be 2. - .PP --* Add all entries needed for node on all running nodes, as: -+* Add all entries needed for the node on all running nodes, as: - - .br - # corosync-cmapctl -s nodelist.node.2.nodeid u32 3 - .br - # corosync-cmapctl -s nodelist.node.2.ring0_addr str 10.34.38.108 - --Always add ring0_addr key as last. Corosync engine on all nodes should reply -+Always add the ring0_addr key last. The Corosync engine on all nodes should reply - with - .I notice [TOTEM ] adding new UDPU member {10.34.38.108} - message. - .PP --* Add node information to configuration file on all nodes so it --will survive restart of corosync. -+* Add node information to the configuration file on all nodes so that it -+will survive a restart of corosync. - .PP --* Copy and edit configuration file to NEW node. -+* Copy and edit configuration file to the NEW node. - .PP --* Start corosync on NEW node. -+* Start corosync on the NEW node. - --Removal of UDPU node is very similar slightly reversed action, so -+Removal of a UDPU node is a very similar, slightly reversed action, so - .PP --* Stop corosync old OLD node. -+* Stop corosync on the OLD node. - .PP --* Remove relevant entries from cmap on all nodes. -+* Remove the relevant entries from cmap on all nodes. - .PP --* Change configuration file on all nodes. -+* Change the configuration file on all nodes. - - .SH "SEE ALSO" - .BR corosync_overview (8), --- -1.7.1 - diff --git a/SOURCES/bz1078361-2-Store-configuration-values-used-by-totem-to-cmap.patch b/SOURCES/bz1078361-2-Store-configuration-values-used-by-totem-to-cmap.patch deleted file mode 100644 index 95f6f53..0000000 --- a/SOURCES/bz1078361-2-Store-configuration-values-used-by-totem-to-cmap.patch +++ /dev/null @@ -1,91 +0,0 @@ -From bb52fc2774ef690d6bb951fe9cc34e5b373caffe Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Mon, 13 Oct 2014 11:58:58 +0200 -Subject: [PATCH] Store configuration values used by totem to cmap - -Some totem configuration values (like token, consensus, ...) are ether -computed or default value is used. It's hard to find out, what -value is really used. - -Solution is to store values in cmap. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/main.c | 1 + - exec/totemconfig.c | 14 ++++++++++++++ - man/cmap_keys.8 | 8 ++++++++ - 3 files changed, 23 insertions(+), 0 deletions(-) - -diff --git a/exec/main.c b/exec/main.c -index 0edd4bf..e423c97 100644 ---- a/exec/main.c -+++ b/exec/main.c -@@ -1061,6 +1061,7 @@ static void set_icmap_ro_keys_flag (void) - icmap_set_ro_access("runtime.connections.", CS_TRUE, CS_TRUE); - icmap_set_ro_access("runtime.totem.", CS_TRUE, CS_TRUE); - icmap_set_ro_access("runtime.services.", CS_TRUE, CS_TRUE); -+ icmap_set_ro_access("runtime.config.", CS_TRUE, CS_TRUE); - - /* - * Set RO flag for constrete keys of configuration which can't be changed -diff --git a/exec/totemconfig.c b/exec/totemconfig.c -index abaabdf..daf0719 100644 ---- a/exec/totemconfig.c -+++ b/exec/totemconfig.c -@@ -142,12 +142,21 @@ static void totem_volatile_config_set_value (struct totem_config *totem_config, - const char *key_name, const char *deleted_key, unsigned int default_value, - int allow_zero_value) - { -+ char runtime_key_name[ICMAP_KEYNAME_MAXLEN]; - - if (icmap_get_uint32(key_name, totem_get_param_by_name(totem_config, key_name)) != CS_OK || - (deleted_key != NULL && strcmp(deleted_key, key_name) == 0) || - (!allow_zero_value && *totem_get_param_by_name(totem_config, key_name) == 0)) { - *totem_get_param_by_name(totem_config, key_name) = default_value; - } -+ -+ /* -+ * Store totem_config value to cmap runtime section -+ */ -+ strcpy(runtime_key_name, "runtime.config."); -+ strcat(runtime_key_name, key_name); -+ -+ icmap_set_uint32(runtime_key_name, *totem_get_param_by_name(totem_config, key_name)); - } - - -@@ -169,6 +178,11 @@ static void totem_volatile_config_read (struct totem_config *totem_config, const - u32 = TOKEN_COEFFICIENT; - icmap_get_uint32("totem.token_coefficient", &u32); - totem_config->token_timeout += (totem_config->interfaces[0].member_count - 2) * u32; -+ -+ /* -+ * Store totem_config value to cmap runtime section -+ */ -+ icmap_set_uint32("runtime.config.totem.token", totem_config->token_timeout); - } - - totem_volatile_config_set_value(totem_config, "totem.max_network_delay", deleted_key, MAX_NETWORK_DELAY, 0); -diff --git a/man/cmap_keys.8 b/man/cmap_keys.8 -index bda6615..f19d2c9 100644 ---- a/man/cmap_keys.8 -+++ b/man/cmap_keys.8 -@@ -132,6 +132,14 @@ contains the total number of interrupted sends. - contains the ID of service which the IPC is connected to. - - .TP -+runtime.config.* -+Contains the values actually in use by the totem membership protocol. -+Values here are either taken from the Corosync configuration file, -+defaults or computed from entries in the config file. For information -+on individual keys please refer to the man page -+.BR corosync.conf (5). -+ -+.TP - runtime.services.* - Prefix with statistics for service engines. Each service has it's own - .B service_id --- -1.7.1 - diff --git a/SOURCES/bz1078361-3-man-page-Improve-description-of-token-timeout.patch b/SOURCES/bz1078361-3-man-page-Improve-description-of-token-timeout.patch deleted file mode 100644 index 253ef42..0000000 --- a/SOURCES/bz1078361-3-man-page-Improve-description-of-token-timeout.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 57539d1abc09e5aef322cb9cca5b3e6c496cfae9 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Thu, 9 Oct 2014 16:19:39 +0200 -Subject: [PATCH] man page: Improve description of token timeout - -With introduction of token_coefficient, token timeout defined in -configuration file may be no longer reflect real token timeout, what may -be confusing. - -Enhanced description hopefully fix that. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - man/corosync.conf.5 | 8 +++++++- - 1 files changed, 7 insertions(+), 1 deletions(-) - -diff --git a/man/corosync.conf.5 b/man/corosync.conf.5 -index 8fb7a0b..95eca2d 100644 ---- a/man/corosync.conf.5 -+++ b/man/corosync.conf.5 -@@ -280,11 +280,17 @@ by reducing the token timeout. - - .TP - token --This timeout specifies in milliseconds until a token loss is declared after not -+This timeout is used directly or as a base for real token timeout calculation (explained in -+.B token_coefficient -+section). Token timeout specifies in milliseconds until a token loss is declared after not - receiving a token. This is the time spent detecting a failure of a processor - in the current configuration. Reforming a new configuration takes about 50 - milliseconds in addition to this timeout. - -+For real token timeout used by totem it's possible to read cmap value of -+.B runtime.config.token -+key. -+ - The default is 1000 milliseconds. - - .TP --- -1.7.1 - diff --git a/SOURCES/bz1136429-1-crypto-fix-crypto-block-rounding-padding-calculation.patch b/SOURCES/bz1136429-1-crypto-fix-crypto-block-rounding-padding-calculation.patch deleted file mode 100644 index 4607846..0000000 --- a/SOURCES/bz1136429-1-crypto-fix-crypto-block-rounding-padding-calculation.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 239e2397820f9fa7ef430ebef0947ec1246eb50f Mon Sep 17 00:00:00 2001 -From: Fabio M. Di Nitto -Date: Tue, 2 Sep 2014 13:03:43 +0200 -Subject: [PATCH] [crypto] fix crypto block rounding/padding calculation - -libnss is "weird" in this respect as some block sizes are hardcoded, -others need to be determined dynamically. - -For AES we need to use the values we know since GetBlockSize would -return errors, for 3des (that hopefully nobody is using) the value -returned by GetBlockSize is 8, but let's use the call into libnss -to avoid possible conflicts with distro patching or older versions. - -Now, given the correct block size, the old calculation simply added -block size to the hdr_size. This is not sufficient. - -We use _PAD encryption methods and we need to take that into account. - -_PAD is calculated given the current input buf len and rounded up -to block size boundary, then block_size is added. - -Ideally we would do that on a per packet base but current transport -infrastructure doesn't allow it yet. - -So round up the hdr_size to double the block_size reported by the -cipher. - -Signed-off-by: Fabio M. Di Nitto -Reviewed-by: Christine Caulfield ---- - exec/totemcrypto.c | 15 ++++++++++++++- - 1 files changed, 14 insertions(+), 1 deletions(-) - -diff --git a/exec/totemcrypto.c b/exec/totemcrypto.c -index 69818b8..a97ba62 100644 ---- a/exec/totemcrypto.c -+++ b/exec/totemcrypto.c -@@ -666,6 +666,7 @@ size_t crypto_sec_header_size( - int crypto_cipher = string_to_crypto_cipher_type(crypto_cipher_type); - int crypto_hash = string_to_crypto_hash_type(crypto_hash_type); - size_t hdr_size = 0; -+ int block_size = 0; - - hdr_size = sizeof(struct crypto_config_header); - -@@ -675,7 +676,19 @@ size_t crypto_sec_header_size( - - if (crypto_cipher) { - hdr_size += SALT_SIZE; -- hdr_size += cypher_block_len[crypto_cipher]; -+ if (cypher_block_len[crypto_cipher]) { -+ block_size = cypher_block_len[crypto_cipher]; -+ } else { -+ block_size = PK11_GetBlockSize(crypto_cipher, NULL); -+ if (block_size < 0) { -+ /* -+ * failsafe. we can potentially lose up to 63 -+ * byte per packet, but better than fragmenting -+ */ -+ block_size = 64; -+ } -+ } -+ hdr_size += (block_size * 2); - } - - return hdr_size; --- -1.7.1 - diff --git a/SOURCES/bz1136429-2-Adjust-MTU-for-IPv6-correctly.patch b/SOURCES/bz1136429-2-Adjust-MTU-for-IPv6-correctly.patch deleted file mode 100644 index 167aca4..0000000 --- a/SOURCES/bz1136429-2-Adjust-MTU-for-IPv6-correctly.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 03f95ddaa1d223e1e93788a307dc1b36d86b22b5 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Tue, 30 Sep 2014 17:06:36 +0200 -Subject: [PATCH] Adjust MTU for IPv6 correctly - -MTU for IPv6 is 20 bytes larger then IPv4. This fact was not taken into -account so IPv6 packets were larger then MTU resulting in fragmentation. - -Solution is to substract correct IP header size. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/totemip.c | 22 ++++++++++++++++++++++ - exec/totemudp.c | 6 ++++-- - exec/totemudpu.c | 6 ++++-- - include/corosync/totem/totemip.h | 2 ++ - 4 files changed, 32 insertions(+), 4 deletions(-) - -diff --git a/exec/totemip.c b/exec/totemip.c -index 7ba746e..28a8836 100644 ---- a/exec/totemip.c -+++ b/exec/totemip.c -@@ -488,3 +488,25 @@ finished: - totemip_freeifaddrs(&addrs); - return (res); - } -+ -+#define TOTEMIP_UDP_HEADER_SIZE 8 -+#define TOTEMIP_IPV4_HEADER_SIZE 20 -+#define TOTEMIP_IPV6_HEADER_SIZE 40 -+ -+size_t totemip_udpip_header_size(int family) -+{ -+ size_t header_size; -+ -+ header_size = 0; -+ -+ switch (family) { -+ case AF_INET: -+ header_size = TOTEMIP_UDP_HEADER_SIZE + TOTEMIP_IPV4_HEADER_SIZE; -+ break; -+ case AF_INET6: -+ header_size = TOTEMIP_UDP_HEADER_SIZE + TOTEMIP_IPV6_HEADER_SIZE; -+ break; -+ } -+ -+ return (header_size); -+} -diff --git a/exec/totemudp.c b/exec/totemudp.c -index 4577107..86059af 100644 ---- a/exec/totemudp.c -+++ b/exec/totemudp.c -@@ -1316,10 +1316,12 @@ extern int totemudp_iface_check (void *udp_context) - - extern void totemudp_net_mtu_adjust (void *udp_context, struct totem_config *totem_config) - { --#define UDPIP_HEADER_SIZE (20 + 8) /* 20 bytes for ip 8 bytes for udp */ -+ -+ assert(totem_config->interface_count > 0); -+ - totem_config->net_mtu -= crypto_sec_header_size(totem_config->crypto_cipher_type, - totem_config->crypto_hash_type) + -- UDPIP_HEADER_SIZE; -+ totemip_udpip_header_size(totem_config->interfaces[0].bindnet.family); - } - - const char *totemudp_iface_print (void *udp_context) { -diff --git a/exec/totemudpu.c b/exec/totemudpu.c -index 69837c7..037f82b 100644 ---- a/exec/totemudpu.c -+++ b/exec/totemudpu.c -@@ -952,10 +952,12 @@ extern int totemudpu_iface_check (void *udpu_context) - - extern void totemudpu_net_mtu_adjust (void *udpu_context, struct totem_config *totem_config) - { --#define UDPIP_HEADER_SIZE (20 + 8) /* 20 bytes for ip 8 bytes for udp */ -+ -+ assert(totem_config->interface_count > 0); -+ - totem_config->net_mtu -= crypto_sec_header_size(totem_config->crypto_cipher_type, - totem_config->crypto_hash_type) + -- UDPIP_HEADER_SIZE; -+ totemip_udpip_header_size(totem_config->interfaces[0].bindnet.family); - } - - const char *totemudpu_iface_print (void *udpu_context) { -diff --git a/include/corosync/totem/totemip.h b/include/corosync/totem/totemip.h -index 533735a..0168e66 100644 ---- a/include/corosync/totem/totemip.h -+++ b/include/corosync/totem/totemip.h -@@ -114,6 +114,8 @@ static inline int totemip_zero_check(const struct totem_ip_address *addr) - return (addr->family == 0); - } - -+extern size_t totemip_udpip_header_size(int family); -+ - #ifdef __cplusplus - } - #endif --- -1.7.1 - diff --git a/SOURCES/bz1149916-1-init-Don-t-wait-for-ipc-if-corosync-doesn-t-start.patch b/SOURCES/bz1149916-1-init-Don-t-wait-for-ipc-if-corosync-doesn-t-start.patch deleted file mode 100644 index f2e66e0..0000000 --- a/SOURCES/bz1149916-1-init-Don-t-wait-for-ipc-if-corosync-doesn-t-start.patch +++ /dev/null @@ -1,39 +0,0 @@ -From b627844f3d5c5788bd8bb140d8852ba666da16aa Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Tue, 7 Oct 2014 17:49:10 +0200 -Subject: [PATCH] init: Don't wait for ipc if corosync doesn't start - -Init script now checks return code of executing corosync command. If it -fails, ipc_wait section is skipped, resulting in much faster failure of -init script. - -Signed-off-by: Jan Friesse -Reviewed-by: Fabio M. Di Nitto ---- - init/corosync.in | 7 ++++--- - 1 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/init/corosync.in b/init/corosync.in -index 9b9c66f..c93f971 100755 ---- a/init/corosync.in -+++ b/init/corosync.in -@@ -115,12 +115,13 @@ start() - else - $prog $COROSYNC_OPTIONS > /dev/null 2>&1 - -- if ! wait_for_ipc; then -+ if [ "$?" != 0 ] || ! wait_for_ipc; then - failure - rtrn=1 -+ else -+ touch $LOCK_FILE -+ success - fi -- touch $LOCK_FILE -- success - fi - echo - } --- -1.7.1 - diff --git a/SOURCES/bz1170347-1-Set-RR-priority-by-default.patch b/SOURCES/bz1170347-1-Set-RR-priority-by-default.patch deleted file mode 100644 index e8104aa..0000000 --- a/SOURCES/bz1170347-1-Set-RR-priority-by-default.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 177ef0e5240b4060ff5b14eab6f2eefee3aa777d Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Fri, 2 Jan 2015 12:39:09 +0100 -Subject: [PATCH] Set RR priority by default - -Experience with larger production clusters showed that setting RR -priority for corosync is viable for prevent random fencing, ... - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/main.c | 7 ++++--- - man/corosync.8 | 4 ++-- - 2 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/exec/main.c b/exec/main.c -index e423c97..cd972b5 100644 ---- a/exec/main.c -+++ b/exec/main.c -@@ -1200,7 +1200,7 @@ int main (int argc, char **argv, char **envp) - /* default configuration - */ - background = 1; -- setprio = 0; -+ setprio = 1; - testonly = 0; - - while ((ch = getopt (argc, argv, "fprtv")) != EOF) { -@@ -1210,6 +1210,7 @@ int main (int argc, char **argv, char **envp) - background = 0; - break; - case 'p': -+ setprio = 0; - break; - case 'r': - setprio = 1; -@@ -1228,9 +1229,9 @@ int main (int argc, char **argv, char **envp) - fprintf(stderr, \ - "usage:\n"\ - " -f : Start application in foreground.\n"\ -- " -p : Does nothing. \n"\ -+ " -p : Do not set process priority.\n"\ - " -t : Test configuration and exit.\n"\ -- " -r : Set round robin realtime scheduling \n"\ -+ " -r : Set round robin realtime scheduling (default).\n"\ - " -v : Display version and SVN revision of Corosync and exit.\n"); - logsys_system_fini(); - return EXIT_FAILURE; -diff --git a/man/corosync.8 b/man/corosync.8 -index 559b392..41f634f 100644 ---- a/man/corosync.8 -+++ b/man/corosync.8 -@@ -45,10 +45,10 @@ Corosync provides clustering infracture such as membership, messaging and quorum - Start application in foreground. - .TP - .B -p --Does nothing (was: "Do not set process priority" - this is now the default). -+Do not set process priority. - .TP - .B -r --Set round robin realtime scheduling. -+Set round robin realtime scheduling (default). - .TP - .B -t - Test configuration and then exit. --- -1.7.1 - diff --git a/SOURCES/bz1184154-1-Handle-adding-and-removing-UDPU-members-atomically.patch b/SOURCES/bz1184154-1-Handle-adding-and-removing-UDPU-members-atomically.patch deleted file mode 100644 index 5abc829..0000000 --- a/SOURCES/bz1184154-1-Handle-adding-and-removing-UDPU-members-atomically.patch +++ /dev/null @@ -1,303 +0,0 @@ -From d77cec24d0025d353681762fe707794c621665c7 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Wed, 21 Jan 2015 13:30:48 +0100 -Subject: [PATCH] Handle adding and removing UDPU members atomically - -When config file is reloaded with removed UDPU member, internal icmap -index of nodelist.node can change. This can result in removal and then -adding back node. This, with UDPU alive filtering (where member is by -default considered as not a member) makes corosync not sending messages -to such members resulting in new membership creation. - -Solution is to properly test which members were really deleted and added -(instead of relying on internal and dynamic naming of icmap hash table -key name). - -Also trully dynamic add and remove node (via cmap) is now handled by -same function so totem_config->interfaces is now updated properly. - -Signed-off-by: Jan Friesse -Reviewed-by: Fabio M. Di Nitto ---- - exec/main.c | 67 ------------------------- - exec/totemconfig.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++- - 2 files changed, 134 insertions(+), 70 deletions(-) - -diff --git a/exec/main.c b/exec/main.c -index 85c74ee..0ca5634 100644 ---- a/exec/main.c -+++ b/exec/main.c -@@ -583,71 +583,6 @@ static void corosync_totem_stats_updater (void *data) - &corosync_stats_timer_handle); - } - --static void totem_dynamic_notify( -- int32_t event, -- const char *key_name, -- struct icmap_notify_value new_val, -- struct icmap_notify_value old_val, -- void *user_data) --{ -- int res; -- unsigned int ring_no; -- unsigned int member_no; -- struct totem_ip_address member; -- int add_new_member = 0; -- int remove_old_member = 0; -- char tmp_str[ICMAP_KEYNAME_MAXLEN]; -- -- res = sscanf(key_name, "nodelist.node.%u.ring%u%s", &member_no, &ring_no, tmp_str); -- if (res != 3) -- return ; -- -- if (strcmp(tmp_str, "_addr") != 0) { -- return; -- } -- -- if (event == ICMAP_TRACK_ADD && new_val.type == ICMAP_VALUETYPE_STRING) { -- add_new_member = 1; -- } -- -- if (event == ICMAP_TRACK_DELETE && old_val.type == ICMAP_VALUETYPE_STRING) { -- remove_old_member = 1; -- } -- -- if (event == ICMAP_TRACK_MODIFY && new_val.type == ICMAP_VALUETYPE_STRING && -- old_val.type == ICMAP_VALUETYPE_STRING) { -- add_new_member = 1; -- remove_old_member = 1; -- } -- -- if (remove_old_member) { -- log_printf(LOGSYS_LEVEL_DEBUG, -- "removing dynamic member %s for ring %u", (char *)old_val.data, ring_no); -- if (totemip_parse(&member, (char *)old_val.data, ip_version) == 0) { -- totempg_member_remove (&member, ring_no); -- } -- } -- -- if (add_new_member) { -- log_printf(LOGSYS_LEVEL_DEBUG, -- "adding dynamic member %s for ring %u", (char *)new_val.data, ring_no); -- if (totemip_parse(&member, (char *)new_val.data, ip_version) == 0) { -- totempg_member_add (&member, ring_no); -- } -- } --} -- --static void corosync_totem_dynamic_init (void) --{ -- icmap_track_t icmap_track = NULL; -- -- icmap_track_add("nodelist.node.", -- ICMAP_TRACK_ADD | ICMAP_TRACK_DELETE | ICMAP_TRACK_MODIFY | ICMAP_TRACK_PREFIX, -- totem_dynamic_notify, -- NULL, -- &icmap_track); --} -- - static void corosync_totem_stats_init (void) - { - icmap_set_uint32("runtime.totem.pg.mrp.srp.mtt_rx_token", 0); -@@ -660,7 +595,6 @@ static void corosync_totem_stats_init (void) - &corosync_stats_timer_handle); - } - -- - static void deliver_fn ( - unsigned int nodeid, - const void *msg, -@@ -1093,7 +1027,6 @@ static void main_service_ready (void) - cs_ipcs_init(); - corosync_totem_stats_init (); - corosync_fplay_control_init (); -- corosync_totem_dynamic_init (); - sync_init ( - corosync_sync_callbacks_retrieve, - corosync_sync_completed); -diff --git a/exec/totemconfig.c b/exec/totemconfig.c -index 2acee2a..b678752 100644 ---- a/exec/totemconfig.c -+++ b/exec/totemconfig.c -@@ -532,7 +532,73 @@ static int find_local_node_in_nodelist(struct totem_config *totem_config) - return (local_node_pos); - } - --static void put_nodelist_members_to_config(struct totem_config *totem_config) -+/* -+ * Compute difference between two set of totem interface arrays. set1 and set2 -+ * are changed so for same ring, ip existing in both set1 and set2 are cleared -+ * (set to 0), and ips which are only in set1 or set2 remains untouched. -+ * totempg_node_add/remove is called. -+ */ -+static void compute_interfaces_diff(int interface_count, -+ struct totem_interface *set1, -+ struct totem_interface *set2) -+{ -+ int ring_no, set1_pos, set2_pos; -+ struct totem_ip_address empty_ip_address; -+ -+ memset(&empty_ip_address, 0, sizeof(empty_ip_address)); -+ -+ for (ring_no = 0; ring_no < interface_count; ring_no++) { -+ for (set1_pos = 0; set1_pos < set1[ring_no].member_count; set1_pos++) { -+ for (set2_pos = 0; set2_pos < set2[ring_no].member_count; set2_pos++) { -+ /* -+ * For current ring_no remove all set1 items existing -+ * in set2 -+ */ -+ if (memcmp(&set1[ring_no].member_list[set1_pos], -+ &set2[ring_no].member_list[set2_pos], -+ sizeof(struct totem_ip_address)) == 0) { -+ memset(&set1[ring_no].member_list[set1_pos], 0, -+ sizeof(struct totem_ip_address)); -+ memset(&set2[ring_no].member_list[set2_pos], 0, -+ sizeof(struct totem_ip_address)); -+ } -+ } -+ } -+ } -+ -+ for (ring_no = 0; ring_no < interface_count; ring_no++) { -+ for (set1_pos = 0; set1_pos < set1[ring_no].member_count; set1_pos++) { -+ /* -+ * All items which remained in set1 doesn't exists in set2 any longer so -+ * node has to be removed. -+ */ -+ if (memcmp(&set1[ring_no].member_list[set1_pos], &empty_ip_address, sizeof(empty_ip_address)) != 0) { -+ log_printf(LOGSYS_LEVEL_DEBUG, -+ "removing dynamic member %s for ring %u", -+ totemip_print(&set1[ring_no].member_list[set1_pos]), -+ ring_no); -+ -+ totempg_member_remove(&set1[ring_no].member_list[set1_pos], ring_no); -+ } -+ } -+ for (set2_pos = 0; set2_pos < set2[ring_no].member_count; set2_pos++) { -+ /* -+ * All items which remained in set2 doesn't existed in set1 so this is no node -+ * and has to be added. -+ */ -+ if (memcmp(&set2[ring_no].member_list[set2_pos], &empty_ip_address, sizeof(empty_ip_address)) != 0) { -+ log_printf(LOGSYS_LEVEL_DEBUG, -+ "adding dynamic member %s for ring %u", -+ totemip_print(&set2[ring_no].member_list[set2_pos]), -+ ring_no); -+ -+ totempg_member_add(&set2[ring_no].member_list[set2_pos], ring_no); -+ } -+ } -+ } -+} -+ -+static void put_nodelist_members_to_config(struct totem_config *totem_config, int reload) - { - icmap_iter_t iter, iter2; - const char *iter_key, *iter_key2; -@@ -544,6 +610,22 @@ static void put_nodelist_members_to_config(struct totem_config *totem_config) - int member_count; - unsigned int ringnumber = 0; - int i, j; -+ struct totem_interface *orig_interfaces = NULL; -+ struct totem_interface *new_interfaces = NULL; -+ -+ if (reload) { -+ /* -+ * We need to compute diff only for reload. Also for initial configuration -+ * not all totem structures are initialized so corosync will crash during -+ * member_add/remove -+ */ -+ orig_interfaces = malloc (sizeof (struct totem_interface) * INTERFACE_MAX); -+ assert(orig_interfaces != NULL); -+ new_interfaces = malloc (sizeof (struct totem_interface) * INTERFACE_MAX); -+ assert(new_interfaces != NULL); -+ -+ memcpy(orig_interfaces, totem_config->interfaces, sizeof (struct totem_interface) * INTERFACE_MAX); -+ } - - /* Clear out nodelist so we can put the new one in if needed */ - for (i = 0; i < totem_config->interface_count; i++) { -@@ -590,8 +672,51 @@ static void put_nodelist_members_to_config(struct totem_config *totem_config) - } - - icmap_iter_finalize(iter); -+ -+ if (reload) { -+ memcpy(new_interfaces, totem_config->interfaces, sizeof (struct totem_interface) * INTERFACE_MAX); -+ -+ compute_interfaces_diff(totem_config->interface_count, orig_interfaces, new_interfaces); -+ -+ free(new_interfaces); -+ free(orig_interfaces); -+ } -+} -+ -+static void nodelist_dynamic_notify( -+ int32_t event, -+ const char *key_name, -+ struct icmap_notify_value new_val, -+ struct icmap_notify_value old_val, -+ void *user_data) -+{ -+ int res; -+ unsigned int ring_no; -+ unsigned int member_no; -+ char tmp_str[ICMAP_KEYNAME_MAXLEN]; -+ uint8_t reloading; -+ struct totem_config *totem_config = (struct totem_config *)user_data; -+ -+ /* -+ * If a full reload is in progress then don't do anything until it's done and -+ * can reconfigure it all atomically -+ */ -+ if (icmap_get_uint8("config.totemconfig_reload_in_progress", &reloading) == CS_OK && reloading) { -+ return ; -+ } -+ -+ res = sscanf(key_name, "nodelist.node.%u.ring%u%s", &member_no, &ring_no, tmp_str); -+ if (res != 3) -+ return ; -+ -+ if (strcmp(tmp_str, "_addr") != 0) { -+ return; -+ } -+ -+ put_nodelist_members_to_config(totem_config, 1); - } - -+ - /* - * Tries to find node (node_pos) in config nodelist which address matches any - * local interface. Address can be stored in ring0_addr or if ipaddr_key_prefix is not NULL -@@ -999,7 +1124,7 @@ extern int totem_config_read ( - icmap_set_ro_access("nodelist.local_node_pos", 0, 1); - } - -- put_nodelist_members_to_config(totem_config); -+ put_nodelist_members_to_config(totem_config, 0); - } - - /* -@@ -1362,7 +1487,7 @@ static void totem_reload_notify( - - /* Reload has completed */ - if (*(uint8_t *)new_val.data == 0) { -- put_nodelist_members_to_config (totem_config); -+ put_nodelist_members_to_config (totem_config, 1); - totem_volatile_config_read (totem_config, NULL); - log_printf(LOGSYS_LEVEL_DEBUG, "Configuration reloaded. Dumping actual totem config."); - debug_dump_totem_config(totem_config); -@@ -1401,4 +1526,10 @@ static void add_totem_config_notification(struct totem_config *totem_config) - totem_reload_notify, - totem_config, - &icmap_track); -+ -+ icmap_track_add("nodelist.node.", -+ ICMAP_TRACK_ADD | ICMAP_TRACK_DELETE | ICMAP_TRACK_MODIFY | ICMAP_TRACK_PREFIX, -+ nodelist_dynamic_notify, -+ (void *)totem_config, -+ &icmap_track); - } --- -1.7.1 - diff --git a/SOURCES/bz1197091-1-Votequorum-Fix-auto_tie_breaker-default.patch b/SOURCES/bz1197091-1-Votequorum-Fix-auto_tie_breaker-default.patch deleted file mode 100644 index 7745d0c..0000000 --- a/SOURCES/bz1197091-1-Votequorum-Fix-auto_tie_breaker-default.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 314a01c98e5f98ff686333966dbe675935b7b6a8 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Mon, 2 Mar 2015 15:48:01 +0000 -Subject: [PATCH] Votequorum: Fix auto_tie_breaker default - -The default for auto_tie_breaker should be 'lowest' - which is what it -was before the extended ATB functionality of auto_tie_breaker_node was -added, and what the documentation states. - -However this was broken so that if auto_tie_breaker_node was not -specified then auto_tie_breaker itself was ignored. This patch fixes -that. - -It also fixes a typo in a comment. - -Signed-Off-By: Christine Caulfield -Reviewed-by: Jan Friesse ---- - exec/votequorum.c | 9 +++++++-- - 1 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/exec/votequorum.c b/exec/votequorum.c -index 6caccaf..3757b53 100644 ---- a/exec/votequorum.c -+++ b/exec/votequorum.c -@@ -628,7 +628,7 @@ static int is_in_nodelist(int nodeid, unsigned int *members, int entries) - } - - /* -- * The algorithm for a list of time-breaker nodes is: -+ * The algorithm for a list of tie-breaker nodes is: - * travel the list of nodes in the auto_tie_breaker list, - * if the node IS in our current partition, check if the - * nodes earlier in the atb list are in the 'previous' partition; -@@ -1290,7 +1290,12 @@ static char *votequorum_readconfig(int runtime) - icmap_get_uint8("quorum.auto_tie_breaker", &atb); - icmap_get_string("quorum.auto_tie_breaker_node", &atb_string); - -- if (!atb) { -+ /* auto_tie_breaker defaults to LOWEST */ -+ if (atb) { -+ auto_tie_breaker = ATB_LOWEST; -+ icmap_set_uint32("runtime.votequorum.atb_type", auto_tie_breaker); -+ } -+ else { - auto_tie_breaker = ATB_NONE; - if (atb_string) { - log_printf(LOGSYS_LEVEL_WARNING, --- -1.7.1 - diff --git a/SOURCES/bz1197671-1-Don-t-allow-both-two_node-and-auto_tie_breaker-in-co.patch b/SOURCES/bz1197671-1-Don-t-allow-both-two_node-and-auto_tie_breaker-in-co.patch deleted file mode 100644 index d380bd9..0000000 --- a/SOURCES/bz1197671-1-Don-t-allow-both-two_node-and-auto_tie_breaker-in-co.patch +++ /dev/null @@ -1,40 +0,0 @@ -From c832ade034fa737561ccabefbe417c9d7855d970 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Mon, 2 Mar 2015 15:50:21 +0000 -Subject: [PATCH] Don't allow both two_node and auto_tie_breaker in corosync.conf - -The two_node and auto_tie_breaker options are incompatible as they -specify conflicting methods of determining the quorate half of a cluster -partition. - -This patch detects this error in corosync.conf, issues a message and -disables two_node if auto_tie_breaker is present. - -Signed-Off-By: Christine Caulfield -Reviewed-by: Jan Friesse ---- - exec/votequorum.c | 8 ++++++++ - 1 files changed, 8 insertions(+), 0 deletions(-) - -diff --git a/exec/votequorum.c b/exec/votequorum.c -index 3757b53..2ff0b43 100644 ---- a/exec/votequorum.c -+++ b/exec/votequorum.c -@@ -1323,6 +1323,14 @@ static char *votequorum_readconfig(int runtime) - - } - -+ /* two_node and auto_tie_breaker are not compatible as two_node uses -+ * a fence race to decide quorum whereas ATB decides based on node id -+ */ -+ if (two_node && auto_tie_breaker != ATB_NONE) { -+ log_printf(LOGSYS_LEVEL_CRIT, "two_node and auto_tie_breaker are both specified but are not compatible."); -+ log_printf(LOGSYS_LEVEL_CRIT, "two_node has been disabled, please fix your corosync.conf"); -+ two_node = 0; -+ } - /* - * quorum device is not compatible with last_man_standing and auto_tie_breaker - * neither lms or atb can be set at runtime, so there is no need to check for --- -1.7.1 - diff --git a/SOURCES/bz1225441-1-Log-Add-logrotate-configuration-file.patch b/SOURCES/bz1225441-1-Log-Add-logrotate-configuration-file.patch deleted file mode 100644 index ef2248e..0000000 --- a/SOURCES/bz1225441-1-Log-Add-logrotate-configuration-file.patch +++ /dev/null @@ -1,161 +0,0 @@ -From aabbace625b3c68332b4356887378fca81f8f387 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Fri, 19 Jun 2015 17:42:09 +0200 -Subject: [PATCH] Log: Add logrotate configuration file - -In cman era corosync was depending on logrotate file distributed by -cman. It's good idea to logrotate also on systems without cman (new -clusters). - -Signed-off-by: Jan Friesse -Reviewed-by: Fabio M. Di Nitto ---- - conf/Makefile.am | 2 + - conf/logrotate/Makefile.am | 45 ++++++++++++++++++++++++++++++++++++++++++++ - conf/logrotate/corosync.in | 9 ++++++++ - configure.ac | 17 +++++++++++++++- - corosync.spec.in | 1 + - 5 files changed, 73 insertions(+), 1 deletions(-) - create mode 100644 conf/logrotate/Makefile.am - create mode 100644 conf/logrotate/corosync.in - -diff --git a/conf/Makefile.am b/conf/Makefile.am -index 69f7ff9..807b6cc 100644 ---- a/conf/Makefile.am -+++ b/conf/Makefile.am -@@ -69,3 +69,5 @@ if INSTALL_DBUSCONF - dbusdir = $(sysconfdir)/dbus-1/system.d - dbus_DATA = corosync-signals.conf - endif -+ -+SUBDIRS = logrotate -diff --git a/conf/logrotate/Makefile.am b/conf/logrotate/Makefile.am -new file mode 100644 -index 0000000..a22079b ---- /dev/null -+++ b/conf/logrotate/Makefile.am -@@ -0,0 +1,45 @@ -+# Copyright (c) 2009 Red Hat, Inc. -+# -+# Authors:Jan Friesse (jfriesse@redhat.com) -+# Andrew Beekhof -+# Steven Dake (sdake@redhat.com) -+# -+# This software licensed under BSD license, the text of which follows: -+# -+# Redistribution and use in source and binary forms, with or without -+# modification, are permitted provided that the following conditions are met: -+# -+# - Redistributions of source code must retain the above copyright notice, -+# this list of conditions and the following disclaimer. -+# - Redistributions in binary form must reproduce the above copyright notice, -+# this list of conditions and the following disclaimer in the documentation -+# and/or other materials provided with the distribution. -+# - Neither the name of the MontaVista Software, Inc. nor the names of its -+# contributors may be used to endorse or promote products derived from this -+# software without specific prior written permission. -+# -+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -+# THE POSSIBILITY OF SUCH DAMAGE. -+ -+MAINTAINERCLEANFILES = Makefile.in -+ -+EXTRA_DIST = corosync.in -+ -+corosync: corosync.in -+ sed -e 's#@''LOGDIR@#${LOGDIR}#g' \ -+ $< > $@ -+ -+logrotatecorosyncdir = ${LOGROTATEDIR} -+logrotatecorosync_DATA = corosync -+ -+clean-local: -+ rm -f corosync -diff --git a/conf/logrotate/corosync.in b/conf/logrotate/corosync.in -new file mode 100644 -index 0000000..cba17b0 ---- /dev/null -+++ b/conf/logrotate/corosync.in -@@ -0,0 +1,9 @@ -+@LOGDIR@/corosync.log { -+ missingok -+ compress -+ copytruncate -+ daily -+ rotate 31 -+ minsize 2048 -+ notifempty -+} -diff --git a/configure.ac b/configure.ac -index b394329..4b640fc 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -199,7 +199,8 @@ AC_CONFIG_FILES([Makefile - tools/Makefile - conf/Makefile - qdevices/Makefile -- Doxyfile]) -+ Doxyfile -+ conf/logrotate/Makefile]) - - ### Local business - -@@ -369,6 +370,16 @@ AC_ARG_WITH([initwrappersdir], - [ INITWRAPPERSDIR="$withval" ], - [ INITWRAPPERSDIR="$datarootdir/corosync" ]) - -+AC_ARG_WITH([logdir], -+ [ --logdir=DIR : the base directory for corosync logging files. ], -+ [ LOGDIR="$withval" ], -+ [ LOGDIR="$localstatedir/log/cluster" ]) -+ -+AC_ARG_WITH([logrotatedir], -+ [ --logrotatedir=DIR : the base directory for logrorate.d files. ], -+ [ LOGROTATEDIR="$withval" ], -+ [ LOGROTATEDIR="$sysconfdir/logrotate.d" ]) -+ - AC_ARG_ENABLE([snmp], - [ --enable-snmp : SNMP protocol support ], - [ default="no" ]) -@@ -674,6 +685,8 @@ AC_SUBST([SYSTEMDDIR]) - AC_SUBST([UPSTARTDIR]) - INITWRAPPERSDIR=$(eval echo ${INITWRAPPERSDIR}) - AC_SUBST([INITWRAPPERSDIR]) -+AC_SUBST([LOGDIR]) -+AC_SUBST([LOGROTATEDIR]) - - AC_SUBST([SOMAJOR]) - AC_SUBST([SOMINOR]) -@@ -716,6 +729,8 @@ AC_MSG_RESULT([ System init.d directory = ${INITDDIR}]) - AC_MSG_RESULT([ System systemd directory = ${SYSTEMDDIR}]) - AC_MSG_RESULT([ System upstart directory = ${UPSTARTDIR}]) - AC_MSG_RESULT([ System init wraps dir = ${INITWRAPPERSDIR}]) -+AC_MSG_RESULT([ Log directory = ${LOGDIR}]) -+AC_MSG_RESULT([ Log rotate directory = ${LOGROTATEDIR}]) - AC_MSG_RESULT([ corosync config dir = ${COROSYSCONFDIR}]) - AC_MSG_RESULT([ Features =${PACKAGE_FEATURES}]) - AC_MSG_RESULT([]) -diff --git a/corosync.spec.in b/corosync.spec.in -index a2ba584..12979f6 100644 ---- a/corosync.spec.in -+++ b/corosync.spec.in -@@ -196,6 +196,7 @@ fi - %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu - %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd - %config(noreplace) %{_sysconfdir}/sysconfig/corosync -+%config(noreplace) %{_sysconfdir}/logrotate.d/corosync - %if %{with dbus} - %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf - %endif --- -1.7.1 - diff --git a/SOURCES/bz1226842-1-Add-note-about-rrp-active-beeing-unsupported.patch b/SOURCES/bz1226842-1-Add-note-about-rrp-active-beeing-unsupported.patch deleted file mode 100644 index 30aa3e7..0000000 --- a/SOURCES/bz1226842-1-Add-note-about-rrp-active-beeing-unsupported.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 219965f4fe694eaaf2eb4ea05cdc7e35f5146114 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Fri, 19 Jun 2015 16:16:18 +0200 -Subject: [PATCH] Add note about rrp active beeing unsupported - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - man/corosync.conf.5 | 6 ++++-- - 1 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/man/corosync.conf.5 b/man/corosync.conf.5 -index 8e774c1..2283cd4 100644 ---- a/man/corosync.conf.5 -+++ b/man/corosync.conf.5 -@@ -199,8 +199,10 @@ crypto_cipher and crypto_hash. - .TP - rrp_mode - This specifies the mode of redundant ring, which may be none, active, or --passive. Active replication offers slightly lower latency from transmit --to delivery in faulty network environments but with less performance. -+passive. Currently only 'passive' is supported or tested -+(using 'active' is not recommended). Active replication offers -+slightly lower latency from transmit to delivery in faulty network -+environments but with less performance. - Passive replication may nearly double the speed of the totem protocol - if the protocol doesn't become cpu bound. The final option is none, in - which case only one network interface will be used to operate the totem --- -1.7.1 - diff --git a/SOURCES/bz1229194-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch b/SOURCES/bz1229194-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch deleted file mode 100644 index 9186720..0000000 --- a/SOURCES/bz1229194-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 82526d2fe9137e8b604f1bbae6d6e39ba41377f9 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Mon, 16 Mar 2015 11:37:52 +0000 -Subject: [PATCH] quorum: don't allow quorum_trackstart to be called twice - -If quorum_trackstart() or votequorum_trackstart() are called twice with -CS_TRACK_CHANGES then the client gets added twice to the notifications -list effectively corrupting it. Users have reported segfaults in -corosync when they did this (by mistake!). - -As there's already a tracking_enabled flag in the private-data, we check -that before adding to the list again and return an error if -the process is already registered. - -Signed-off-by: Christine Caulfield -Reviewed-by: Jan Friesse ---- - exec/votequorum.c | 12 ++++++++++-- - exec/vsf_quorum.c | 11 +++++++++-- - 2 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/exec/votequorum.c b/exec/votequorum.c -index 2ff0b43..f6faa25 100644 ---- a/exec/votequorum.c -+++ b/exec/votequorum.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2009-2014 Red Hat, Inc. -+ * Copyright (c) 2009-2015 Red Hat, Inc. - * - * All rights reserved. - * -@@ -2615,8 +2615,10 @@ static void message_handler_req_lib_votequorum_trackstart (void *conn, - const struct req_lib_votequorum_trackstart *req_lib_votequorum_trackstart = message; - struct res_lib_votequorum_status res_lib_votequorum_status; - struct quorum_pd *quorum_pd = (struct quorum_pd *)corosync_api->ipc_private_data_get (conn); -+ cs_error_t error = CS_OK; - - ENTER(); -+ - /* - * If an immediate listing of the current cluster membership - * is requested, generate membership list -@@ -2627,6 +2629,11 @@ static void message_handler_req_lib_votequorum_trackstart (void *conn, - votequorum_exec_send_quorum_notification(conn, req_lib_votequorum_trackstart->context); - } - -+ if (quorum_pd->tracking_enabled) { -+ error = CS_ERR_EXIST; -+ goto response_send; -+ } -+ - /* - * Record requests for tracking - */ -@@ -2640,9 +2647,10 @@ static void message_handler_req_lib_votequorum_trackstart (void *conn, - list_add (&quorum_pd->list, &trackers_list); - } - -+response_send: - res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status); - res_lib_votequorum_status.header.id = MESSAGE_RES_VOTEQUORUM_STATUS; -- res_lib_votequorum_status.header.error = CS_OK; -+ res_lib_votequorum_status.header.error = error; - corosync_api->ipc_response_send(conn, &res_lib_votequorum_status, sizeof(res_lib_votequorum_status)); - - LEAVE(); -diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c -index 2a3a263..a6c739d 100644 ---- a/exec/vsf_quorum.c -+++ b/exec/vsf_quorum.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2008-2012 Red Hat, Inc. -+ * Copyright (c) 2008-2015 Red Hat, Inc. - * - * All rights reserved. - * -@@ -409,6 +409,7 @@ static void message_handler_req_lib_quorum_trackstart (void *conn, - const struct req_lib_quorum_trackstart *req_lib_quorum_trackstart = msg; - struct qb_ipc_response_header res; - struct quorum_pd *quorum_pd = (struct quorum_pd *)corosync_api->ipc_private_data_get (conn); -+ cs_error_t error = CS_OK; - - log_printf(LOGSYS_LEVEL_DEBUG, "got trackstart request on %p", conn); - -@@ -422,6 +423,11 @@ static void message_handler_req_lib_quorum_trackstart (void *conn, - send_library_notification(conn); - } - -+ if (quorum_pd->tracking_enabled) { -+ error = CS_ERR_EXIST; -+ goto response_send; -+ } -+ - /* - * Record requests for tracking - */ -@@ -434,10 +440,11 @@ static void message_handler_req_lib_quorum_trackstart (void *conn, - list_add (&quorum_pd->list, &lib_trackers_list); - } - -+response_send: - /* send status */ - res.size = sizeof(res); - res.id = MESSAGE_RES_QUORUM_TRACKSTART; -- res.error = CS_OK; -+ res.error = error; - corosync_api->ipc_response_send(conn, &res, sizeof(struct qb_ipc_response_header)); - } - --- -1.7.1 - diff --git a/SOURCES/bz1229194-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch b/SOURCES/bz1229194-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch deleted file mode 100644 index b4bd454..0000000 --- a/SOURCES/bz1229194-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch +++ /dev/null @@ -1,77 +0,0 @@ -From b9f5c290b7dedd0a677cdfc25db7dd111245a745 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Thu, 18 Jun 2015 09:57:59 +0100 -Subject: [PATCH] votequorum: Fix auto_tie_breaker behaviour in odd-sized clusters - -auto_tie_breaker can behave incorrectly in the case of a cluster -with an odd number of nodes. It's possible for a partition to -have quorum while the other side has the ATB node, and both will -continue working. (Of course in a properly configured cluster one side -will be fenced but that becomes an indeterminate race .. just what ATB -is supposed to avoid). - -This patch prevents ATB from running in a partition if the 'other' -partition might have quorum, and also mandates the use of wait_for_all -in clusters with an odd number of nodes so that a quorate partition -cannot start services or fence an existing partition with the tie -breaker node. - -Signed-Off-By: Christine Caulfield -Reviewed-by: Jan Friesse ---- - exec/votequorum.c | 31 +++++++++++++++++++++++++++++++ - 1 files changed, 31 insertions(+), 0 deletions(-) - -diff --git a/exec/votequorum.c b/exec/votequorum.c -index f6faa25..62c8cf3 100644 ---- a/exec/votequorum.c -+++ b/exec/votequorum.c -@@ -1011,7 +1011,10 @@ static void are_we_quorate(unsigned int total_votes) - } - - if ((auto_tie_breaker != ATB_NONE) && -+ /* Must be a half (or half-1) split */ - (total_votes == (us->expected_votes / 2)) && -+ /* If the 'other' partition in a split might have quorum then we can't run ATB */ -+ (previous_quorum_members_entries - quorum_members_entries < quorum) && - (check_auto_tie_breaker() == 1)) { - quorate = 1; - } -@@ -1331,6 +1334,34 @@ static char *votequorum_readconfig(int runtime) - log_printf(LOGSYS_LEVEL_CRIT, "two_node has been disabled, please fix your corosync.conf"); - two_node = 0; - } -+ -+ /* If ATB is set and the cluster has an odd number of nodes then wait_for_all needs -+ * to be set so that an isolated half+1 without the tie breaker node -+ * does not have quorum on reboot. -+ */ -+ if ((auto_tie_breaker != ATB_NONE) && (node_expected_votes % 2) && -+ (!wait_for_all)) { -+ if (last_man_standing) { -+ /* if LMS is set too, it's a fatal configuration error. We can't dictate to the user what -+ * they might want so we'll just quit. -+ */ -+ log_printf(LOGSYS_LEVEL_CRIT, "auto_tie_breaker is set, the cluster has an odd number of nodes\n"); -+ log_printf(LOGSYS_LEVEL_CRIT, "and last_man_standing is also set. With this situation a better\n"); -+ log_printf(LOGSYS_LEVEL_CRIT, "solution would be to disable LMS, leave ATB enabled, and also\n"); -+ log_printf(LOGSYS_LEVEL_CRIT, "enable wait_for_all (mandatory for ATB in odd-numbered clusters).\n"); -+ log_printf(LOGSYS_LEVEL_CRIT, "Due to this ambiguity, corosync will fail to start. Please fix your corosync.conf\n"); -+ error = (char *)"configuration error: auto_tie_breaker & last_man_standing not available in odd sized cluster"; -+ goto out; -+ } -+ else { -+ log_printf(LOGSYS_LEVEL_CRIT, "auto_tie_breaker is set and the cluster has an odd number of nodes.\n"); -+ log_printf(LOGSYS_LEVEL_CRIT, "wait_for_all needs to be set for this configuration but it is missing\n"); -+ log_printf(LOGSYS_LEVEL_CRIT, "Therefore auto_tie_breaker has been disabled. Please fix your corosync.conf\n"); -+ auto_tie_breaker = ATB_NONE; -+ icmap_set_uint32("runtime.votequorum.atb_type", auto_tie_breaker); -+ } -+ } -+ - /* - * quorum device is not compatible with last_man_standing and auto_tie_breaker - * neither lms or atb can be set at runtime, so there is no need to check for --- -1.7.1 - diff --git a/SOURCES/bz1234261-1-Reset-timer_problem_decrementer-on-fault.patch b/SOURCES/bz1234261-1-Reset-timer_problem_decrementer-on-fault.patch deleted file mode 100644 index 75afeaa..0000000 --- a/SOURCES/bz1234261-1-Reset-timer_problem_decrementer-on-fault.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8f284b26b3331e1ab252969ba65543e6d9217ab1 Mon Sep 17 00:00:00 2001 -From: Jason -Date: Mon, 8 Dec 2014 16:24:22 +0100 -Subject: [PATCH] Reset timer_problem_decrementer on fault - -After a heartbeat link's FAULTY and its auto re-enable, -active_instance->timer_problem_decrementer did not reset to zero. So in -the next timer_function_active_token_expired() round, -active_timer_problem_decrementer_start() will not be called. This will -result in that the active_instance->counter_problems of this link can -not be decreased any more. Cause rrp lose the ability to tolerate -network fluctuation. - -This problem can be reproduced by the following sequence: -1) Set RRP in active mode, configure at least 2 heartbeat links. -2) Unplug one link till corosync-cfgtool -s shows it is FAULTY. -3) Re-plug this link then corosync-cfgtool -s shows it is active with -no faults. -4) Unplug this link again but quicky re-plug it before it becomes -FAULTY. -5) Finally, you can see corosync-cfgtool -s shows it is in -"Incrementing problem counter" state despite it currently is physically -healthy. - -It can be solved by not forget to reset timer_problem_decrementer to -zero in active_timer_problem_decrementer_cancel(). - -Signed-off-by: Jason -Reviewed-by: Jan Friesse ---- - exec/totemrrp.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/exec/totemrrp.c b/exec/totemrrp.c -index 95a789e..eee9d26 100644 ---- a/exec/totemrrp.c -+++ b/exec/totemrrp.c -@@ -1542,6 +1542,7 @@ static void active_timer_problem_decrementer_cancel ( - qb_loop_timer_del ( - active_instance->rrp_instance->poll_handle, - active_instance->timer_problem_decrementer); -+ active_instance->timer_problem_decrementer = 0; - } - - --- -1.7.1 - diff --git a/SOURCES/bz1234261-2-totem-Ignore-duplicated-commit-tokens-in-recovery.patch b/SOURCES/bz1234261-2-totem-Ignore-duplicated-commit-tokens-in-recovery.patch deleted file mode 100644 index c929676..0000000 --- a/SOURCES/bz1234261-2-totem-Ignore-duplicated-commit-tokens-in-recovery.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 4ee84c51fa73c4ec7cbee922111a140a3aaf75df Mon Sep 17 00:00:00 2001 -From: Jason -Date: Sat, 10 Jan 2015 17:35:47 +0800 -Subject: [PATCH] totem: Ignore duplicated commit tokens in recovery - -In active rrp mode, commit tokens are treated as mcast data messages, -thus, rrp directly delivers them to srp layer by active_mcast_recv(). -This will result in duplicated commit tokens being received by srp from -different heartbeat links. If node is in recovery state and has already -sent out the initial orf token, those duplicated commit tokens will -cause message_handler_memb_commit_token() to send initial orf token -again! This is wrong because it resets the orf token content in -instance->orf_token_retransmit, which breaks the token retransmission -state. - -Furthermore, by sending those initial orf tokens again and again, -it may lead active_token_recv() to drop some subsequent orf tokens. -It is OK for rrp because srp will do token retransmission, -but as said above, srp retransmission state has already been broken, -so finally we meet a "token lost in recovery state" condition caused -by software. If token timeout value is large, then it will takes long -time to create a new ring. - -This can be reproduced by having two noded set to active rrp mode, with -two heartbeat links. Then with one node always on, let the other one do -stop/start again and again. It has a low probability to reproduce. -In theory, I think, the more heartbeat links used, the more easily it -can be reproduced. - -This problem can be resolved by letting -message_handler_memb_commit_token() to ignore duplicated commit tokens -in recovery state if node (the ring representation) has already sent -out the initial orf token. - -Different from prev take, this version do not depends on stored token -data but uses originated_orf_token in totemsrp_instance to remember -if initial orf token has been already originated for current membership. - -Signed-off-by: Jason -Reviewed-by: Steven Dake -Reviewed-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/totemsrp.c | 16 ++++++++++++++++ - 1 files changed, 16 insertions(+), 0 deletions(-) - -diff --git a/exec/totemsrp.c b/exec/totemsrp.c -index 95736b1..b05773a 100644 ---- a/exec/totemsrp.c -+++ b/exec/totemsrp.c -@@ -508,6 +508,8 @@ struct totemsrp_instance { - - uint32_t orf_token_discard; - -+ uint32_t originated_orf_token; -+ - uint32_t threaded_mode_enabled; - - uint32_t waiting_trans_ack; -@@ -731,6 +733,8 @@ static void totemsrp_instance_initialize (struct totemsrp_instance *instance) - - instance->orf_token_discard = 0; - -+ instance->originated_orf_token = 0; -+ - instance->commit_token = (struct memb_commit_token *)instance->commit_token_storage; - - instance->my_id.no_addrs = INTERFACE_MAX; -@@ -1834,6 +1838,8 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance) - char left_node_msg[1024]; - char joined_node_msg[1024]; - -+ instance->originated_orf_token = 0; -+ - memb_consensus_reset (instance); - - old_ring_state_reset (instance); -@@ -2045,6 +2051,8 @@ static void memb_state_gather_enter ( - { - instance->orf_token_discard = 1; - -+ instance->originated_orf_token = 0; -+ - memb_set_merge ( - &instance->my_id, 1, - instance->my_proc_list, &instance->my_proc_list_entries); -@@ -4510,6 +4518,14 @@ static int message_handler_memb_commit_token ( - - case MEMB_STATE_RECOVERY: - if (totemip_equal (&instance->my_id.addr[0], &instance->my_ring_id.rep)) { -+ -+ /* Filter out duplicated tokens */ -+ if (instance->originated_orf_token) { -+ break; -+ } -+ -+ instance->originated_orf_token = 1; -+ - log_printf (instance->totemsrp_log_level_debug, - "Sending initial ORF token"); - --- -1.7.1 - diff --git a/SOURCES/bz1234266-1-corosync_ring_id_store-Use-safer-permissions.patch b/SOURCES/bz1234266-1-corosync_ring_id_store-Use-safer-permissions.patch deleted file mode 100644 index 3428d3c..0000000 --- a/SOURCES/bz1234266-1-corosync_ring_id_store-Use-safer-permissions.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 252b38ab8a62ff083e83b1d6f514109f7b7cbb42 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Tue, 20 Jan 2015 10:24:34 +0100 -Subject: [PATCH] corosync_ring_id_store: Use safer permissions - -corosync_ring_id_store should use same (safer) permissions as -corosync_ring_id_create_or_load for (eventually) newly created ringid -file. - -Credit to Sjerek for finding this problem. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/main.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/exec/main.c b/exec/main.c -index cd972b5..85c74ee 100644 ---- a/exec/main.c -+++ b/exec/main.c -@@ -782,9 +782,9 @@ static void corosync_ring_id_store ( - snprintf (filename, sizeof(filename), "%s/ringid_%s", - get_run_dir(), totemip_print (addr)); - -- fd = open (filename, O_WRONLY, 0777); -+ fd = open (filename, O_WRONLY, 0700); - if (fd == -1) { -- fd = open (filename, O_CREAT|O_RDWR, 0777); -+ fd = open (filename, O_CREAT|O_RDWR, 0700); - } - if (fd == -1) { - LOGSYS_PERROR(errno, LOGSYS_LEVEL_ERROR, --- -1.7.1 - diff --git a/SOURCES/bz1283067-1-totemudp-Move-udp-bind-so-that-multicast-works-with-.patch b/SOURCES/bz1283067-1-totemudp-Move-udp-bind-so-that-multicast-works-with-.patch deleted file mode 100644 index 89b618c..0000000 --- a/SOURCES/bz1283067-1-totemudp-Move-udp-bind-so-that-multicast-works-with-.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 165561df9ba1e0be2a11ff550b70da94990eb2f5 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Mon, 16 Nov 2015 16:00:36 +0000 -Subject: [PATCH] totemudp: Move udp bind() so that multicast works with IPv6 - -It seems that the IPv6 multicast parameters only take effect when bind() -is called, so I've moved the mcast recv socket bind() to the bottom of -totemudp_build_sockets_ip(). - -Signed-off-by: Christine Caulfield -Reviewed-by: Jan Friesse ---- - exec/totemudp.c | 26 ++++++++++++++------------ - 1 files changed, 14 insertions(+), 12 deletions(-) - -diff --git a/exec/totemudp.c b/exec/totemudp.c -index 8ed87ce..31d0570 100644 ---- a/exec/totemudp.c -+++ b/exec/totemudp.c -@@ -761,18 +761,6 @@ static int totemudp_build_sockets_ip ( - } - - /* -- * Bind to multicast socket used for multicast receives -- */ -- totemip_totemip_to_sockaddr_convert(mcast_address, -- instance->totem_interface->ip_port, &sockaddr, &addrlen); -- res = bind (sockets->mcast_recv, (struct sockaddr *)&sockaddr, addrlen); -- if (res == -1) { -- LOGSYS_PERROR (errno, instance->totemudp_log_level_warning, -- "Unable to bind the socket to receive multicast packets"); -- return (-1); -- } -- -- /* - * Create local multicast loop socket - */ - if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets->local_mcast_loop) == -1) { -@@ -1054,6 +1042,20 @@ static int totemudp_build_sockets_ip ( - break; - } - -+ /* -+ * Bind to multicast socket used for multicast receives -+ * This needs to happen after all of the multicast setsockopt() calls -+ * as the kernel seems to only put them into effect (for IPV6) when bind() -+ * is called. -+ */ -+ totemip_totemip_to_sockaddr_convert(mcast_address, -+ instance->totem_interface->ip_port, &sockaddr, &addrlen); -+ res = bind (sockets->mcast_recv, (struct sockaddr *)&sockaddr, addrlen); -+ if (res == -1) { -+ LOGSYS_PERROR (errno, instance->totemudp_log_level_warning, -+ "Unable to bind the socket to receive multicast packets"); -+ return (-1); -+ } - return 0; - } - --- -1.7.1 - diff --git a/SOURCES/bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch b/SOURCES/bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch deleted file mode 100644 index 7c31ab7..0000000 --- a/SOURCES/bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 60565b7da7d271651c30cd7fdca6e3f3eb5327ac Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Wed, 6 Apr 2016 15:49:09 +0200 -Subject: [PATCH] totemconfig: Explicitly pass IP version - -If resolver was set to prefer IPv6 (almost always) and interface section -was not defined (almost all config files created by pcs), IP version was -set to mcast_addr.family. Because mcast_addr.family was unset (reset to -zero), IPv6 address was returned causing failure in totemsrp. -Solution is to pass correct IP version stored in -totem_config->ip_version. - -Patch also simplifies get_cluster_mcast_addr. It was using mix of -explicitly passed IP version and bindnet IP version. - -Also return value of get_cluster_mcast_addr is now properly checked. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/totemconfig.c | 10 ++++++---- - 1 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/exec/totemconfig.c b/exec/totemconfig.c -index f232ea8..32c9f88 100644 ---- a/exec/totemconfig.c -+++ b/exec/totemconfig.c -@@ -446,7 +446,6 @@ static uint16_t generate_cluster_id (const char *cluster_name) - - static int get_cluster_mcast_addr ( - const char *cluster_name, -- const struct totem_ip_address *bindnet, - unsigned int ringnumber, - int ip_version, - struct totem_ip_address *res) -@@ -462,7 +461,7 @@ static int get_cluster_mcast_addr ( - clusterid = generate_cluster_id(cluster_name) + ringnumber; - memset (res, 0, sizeof(*res)); - -- switch (bindnet->family) { -+ switch (ip_version) { - case AF_INET: - snprintf(addr, sizeof(addr), "239.192.%d.%d", clusterid >> 8, clusterid % 0xFF); - break; -@@ -1088,7 +1087,7 @@ extern int totem_config_read ( - */ - if (icmap_get_string(iter_key, &str) == CS_OK) { - res = totemip_parse (&totem_config->interfaces[ringnumber].bindnet, str, -- totem_config->interfaces[ringnumber].mcast_addr.family); -+ totem_config->ip_version); - free(str); - } - -@@ -1105,10 +1104,13 @@ extern int totem_config_read ( - * (if available) - */ - res = get_cluster_mcast_addr (cluster_name, -- &totem_config->interfaces[ringnumber].bindnet, - ringnumber, - totem_config->ip_version, - &totem_config->interfaces[ringnumber].mcast_addr); -+ if (res != 0) { -+ *error_string = "Can't autogenerate multicast address"; -+ return -1; -+ } - } - - snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "totem.interface.%u.broadcast", ringnumber); --- -1.7.1 - diff --git a/SOURCES/bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch b/SOURCES/bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch deleted file mode 100644 index 783c248..0000000 --- a/SOURCES/bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8ab7743068cc6cd5bf235d1ccae65de1d91784f0 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Tue, 17 May 2016 12:04:13 +0200 -Subject: [PATCH] cmapctl: Handle corosync errors in print_key func - -print_key handles only CS_ERR_TRY_AGAIN error. If different error is -returned, print_key loops forewer. - -Solution is to handle all errors. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - tools/corosync-cmapctl.c | 11 ++++++----- - 1 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/tools/corosync-cmapctl.c b/tools/corosync-cmapctl.c -index a8da499..d31a73d 100644 ---- a/tools/corosync-cmapctl.c -+++ b/tools/corosync-cmapctl.c -@@ -284,15 +284,16 @@ static void print_key(cmap_handle_t handle, - break; - } - -- if (err == CS_OK) -+ if (err == CS_OK) { - end_loop = 1; -- -- if (err == CS_ERR_TRY_AGAIN) { -+ } else if (err == CS_ERR_TRY_AGAIN) { - sleep(1); - no_retries++; -- } - -- if (no_retries > MAX_TRY_AGAIN) { -+ if (no_retries > MAX_TRY_AGAIN) { -+ end_loop = 1; -+ } -+ } else { - end_loop = 1; - } - }; --- -1.7.1 - diff --git a/SOURCES/bz1363654-1-Config-Flag-config-uidgid-entries.patch b/SOURCES/bz1363654-1-Config-Flag-config-uidgid-entries.patch new file mode 100644 index 0000000..fa9d90d --- /dev/null +++ b/SOURCES/bz1363654-1-Config-Flag-config-uidgid-entries.patch @@ -0,0 +1,129 @@ +From f837f95dfe96d60f2367e900efd4def7a07b2a89 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Wed, 3 Aug 2016 16:51:51 +0200 +Subject: [PATCH] Config: Flag config uidgid entries + +Uidgid entries parsed from configuration files now has prefix +(uidgid.config.) so they are distinguishable from dynamically added +entries. Entries added from config file are pruned on reload if no +longer exists in config file (dynamic one stays unaffected). Also whole +uidgid.config. prefix is made read only. + +This make PCMK work again after configuration reload is called. + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +--- + exec/cfg.c | 2 +- + exec/coroparse.c | 8 ++++---- + exec/ipc_glue.c | 8 ++++++++ + exec/main.c | 1 + + man/cmap_keys.8 | 4 +++- + 5 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/exec/cfg.c b/exec/cfg.c +index 87e49c4..4e62d73 100644 +--- a/exec/cfg.c ++++ b/exec/cfg.c +@@ -703,7 +703,7 @@ static void message_handler_req_exec_cfg_reload_config ( + remove_deleted_entries(temp_map, "totem."); + remove_deleted_entries(temp_map, "nodelist."); + remove_deleted_entries(temp_map, "quorum."); +- remove_deleted_entries(temp_map, "uidgid."); ++ remove_deleted_entries(temp_map, "uidgid.config."); + + /* Remove entries that cannot be changed */ + remove_ro_entries(temp_map); +diff --git a/exec/coroparse.c b/exec/coroparse.c +index 4c1fea9..374ed7d 100644 +--- a/exec/coroparse.c ++++ b/exec/coroparse.c +@@ -794,7 +794,7 @@ static int main_config_parser_cb(const char *path, + *error_string = error_string_response; + return (0); + } +- snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.uid.%u", ++ snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.config.uid.%u", + uid); + icmap_set_uint8_r(config_map, key_name, 1); + add_as_string = 0; +@@ -804,7 +804,7 @@ static int main_config_parser_cb(const char *path, + *error_string = error_string_response; + return (0); + } +- snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.gid.%u", ++ snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.config.gid.%u", + gid); + icmap_set_uint8_r(config_map, key_name, 1); + add_as_string = 0; +@@ -1203,7 +1203,7 @@ static int uidgid_config_parser_cb(const char *path, + *error_string = error_string_response; + return (0); + } +- snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.uid.%u", ++ snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.config.uid.%u", + uid); + icmap_set_uint8_r(config_map, key_name, 1); + } else if (strcmp(path, "uidgid.gid") == 0) { +@@ -1212,7 +1212,7 @@ static int uidgid_config_parser_cb(const char *path, + *error_string = error_string_response; + return (0); + } +- snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.gid.%u", ++ snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.config.gid.%u", + gid); + icmap_set_uint8_r(config_map, key_name, 1); + } else { +diff --git a/exec/ipc_glue.c b/exec/ipc_glue.c +index 79ee4df..c8cbbf8 100644 +--- a/exec/ipc_glue.c ++++ b/exec/ipc_glue.c +@@ -194,10 +194,18 @@ static int32_t cs_ipcs_connection_accept (qb_ipcs_connection_t *c, uid_t euid, g + if (icmap_get_uint8(key_name, &u8) == CS_OK && u8 == 1) + return 0; + ++ snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.config.uid.%u", euid); ++ if (icmap_get_uint8(key_name, &u8) == CS_OK && u8 == 1) ++ return 0; ++ + snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.gid.%u", egid); + if (icmap_get_uint8(key_name, &u8) == CS_OK && u8 == 1) + return 0; + ++ snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "uidgid.config.gid.%u", egid); ++ if (icmap_get_uint8(key_name, &u8) == CS_OK && u8 == 1) ++ return 0; ++ + log_printf(LOGSYS_LEVEL_ERROR, "Denied connection attempt from %d:%d", euid, egid); + + return -EACCES; +diff --git a/exec/main.c b/exec/main.c +index 54df1b6..82fb808 100644 +--- a/exec/main.c ++++ b/exec/main.c +@@ -1011,6 +1011,7 @@ static void set_icmap_ro_keys_flag (void) + icmap_set_ro_access("runtime.totem.", CS_TRUE, CS_TRUE); + icmap_set_ro_access("runtime.services.", CS_TRUE, CS_TRUE); + icmap_set_ro_access("runtime.config.", CS_TRUE, CS_TRUE); ++ icmap_set_ro_access("uidgid.config.", CS_TRUE, CS_TRUE); + + /* + * Set RO flag for constrete keys of configuration which can't be changed +diff --git a/man/cmap_keys.8 b/man/cmap_keys.8 +index a17147a..7517788 100644 +--- a/man/cmap_keys.8 ++++ b/man/cmap_keys.8 +@@ -275,7 +275,9 @@ State of the client. Can be one of failed, stopped, running and waiting for quor + .TP + uidgid.* + Information about users/groups which are allowed to make IPC connections to +-corosync. ++corosync. Entries loaded from configuration file are stored with ++uidgid.config.* prefix and are pruned on configuration file reload. Dynamic ++entries has uidgid.* prefix and a configuration file reload doesn't affect them. + + .TP + quorum.cancel_wait_for_all +-- +1.7.1 + diff --git a/SOURCES/bz1367813-1-Man-Fix-corosync-qdevice-net-certutil-link.patch b/SOURCES/bz1367813-1-Man-Fix-corosync-qdevice-net-certutil-link.patch new file mode 100644 index 0000000..84ed4a0 --- /dev/null +++ b/SOURCES/bz1367813-1-Man-Fix-corosync-qdevice-net-certutil-link.patch @@ -0,0 +1,26 @@ +From 49a9f722bba13e4b2762151b7b96b1d4196fd5e0 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Tue, 9 Aug 2016 17:03:17 +0200 +Subject: [PATCH] Man: Fix corosync-qdevice-net-certutil link + +Signed-off-by: Jan Friesse +--- + man/corosync-qdevice.8 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/man/corosync-qdevice.8 b/man/corosync-qdevice.8 +index d84597c..fbeb328 100644 +--- a/man/corosync-qdevice.8 ++++ b/man/corosync-qdevice.8 +@@ -310,7 +310,7 @@ Maximum connection timeout accepted by client in ms. (120000) + Enable test algorithm. (if built with --enable-debug on, otherwise off) + .SH SEE ALSO + .BR corosync-qdevice-tool (8) +-.BR corosync-qdevice-certutil (8) ++.BR corosync-qdevice-net-certutil (8) + .BR corosync-qnetd (8) + .BR corosync.conf (5) + .SH AUTHOR +-- +1.7.1 + diff --git a/SOURCES/bz1367813-2-man-mention-qdevice-incompatibilites-in-votequorum.5.patch b/SOURCES/bz1367813-2-man-mention-qdevice-incompatibilites-in-votequorum.5.patch new file mode 100644 index 0000000..f2314fc --- /dev/null +++ b/SOURCES/bz1367813-2-man-mention-qdevice-incompatibilites-in-votequorum.5.patch @@ -0,0 +1,40 @@ +From 0da1b7446239424b76b1d5eb7c3640afce9b054e Mon Sep 17 00:00:00 2001 +From: Christine Caulfield +Date: Fri, 12 Aug 2016 14:25:39 +0100 +Subject: [PATCH] man: mention qdevice incompatibilites in votequorum.5 + +Signed-off-by: Christine Caulfield +--- + man/votequorum.5 | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/man/votequorum.5 b/man/votequorum.5 +index 43d7c28..ee4814a 100644 +--- a/man/votequorum.5 ++++ b/man/votequorum.5 +@@ -225,7 +225,10 @@ NOTES: In order for the cluster to downgrade automatically from 2 nodes + to a 1 node cluster, the auto_tie_breaker feature must also be enabled (see below). + If auto_tie_breaker is not enabled, and one more failure occours, the + remaining node will not be quorate. LMS does not work with asymmetric voting +-schemes, each node must vote 1. ++schemes, each node must vote 1. LMS is also incompatible with quorum devices, ++if last_man_standing is specified in corosync.conf then the quorum device ++will be disabled. ++ + .PP + Example configuration 1: + .nf +@@ -270,7 +273,9 @@ be required to maintain quorum. If a (space-separated) list is given, the + nodes are evaluated in order, so if the first node is present then it will + be used to determine the quorate partition, if that node is not in either + half (ie was not in the cluster before the split) then the second node ID +-will be checked for and so on. ++will be checked for and so on. ATB is incompatible with quorum devices - ++if auto_tie_breaker is specified in corosync.conf then the quorum device ++will be disabled. + .PP + Example configuration 1: + .nf +-- +1.7.1 + diff --git a/SOURCES/bz1367813-3-Qnetd-LMS-Fix-two-partition-use-case.patch b/SOURCES/bz1367813-3-Qnetd-LMS-Fix-two-partition-use-case.patch new file mode 100644 index 0000000..1d123be --- /dev/null +++ b/SOURCES/bz1367813-3-Qnetd-LMS-Fix-two-partition-use-case.patch @@ -0,0 +1,81 @@ +From b0c850f308d44ddcdf1a1f881c1e1142ad489385 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Tue, 30 Aug 2016 16:57:31 +0200 +Subject: [PATCH] Qnetd LMS: Fix two partition use case + +Solves situation when in 2 node cluster tie-breaker node dies. Because +code contains two bugs, other node got NACK instead of ACK. + +- Algo timer is not stack, so calling abort and schedule in timer +callback without setting reschedule is noop. +- It's needed to check not only what current node thinks about +membership, but also what other nodes thinks. If views diverge -> wait. + +Thanks Christine Caulfield for fixing the English +in the comments somewhat. + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +--- + qdevices/qnetd-algo-lms.c | 12 ++++++++++++ + qdevices/qnetd-algo-utils.c | 14 ++++++++++++++ + 2 files changed, 26 insertions(+), 0 deletions(-) + +diff --git a/qdevices/qnetd-algo-lms.c b/qdevices/qnetd-algo-lms.c +index 55a1bb2..cdd86c4 100644 +--- a/qdevices/qnetd-algo-lms.c ++++ b/qdevices/qnetd-algo-lms.c +@@ -361,6 +361,18 @@ qnetd_algo_lms_timer_callback(struct qnetd_client *client, int *reschedule_timer + (*result_vote == TLV_VOTE_ACK || *result_vote == TLV_VOTE_NACK)) { + *send_vote = 1; + } ++ ++ if (ret == TLV_REPLY_ERROR_CODE_NO_ERROR && ++ *result_vote == TLV_VOTE_WAIT_FOR_REPLY) { ++ /* ++ * Reschedule was called in the do_lms_algorithm but algo_timer is ++ * not stack based so there can only be one. So if do_lms aborted ++ * the active timer, and scheduled it again the timer would be aborted ++ * if reschedule_timer was not set. ++ */ ++ *reschedule_timer = 1; ++ } ++ + return ret; + } + +diff --git a/qdevices/qnetd-algo-utils.c b/qdevices/qnetd-algo-utils.c +index 440f81f..e26b40a 100644 +--- a/qdevices/qnetd-algo-utils.c ++++ b/qdevices/qnetd-algo-utils.c +@@ -65,6 +65,19 @@ qnetd_algo_all_ring_ids_match(struct qnetd_client *client, const struct tlv_ring + } + } + ++ if (in_our_partition == 0) { ++ /* ++ * Also try to look from the other side to see if we are ++ * not in the other node's membership list. ++ * Because if so it may mean the membership lists are not equal ++ */ ++ TAILQ_FOREACH(node_info, &other_client->last_membership_node_list, entries) { ++ if (node_info->node_id == client->node_id) { ++ in_our_partition = 1; ++ } ++ } ++ } ++ + /* + * If the other nodes on our side of a partition have a different ring ID then + * we need to wait until they have all caught up before making a decision +@@ -74,6 +87,7 @@ qnetd_algo_all_ring_ids_match(struct qnetd_client *client, const struct tlv_ring + return (-1); /* ring IDs don't match */ + } + } ++ + return (0); + } + +-- +1.7.1 + diff --git a/SOURCES/bz682771-1-cpg-Add-support-for-messages-larger-than-1Mb.patch b/SOURCES/bz682771-1-cpg-Add-support-for-messages-larger-than-1Mb.patch deleted file mode 100644 index 2c99a81..0000000 --- a/SOURCES/bz682771-1-cpg-Add-support-for-messages-larger-than-1Mb.patch +++ /dev/null @@ -1,717 +0,0 @@ -From 8cc8e513633a1a8b12c416e32fb5362fcf4d65dd Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Thu, 5 Mar 2015 16:45:15 +0000 -Subject: [PATCH] cpg: Add support for messages larger than 1Mb - -If a cpg client sends a message larger than 1Mb (actually slightly -less to allow for internal buffers) cpg will now fragment that into -several corosync messages before sending it around the ring. - -cpg_mcast_joined() can now return CS_ERR_INTERRUPT which means that the -cpg membership was disrupted during the send operation and the message -needs to be resent. - -The new API call cpg_max_atomic_msgsize_get() returns the maximum size -of a message that will not be fragmented internally. - -New test program cpghum was written to stress test this functionality, -it checks message integrity and order of receipt. - -Signed-off-by: Christine Caulfield -Reviewed-by: Jan Friesse ---- - configure.ac | 1 + - corosync.spec.in | 1 + - exec/cpg.c | 182 +++++++++++++++++++++++++++++++++++++++++++- - include/corosync/cpg.h | 7 ++ - include/corosync/ipc_cpg.h | 35 ++++++++- - lib/cpg.c | 171 ++++++++++++++++++++++++++++++++++++++++- - test/Makefile.am | 3 +- - 7 files changed, 393 insertions(+), 7 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 0c371aa..b394329 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -163,6 +163,7 @@ AC_CHECK_LIB([pthread], [pthread_create]) - AC_CHECK_LIB([socket], [socket]) - AC_CHECK_LIB([nsl], [t_open]) - AC_CHECK_LIB([rt], [sched_getscheduler]) -+AC_CHECK_LIB([z], [crc32]) - - # Checks for library functions. - AC_FUNC_ALLOCA -diff --git a/corosync.spec.in b/corosync.spec.in -index 3ca75b7..a2ba584 100644 ---- a/corosync.spec.in -+++ b/corosync.spec.in -@@ -40,6 +40,7 @@ Conflicts: openais <= 0.89, openais-devel <= 0.89 - BuildRequires: groff - BuildRequires: libqb-devel - BuildRequires: nss-devel -+BuildRequires: zlib-devel - %if %{with runautogen} - BuildRequires: autoconf automake libtool - %endif -diff --git a/exec/cpg.c b/exec/cpg.c -index 1c6fbb9..a18b850 100644 ---- a/exec/cpg.c -+++ b/exec/cpg.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2006-2012 Red Hat, Inc. -+ * Copyright (c) 2006-2015 Red Hat, Inc. - * - * All rights reserved. - * -@@ -83,7 +83,8 @@ enum cpg_message_req_types { - MESSAGE_REQ_EXEC_CPG_JOINLIST = 2, - MESSAGE_REQ_EXEC_CPG_MCAST = 3, - MESSAGE_REQ_EXEC_CPG_DOWNLIST_OLD = 4, -- MESSAGE_REQ_EXEC_CPG_DOWNLIST = 5 -+ MESSAGE_REQ_EXEC_CPG_DOWNLIST = 5, -+ MESSAGE_REQ_EXEC_CPG_PARTIAL_MCAST = 6, - }; - - struct zcb_mapped { -@@ -156,6 +157,8 @@ struct cpg_pd { - enum cpd_state cpd_state; - unsigned int flags; - int initial_totem_conf_sent; -+ uint64_t transition_counter; /* These two are used when sending fragmented messages */ -+ uint64_t initial_transition_counter; - struct list_head list; - struct list_head iteration_instance_list_head; - struct list_head zcb_mapped_list_head; -@@ -224,6 +227,10 @@ static void message_handler_req_exec_cpg_mcast ( - const void *message, - unsigned int nodeid); - -+static void message_handler_req_exec_cpg_partial_mcast ( -+ const void *message, -+ unsigned int nodeid); -+ - static void message_handler_req_exec_cpg_downlist_old ( - const void *message, - unsigned int nodeid); -@@ -238,6 +245,8 @@ static void exec_cpg_joinlist_endian_convert (void *msg); - - static void exec_cpg_mcast_endian_convert (void *msg); - -+static void exec_cpg_partial_mcast_endian_convert (void *msg); -+ - static void exec_cpg_downlist_endian_convert_old (void *msg); - - static void exec_cpg_downlist_endian_convert (void *msg); -@@ -250,6 +259,8 @@ static void message_handler_req_lib_cpg_finalize (void *conn, const void *messag - - static void message_handler_req_lib_cpg_mcast (void *conn, const void *message); - -+static void message_handler_req_lib_cpg_partial_mcast (void *conn, const void *message); -+ - static void message_handler_req_lib_cpg_membership (void *conn, - const void *message); - -@@ -383,7 +394,10 @@ static struct corosync_lib_handler cpg_lib_engine[] = - .lib_handler_fn = message_handler_req_lib_cpg_zc_execute, - .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED - }, -- -+ { /* 12 */ -+ .lib_handler_fn = message_handler_req_lib_cpg_partial_mcast, -+ .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED -+ }, - - }; - -@@ -413,6 +427,10 @@ static struct corosync_exec_handler cpg_exec_engine[] = - .exec_handler_fn = message_handler_req_exec_cpg_downlist, - .exec_endian_convert_fn = exec_cpg_downlist_endian_convert - }, -+ { /* 6 - MESSAGE_REQ_EXEC_CPG_PARTIAL_MCAST */ -+ .exec_handler_fn = message_handler_req_exec_cpg_partial_mcast, -+ .exec_endian_convert_fn = exec_cpg_partial_mcast_endian_convert -+ }, - }; - - struct corosync_service_engine cpg_service_engine = { -@@ -457,6 +475,17 @@ struct req_exec_cpg_mcast { - mar_uint8_t message[] __attribute__((aligned(8))); - }; - -+struct req_exec_cpg_partial_mcast { -+ struct qb_ipc_request_header header __attribute__((aligned(8))); -+ mar_cpg_name_t group_name __attribute__((aligned(8))); -+ mar_uint32_t msglen __attribute__((aligned(8))); -+ mar_uint32_t fraglen __attribute__((aligned(8))); -+ mar_uint32_t pid __attribute__((aligned(8))); -+ mar_uint32_t type __attribute__((aligned(8))); -+ mar_message_source_t source __attribute__((aligned(8))); -+ mar_uint8_t message[] __attribute__((aligned(8))); -+}; -+ - struct req_exec_cpg_downlist_old { - struct qb_ipc_request_header header __attribute__((aligned(8))); - mar_uint32_t left_nodes __attribute__((aligned(8))); -@@ -740,6 +769,7 @@ static int notify_lib_joinlist( - cpd->cpd_state == CPD_STATE_LEAVE_STARTED) { - - api->ipc_dispatch_send (cpd->conn, buf, size); -+ cpd->transition_counter++; - } - if (left_list_entries) { - if (left_list[0].pid == cpd->pid && -@@ -1186,6 +1216,19 @@ static void exec_cpg_mcast_endian_convert (void *msg) - swab_mar_message_source_t (&req_exec_cpg_mcast->source); - } - -+static void exec_cpg_partial_mcast_endian_convert (void *msg) -+{ -+ struct req_exec_cpg_partial_mcast *req_exec_cpg_mcast = msg; -+ -+ swab_coroipc_request_header_t (&req_exec_cpg_mcast->header); -+ swab_mar_cpg_name_t (&req_exec_cpg_mcast->group_name); -+ req_exec_cpg_mcast->pid = swab32(req_exec_cpg_mcast->pid); -+ req_exec_cpg_mcast->msglen = swab32(req_exec_cpg_mcast->msglen); -+ req_exec_cpg_mcast->fraglen = swab32(req_exec_cpg_mcast->fraglen); -+ req_exec_cpg_mcast->type = swab32(req_exec_cpg_mcast->type); -+ swab_mar_message_source_t (&req_exec_cpg_mcast->source); -+} -+ - static struct process_info *process_info_find(const mar_cpg_name_t *group_name, uint32_t pid, unsigned int nodeid) { - struct list_head *iter; - -@@ -1453,6 +1496,68 @@ static void message_handler_req_exec_cpg_mcast ( - } - } - -+static void message_handler_req_exec_cpg_partial_mcast ( -+ const void *message, -+ unsigned int nodeid) -+{ -+ const struct req_exec_cpg_partial_mcast *req_exec_cpg_mcast = message; -+ struct res_lib_cpg_partial_deliver_callback res_lib_cpg_mcast; -+ int msglen = req_exec_cpg_mcast->fraglen; -+ struct list_head *iter, *pi_iter; -+ struct cpg_pd *cpd; -+ struct iovec iovec[2]; -+ int known_node = 0; -+ -+ log_printf(LOGSYS_LEVEL_DEBUG, "Got fragmented message from node %d, size = %d bytes\n", nodeid, msglen); -+ -+ res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_PARTIAL_DELIVER_CALLBACK; -+ res_lib_cpg_mcast.header.size = sizeof(res_lib_cpg_mcast) + msglen; -+ res_lib_cpg_mcast.fraglen = msglen; -+ res_lib_cpg_mcast.msglen = req_exec_cpg_mcast->msglen; -+ res_lib_cpg_mcast.pid = req_exec_cpg_mcast->pid; -+ res_lib_cpg_mcast.type = req_exec_cpg_mcast->type; -+ res_lib_cpg_mcast.nodeid = nodeid; -+ -+ memcpy(&res_lib_cpg_mcast.group_name, &req_exec_cpg_mcast->group_name, -+ sizeof(mar_cpg_name_t)); -+ iovec[0].iov_base = (void *)&res_lib_cpg_mcast; -+ iovec[0].iov_len = sizeof (res_lib_cpg_mcast); -+ -+ iovec[1].iov_base = (char*)message+sizeof(*req_exec_cpg_mcast); -+ iovec[1].iov_len = msglen; -+ -+ for (iter = cpg_pd_list_head.next; iter != &cpg_pd_list_head; ) { -+ cpd = list_entry(iter, struct cpg_pd, list); -+ iter = iter->next; -+ -+ if ((cpd->cpd_state == CPD_STATE_LEAVE_STARTED || cpd->cpd_state == CPD_STATE_JOIN_COMPLETED) -+ && (mar_name_compare (&cpd->group_name, &req_exec_cpg_mcast->group_name) == 0)) { -+ -+ if (!known_node) { -+ /* Try to find, if we know the node */ -+ for (pi_iter = process_info_list_head.next; -+ pi_iter != &process_info_list_head; pi_iter = pi_iter->next) { -+ -+ struct process_info *pi = list_entry (pi_iter, struct process_info, list); -+ -+ if (pi->nodeid == nodeid && -+ mar_name_compare (&pi->group, &req_exec_cpg_mcast->group_name) == 0) { -+ known_node = 1; -+ break; -+ } -+ } -+ } -+ -+ if (!known_node) { -+ log_printf(LOGSYS_LEVEL_WARNING, "Unknown node -> we will not deliver message"); -+ return ; -+ } -+ -+ api->ipc_dispatch_iov_send (cpd->conn, iovec, 2); -+ } -+ } -+} -+ - - static int cpg_exec_send_downlist(void) - { -@@ -1864,6 +1969,77 @@ static void message_handler_req_lib_cpg_zc_free ( - res_header.size); - } - -+/* Fragmented mcast message from the library */ -+static void message_handler_req_lib_cpg_partial_mcast (void *conn, const void *message) -+{ -+ const struct req_lib_cpg_partial_mcast *req_lib_cpg_mcast = message; -+ struct cpg_pd *cpd = (struct cpg_pd *)api->ipc_private_data_get (conn); -+ mar_cpg_name_t group_name = cpd->group_name; -+ -+ struct iovec req_exec_cpg_iovec[2]; -+ struct req_exec_cpg_partial_mcast req_exec_cpg_mcast; -+ struct res_lib_cpg_partial_send res_lib_cpg_partial_send; -+ int msglen = req_lib_cpg_mcast->fraglen; -+ int result; -+ cs_error_t error = CS_ERR_NOT_EXIST; -+ -+ log_printf(LOGSYS_LEVEL_TRACE, "got fragmented mcast request on %p", conn); -+ log_printf(LOGSYS_LEVEL_DEBUG, "Sending fragmented message size = %d bytes\n", msglen); -+ -+ switch (cpd->cpd_state) { -+ case CPD_STATE_UNJOINED: -+ error = CS_ERR_NOT_EXIST; -+ break; -+ case CPD_STATE_LEAVE_STARTED: -+ error = CS_ERR_NOT_EXIST; -+ break; -+ case CPD_STATE_JOIN_STARTED: -+ error = CS_OK; -+ break; -+ case CPD_STATE_JOIN_COMPLETED: -+ error = CS_OK; -+ break; -+ } -+ -+ res_lib_cpg_partial_send.header.size = sizeof(res_lib_cpg_partial_send); -+ res_lib_cpg_partial_send.header.id = MESSAGE_RES_CPG_PARTIAL_SEND; -+ -+ if (req_lib_cpg_mcast->type == LIBCPG_PARTIAL_FIRST) { -+ cpd->initial_transition_counter = cpd->transition_counter; -+ } -+ if (cpd->transition_counter != cpd->initial_transition_counter) { -+ error = CS_ERR_INTERRUPT; -+ } -+ -+ if (error == CS_OK) { -+ req_exec_cpg_mcast.header.size = sizeof(req_exec_cpg_mcast) + msglen; -+ req_exec_cpg_mcast.header.id = SERVICE_ID_MAKE(CPG_SERVICE, -+ MESSAGE_REQ_EXEC_CPG_PARTIAL_MCAST); -+ req_exec_cpg_mcast.pid = cpd->pid; -+ req_exec_cpg_mcast.msglen = req_lib_cpg_mcast->msglen; -+ req_exec_cpg_mcast.type = req_lib_cpg_mcast->type; -+ req_exec_cpg_mcast.fraglen = req_lib_cpg_mcast->fraglen; -+ api->ipc_source_set (&req_exec_cpg_mcast.source, conn); -+ memcpy(&req_exec_cpg_mcast.group_name, &group_name, -+ sizeof(mar_cpg_name_t)); -+ -+ req_exec_cpg_iovec[0].iov_base = (char *)&req_exec_cpg_mcast; -+ req_exec_cpg_iovec[0].iov_len = sizeof(req_exec_cpg_mcast); -+ req_exec_cpg_iovec[1].iov_base = (char *)&req_lib_cpg_mcast->message; -+ req_exec_cpg_iovec[1].iov_len = msglen; -+ -+ result = api->totem_mcast (req_exec_cpg_iovec, 2, TOTEM_AGREED); -+ assert(result == 0); -+ } else { -+ log_printf(LOGSYS_LEVEL_ERROR, "*** %p can't mcast to group %s state:%d, error:%d", -+ conn, group_name.value, cpd->cpd_state, error); -+ } -+ -+ res_lib_cpg_partial_send.header.error = error; -+ api->ipc_response_send (conn, &res_lib_cpg_partial_send, -+ sizeof (res_lib_cpg_partial_send)); -+} -+ - /* Mcast message from the library */ - static void message_handler_req_lib_cpg_mcast (void *conn, const void *message) - { -diff --git a/include/corosync/cpg.h b/include/corosync/cpg.h -index 55fc4b8..f66fb14 100644 ---- a/include/corosync/cpg.h -+++ b/include/corosync/cpg.h -@@ -186,6 +186,13 @@ cs_error_t cpg_fd_get ( - int *fd); - - /** -+ * Get maximum size of a message that will not be fragmented -+ */ -+cs_error_t cpg_max_atomic_msgsize_get ( -+ cpg_handle_t handle, -+ uint32_t *size); -+ -+/** - * Get contexts for a CPG handle - */ - cs_error_t cpg_context_get ( -diff --git a/include/corosync/ipc_cpg.h b/include/corosync/ipc_cpg.h -index a95335a..5008acf 100644 ---- a/include/corosync/ipc_cpg.h -+++ b/include/corosync/ipc_cpg.h -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2006-2011 Red Hat, Inc. -+ * Copyright (c) 2006-2015 Red Hat, Inc. - * - * All rights reserved. - * -@@ -55,6 +55,7 @@ enum req_cpg_types { - MESSAGE_REQ_CPG_ZC_ALLOC = 9, - MESSAGE_REQ_CPG_ZC_FREE = 10, - MESSAGE_REQ_CPG_ZC_EXECUTE = 11, -+ MESSAGE_REQ_CPG_PARTIAL_MCAST = 12, - }; - - enum res_cpg_types { -@@ -75,6 +76,8 @@ enum res_cpg_types { - MESSAGE_RES_CPG_ZC_ALLOC = 14, - MESSAGE_RES_CPG_ZC_FREE = 15, - MESSAGE_RES_CPG_ZC_EXECUTE = 16, -+ MESSAGE_RES_CPG_PARTIAL_DELIVER_CALLBACK = 17, -+ MESSAGE_RES_CPG_PARTIAL_SEND = 18, - }; - - enum lib_cpg_confchg_reason { -@@ -85,6 +88,12 @@ enum lib_cpg_confchg_reason { - CONFCHG_CPG_REASON_PROCDOWN = 5 - }; - -+enum lib_cpg_partial_types { -+ LIBCPG_PARTIAL_FIRST = 1, -+ LIBCPG_PARTIAL_CONTINUED = 2, -+ LIBCPG_PARTIAL_LAST = 3, -+}; -+ - typedef struct { - uint32_t length __attribute__((aligned(8))); - char value[CPG_MAX_NAME_LENGTH] __attribute__((aligned(8))); -@@ -200,6 +209,10 @@ struct res_lib_cpg_local_get { - mar_uint32_t local_nodeid __attribute__((aligned(8))); - }; - -+struct res_lib_cpg_partial_send { -+ struct qb_ipc_response_header header __attribute__((aligned(8))); -+}; -+ - struct req_lib_cpg_mcast { - struct qb_ipc_response_header header __attribute__((aligned(8))); - mar_uint32_t guarantee __attribute__((aligned(8))); -@@ -207,6 +220,15 @@ struct req_lib_cpg_mcast { - mar_uint8_t message[] __attribute__((aligned(8))); - }; - -+struct req_lib_cpg_partial_mcast { -+ struct qb_ipc_response_header header __attribute__((aligned(8))); -+ mar_uint32_t guarantee __attribute__((aligned(8))); -+ mar_uint32_t msglen __attribute__((aligned(8))); -+ mar_uint32_t fraglen __attribute__((aligned(8))); -+ mar_uint32_t type __attribute__((aligned(8))); -+ mar_uint8_t message[] __attribute__((aligned(8))); -+}; -+ - struct res_lib_cpg_mcast { - struct qb_ipc_response_header header __attribute__((aligned(8))); - }; -@@ -223,6 +245,17 @@ struct res_lib_cpg_deliver_callback { - mar_uint8_t message[] __attribute__((aligned(8))); - }; - -+struct res_lib_cpg_partial_deliver_callback { -+ struct qb_ipc_response_header header __attribute__((aligned(8))); -+ mar_cpg_name_t group_name __attribute__((aligned(8))); -+ mar_uint32_t msglen __attribute__((aligned(8))); -+ mar_uint32_t fraglen __attribute__((aligned(8))); -+ mar_uint32_t nodeid __attribute__((aligned(8))); -+ mar_uint32_t pid __attribute__((aligned(8))); -+ mar_uint32_t type __attribute__((aligned(8))); -+ mar_uint8_t message[] __attribute__((aligned(8))); -+}; -+ - struct res_lib_cpg_flowcontrol_callback { - struct qb_ipc_response_header header __attribute__((aligned(8))); - mar_uint32_t flow_control_state __attribute__((aligned(8))); -diff --git a/lib/cpg.c b/lib/cpg.c -index 4b92f44..037e8a9 100644 ---- a/lib/cpg.c -+++ b/lib/cpg.c -@@ -1,7 +1,7 @@ - /* - * vi: set autoindent tabstop=4 shiftwidth=4 : - * -- * Copyright (c) 2006-2012 Red Hat, Inc. -+ * Copyright (c) 2006-2015 Red Hat, Inc. - * - * All rights reserved. - * -@@ -70,6 +70,12 @@ - #endif - - /* -+ * Maximum number of times to retry a send when transmitting -+ * a large message fragment -+ */ -+#define MAX_RETRIES 100 -+ -+/* - * ZCB files have following umask (umask is same as used in libqb) - */ - #define CPG_MEMORY_MAP_UMASK 077 -@@ -83,6 +89,14 @@ struct cpg_inst { - cpg_model_v1_data_t model_v1_data; - }; - struct list_head iteration_list_head; -+ uint32_t max_msg_size; -+ char *assembly_buf; -+ uint32_t assembly_buf_ptr; -+ int assembling; /* Flag that says we have started assembling a message. -+ * It's here to catch the situation where a node joins -+ * the cluster/group in the middle of a CPG message send -+ * so we don't pass on a partial message to the client. -+ */ - }; - static void cpg_inst_free (void *inst); - -@@ -210,6 +224,8 @@ cs_error_t cpg_model_initialize ( - } - } - -+ /* Allow space for corosync internal headers */ -+ cpg_inst->max_msg_size = IPC_REQUEST_SIZE - 1024; - cpg_inst->model_data.model = model; - cpg_inst->context = context; - -@@ -291,6 +307,25 @@ cs_error_t cpg_fd_get ( - return (error); - } - -+cs_error_t cpg_max_atomic_msgsize_get ( -+ cpg_handle_t handle, -+ uint32_t *size) -+{ -+ cs_error_t error; -+ struct cpg_inst *cpg_inst; -+ -+ error = hdb_error_to_cs (hdb_handle_get (&cpg_handle_t_db, handle, (void *)&cpg_inst)); -+ if (error != CS_OK) { -+ return (error); -+ } -+ -+ *size = cpg_inst->max_msg_size; -+ -+ hdb_handle_put (&cpg_handle_t_db, handle); -+ -+ return (error); -+} -+ - cs_error_t cpg_context_get ( - cpg_handle_t handle, - void **context) -@@ -339,6 +374,7 @@ cs_error_t cpg_dispatch ( - struct cpg_inst *cpg_inst; - struct res_lib_cpg_confchg_callback *res_cpg_confchg_callback; - struct res_lib_cpg_deliver_callback *res_cpg_deliver_callback; -+ struct res_lib_cpg_partial_deliver_callback *res_cpg_partial_deliver_callback; - struct res_lib_cpg_totem_confchg_callback *res_cpg_totem_confchg_callback; - struct cpg_inst cpg_inst_copy; - struct qb_ipc_response_header *dispatch_data; -@@ -361,7 +397,7 @@ cs_error_t cpg_dispatch ( - - /* - * Timeout instantly for CS_DISPATCH_ONE_NONBLOCKING or CS_DISPATCH_ALL and -- * wait indefinately for CS_DISPATCH_ONE or CS_DISPATCH_BLOCKING -+ * wait indefinitely for CS_DISPATCH_ONE or CS_DISPATCH_BLOCKING - */ - if (dispatch_types == CS_DISPATCH_ALL || dispatch_types == CS_DISPATCH_ONE_NONBLOCKING) { - timeout = 0; -@@ -428,6 +464,43 @@ cs_error_t cpg_dispatch ( - res_cpg_deliver_callback->msglen); - break; - -+ case MESSAGE_RES_CPG_PARTIAL_DELIVER_CALLBACK: -+ res_cpg_partial_deliver_callback = (struct res_lib_cpg_partial_deliver_callback *)dispatch_data; -+ -+ marshall_from_mar_cpg_name_t ( -+ &group_name, -+ &res_cpg_partial_deliver_callback->group_name); -+ -+ if (res_cpg_partial_deliver_callback->type == LIBCPG_PARTIAL_FIRST) { -+ /* -+ * Allocate a buffer to contain a full message. -+ */ -+ cpg_inst->assembly_buf = malloc(res_cpg_partial_deliver_callback->msglen); -+ if (!cpg_inst->assembly_buf) { -+ error = CS_ERR_NO_MEMORY; -+ goto error_put; -+ } -+ cpg_inst->assembling = 1; -+ cpg_inst->assembly_buf_ptr = 0; -+ } -+ if (cpg_inst->assembling) { -+ memcpy(cpg_inst->assembly_buf + cpg_inst->assembly_buf_ptr, -+ res_cpg_partial_deliver_callback->message, res_cpg_partial_deliver_callback->fraglen); -+ cpg_inst->assembly_buf_ptr += res_cpg_partial_deliver_callback->fraglen; -+ -+ if (res_cpg_partial_deliver_callback->type == LIBCPG_PARTIAL_LAST) { -+ cpg_inst_copy.model_v1_data.cpg_deliver_fn (handle, -+ &group_name, -+ res_cpg_partial_deliver_callback->nodeid, -+ res_cpg_partial_deliver_callback->pid, -+ cpg_inst->assembly_buf, -+ res_cpg_partial_deliver_callback->msglen); -+ free(cpg_inst->assembly_buf); -+ cpg_inst->assembling = 0; -+ } -+ } -+ break; -+ - case MESSAGE_RES_CPG_CONFCHG_CALLBACK: - if (cpg_inst_copy.model_v1_data.cpg_confchg_fn == NULL) { - break; -@@ -921,6 +994,12 @@ cs_error_t cpg_zcb_mcast_joined ( - if (error != CS_OK) { - return (error); - } -+ -+ if (msg_len > IPC_REQUEST_SIZE) { -+ error = CS_ERR_TOO_BIG; -+ goto error_exit; -+ } -+ - req_lib_cpg_mcast = (struct req_lib_cpg_mcast *)(((char *)msg) - sizeof (struct req_lib_cpg_mcast)); - req_lib_cpg_mcast->header.size = sizeof (struct req_lib_cpg_mcast) + - msg_len; -@@ -957,6 +1036,88 @@ error_exit: - return (error); - } - -+static cs_error_t send_fragments ( -+ struct cpg_inst *cpg_inst, -+ cpg_guarantee_t guarantee, -+ size_t msg_len, -+ const struct iovec *iovec, -+ unsigned int iov_len) -+{ -+ int i; -+ cs_error_t error = CS_OK; -+ struct iovec iov[2]; -+ struct req_lib_cpg_partial_mcast req_lib_cpg_mcast; -+ struct res_lib_cpg_partial_send res_lib_cpg_partial_send; -+ size_t sent = 0; -+ size_t iov_sent = 0; -+ int retry_count; -+ -+ req_lib_cpg_mcast.header.id = MESSAGE_REQ_CPG_PARTIAL_MCAST; -+ req_lib_cpg_mcast.guarantee = guarantee; -+ req_lib_cpg_mcast.msglen = msg_len; -+ -+ iov[0].iov_base = (void *)&req_lib_cpg_mcast; -+ iov[0].iov_len = sizeof (struct req_lib_cpg_partial_mcast); -+ -+ i=0; -+ iov_sent = 0 ; -+ qb_ipcc_fc_enable_max_set(cpg_inst->c, 2); -+ -+ while (error == CS_OK && sent < msg_len) { -+ -+ retry_count = 0; -+ if ( (iovec[i].iov_len - iov_sent) > cpg_inst->max_msg_size) { -+ iov[1].iov_len = cpg_inst->max_msg_size; -+ } -+ else { -+ iov[1].iov_len = iovec[i].iov_len - iov_sent; -+ } -+ -+ if (sent == 0) { -+ req_lib_cpg_mcast.type = LIBCPG_PARTIAL_FIRST; -+ } -+ else if ((sent + iov[1].iov_len) == msg_len) { -+ req_lib_cpg_mcast.type = LIBCPG_PARTIAL_LAST; -+ } -+ else { -+ req_lib_cpg_mcast.type = LIBCPG_PARTIAL_CONTINUED; -+ } -+ -+ req_lib_cpg_mcast.fraglen = iov[1].iov_len; -+ req_lib_cpg_mcast.header.size = sizeof (struct req_lib_cpg_partial_mcast) + iov[1].iov_len; -+ iov[1].iov_base = (char *)iovec[i].iov_base + iov_sent; -+ -+ resend: -+ error = coroipcc_msg_send_reply_receive (cpg_inst->c, iov, 2, -+ &res_lib_cpg_partial_send, -+ sizeof (res_lib_cpg_partial_send)); -+ -+ if (error == CS_ERR_TRY_AGAIN) { -+ fprintf(stderr, "sleep. counter=%d\n", retry_count); -+ if (++retry_count > MAX_RETRIES) { -+ goto error_exit; -+ } -+ usleep(10000); -+ goto resend; -+ } -+ -+ iov_sent += iov[1].iov_len; -+ sent += iov[1].iov_len; -+ -+ /* Next iovec */ -+ if (iov_sent >= iovec[i].iov_len) { -+ i++; -+ iov_sent = 0; -+ } -+ error = res_lib_cpg_partial_send.header.error; -+ } -+error_exit: -+ qb_ipcc_fc_enable_max_set(cpg_inst->c, 1); -+ -+ return error; -+} -+ -+ - cs_error_t cpg_mcast_joined ( - cpg_handle_t handle, - cpg_guarantee_t guarantee, -@@ -979,6 +1140,11 @@ cs_error_t cpg_mcast_joined ( - msg_len += iovec[i].iov_len; - } - -+ if (msg_len > cpg_inst->max_msg_size) { -+ error = send_fragments(cpg_inst, guarantee, msg_len, iovec, iov_len); -+ goto error_exit; -+ } -+ - req_lib_cpg_mcast.header.size = sizeof (struct req_lib_cpg_mcast) + - msg_len; - -@@ -994,6 +1160,7 @@ cs_error_t cpg_mcast_joined ( - error = qb_to_cs_error(qb_ipcc_sendv(cpg_inst->c, iov, iov_len + 1)); - qb_ipcc_fc_enable_max_set(cpg_inst->c, 1); - -+error_exit: - hdb_handle_put (&cpg_handle_t_db, handle); - - return (error); -diff --git a/test/Makefile.am b/test/Makefile.am -index c19e506..bb11518 100644 ---- a/test/Makefile.am -+++ b/test/Makefile.am -@@ -34,7 +34,7 @@ MAINTAINERCLEANFILES = Makefile.in - - EXTRA_DIST = ploadstart.sh - --noinst_PROGRAMS = cpgverify testcpg testcpg2 cpgbench \ -+noinst_PROGRAMS = cpgverify testcpg testcpg2 cpgbench cpghum \ - testquorum testvotequorum1 testvotequorum2 \ - stress_cpgfdget stress_cpgcontext cpgbound testsam \ - testcpgzc cpgbenchzc testzcgc stress_cpgzc -@@ -48,6 +48,7 @@ testzcgc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - stress_cpgzc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - stress_cpgfdget_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - stress_cpgcontext_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la -+cpghum_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la -lz - testquorum_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libquorum.la - testvotequorum1_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la - testvotequorum2_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la --- -1.7.1 - diff --git a/SOURCES/bz682771-2-Really-add-cpghum.patch b/SOURCES/bz682771-2-Really-add-cpghum.patch deleted file mode 100644 index 8bf2df1..0000000 --- a/SOURCES/bz682771-2-Really-add-cpghum.patch +++ /dev/null @@ -1,452 +0,0 @@ -From 3842ba6080e00fd9484a2a875d982e149f67bc44 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Tue, 10 Mar 2015 13:20:37 +0100 -Subject: [PATCH] Really add cpghum - -Signed-off-by: Jan Friesse ---- - test/cpghum.c | 432 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 432 insertions(+), 0 deletions(-) - create mode 100644 test/cpghum.c - -diff --git a/test/cpghum.c b/test/cpghum.c -new file mode 100644 -index 0000000..79184e8 ---- /dev/null -+++ b/test/cpghum.c -@@ -0,0 +1,432 @@ -+/* -+ * Copyright (c) 2015 Red Hat, Inc. -+ * -+ * All rights reserved. -+ * -+ * Author: Christine Caulfield -+ * -+ * This software licensed under BSD license, the text of which follows: -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of the MontaVista Software, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived from this -+ * software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -+ * THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+ -+static cpg_handle_t handle; -+ -+static pthread_t thread; -+ -+#ifndef timersub -+#define timersub(a, b, result) \ -+ do { \ -+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ -+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ -+ if ((result)->tv_usec < 0) { \ -+ --(result)->tv_sec; \ -+ (result)->tv_usec += 1000000; \ -+ } \ -+ } while (0) -+#endif /* timersub */ -+ -+static int alarm_notice; -+#define ONE_MEG 1048576 -+#define DATASIZE (ONE_MEG*20) -+static char data[DATASIZE]; -+static int send_counter = 0; -+static int do_syslog = 0; -+static int quiet = 0; -+static volatile int stopped; -+ -+// stats -+static unsigned int length_errors=0; -+static unsigned int crc_errors=0; -+static unsigned int sequence_errors=0; -+static unsigned int packets_sent=0; -+static unsigned int packets_recvd=0; -+static unsigned int send_retries=0; -+static unsigned int send_fails=0; -+ -+static void cpg_bm_confchg_fn ( -+ cpg_handle_t handle_in, -+ const struct cpg_name *group_name, -+ const struct cpg_address *member_list, size_t member_list_entries, -+ const struct cpg_address *left_list, size_t left_list_entries, -+ const struct cpg_address *joined_list, size_t joined_list_entries) -+{ -+} -+ -+static unsigned int g_recv_count; -+static unsigned int g_recv_length; -+static unsigned int g_write_size; -+static int g_recv_counter = 0; -+ -+static void cpg_bm_deliver_fn ( -+ cpg_handle_t handle_in, -+ const struct cpg_name *group_name, -+ uint32_t nodeid, -+ uint32_t pid, -+ void *msg, -+ size_t msg_len) -+{ -+ int *value = msg; -+ uLong crc=0; -+ ulong recv_crc = value[1] & 0xFFFFFFFF; -+ -+ packets_recvd++; -+ g_recv_length = msg_len; -+ -+ // Basic check, packets should all be the right size -+ if (g_write_size && (msg_len != g_write_size)) { -+ length_errors++; -+ fprintf(stderr, "%s: message sizes don't match. got %lu, expected %u\n", group_name->value, msg_len, g_write_size); -+ if (do_syslog) { -+ syslog(LOG_ERR, "%s: message sizes don't match. got %lu, expected %u\n", group_name->value, msg_len, g_write_size); -+ } -+ } -+ -+ // Sequence counters are incrementing in step? -+ if (*value != g_recv_counter) { -+ sequence_errors++; -+ fprintf(stderr, "%s: counters don't match. got %d, expected %d\n", group_name->value, *value, g_recv_counter); -+ if (do_syslog) { -+ syslog(LOG_ERR, "%s: counters don't match. got %d, expected %d\n", group_name->value, *value, g_recv_counter); -+ } -+ // Catch up or we'll be printing errors for ever -+ g_recv_counter = *value +1; -+ } else { -+ g_recv_counter++; -+ } -+ -+ // Check crc -+ crc = crc32(0, NULL, 0); -+ crc = crc32(crc, (Bytef *)&value[2], msg_len-sizeof(int)*2) & 0xFFFFFFFF; -+ if (crc != recv_crc) { -+ crc_errors++; -+ fprintf(stderr, "%s: CRCs don't match. got %lx, expected %lx\n", group_name->value, recv_crc, crc); -+ if (do_syslog) { -+ syslog(LOG_ERR, "%s: CRCs don't match. got %lx, expected %lx\n", group_name->value, recv_crc, crc); -+ } -+ } -+ -+ g_recv_count++; -+ -+} -+ -+static cpg_model_v1_data_t model1_data = { -+ .cpg_deliver_fn = cpg_bm_deliver_fn, -+ .cpg_confchg_fn = cpg_bm_confchg_fn, -+}; -+ -+static cpg_callbacks_t callbacks = { -+ .cpg_deliver_fn = cpg_bm_deliver_fn, -+ .cpg_confchg_fn = cpg_bm_confchg_fn -+}; -+ -+static struct cpg_name group_name = { -+ .value = "cpghum", -+ .length = 7 -+}; -+ -+static void cpg_test ( -+ cpg_handle_t handle_in, -+ int write_size, -+ int delay_time, -+ int print_time) -+{ -+ struct timeval tv1, tv2, tv_elapsed; -+ struct iovec iov; -+ unsigned int res; -+ int i; -+ unsigned int *dataint = (unsigned int *)data; -+ uLong crc; -+ -+ alarm_notice = 0; -+ iov.iov_base = data; -+ iov.iov_len = write_size; -+ -+ g_recv_count = 0; -+ alarm (print_time); -+ -+ gettimeofday (&tv1, NULL); -+ do { -+ dataint[0] = send_counter++; -+ for (i=2; i<(DATASIZE-sizeof(int)*2)/4; i++) { -+ dataint[i] = rand(); -+ } -+ crc = crc32(0, NULL, 0); -+ dataint[1] = crc32(crc, (Bytef*)&dataint[2], write_size-sizeof(int)*2); -+ resend: -+ res = cpg_mcast_joined (handle_in, CPG_TYPE_AGREED, &iov, 1); -+ if (res == CS_ERR_TRY_AGAIN) { -+ usleep(10000); -+ send_retries++; -+ goto resend; -+ } -+ if (res != CS_OK) { -+ fprintf(stderr, "send failed: %d\n", res); -+ send_fails++; -+ } -+ else { -+ packets_sent++; -+ } -+ usleep(delay_time*1000); -+ } while (alarm_notice == 0 && (res == CS_OK || res == CS_ERR_TRY_AGAIN) && stopped == 0); -+ gettimeofday (&tv2, NULL); -+ timersub (&tv2, &tv1, &tv_elapsed); -+ -+ if (!quiet) { -+ printf ("%s: %5d message%s received, ", group_name.value, g_recv_count, g_recv_count==1?"":"s"); -+ printf ("%5d bytes per write\n", write_size); -+ } -+ -+} -+ -+static void sigalrm_handler (int num) -+{ -+ alarm_notice = 1; -+} -+ -+static void sigint_handler (int num) -+{ -+ stopped = 1; -+} -+ -+static void* dispatch_thread (void *arg) -+{ -+ cpg_dispatch (handle, CS_DISPATCH_BLOCKING); -+ return NULL; -+} -+ -+static void usage(char *cmd) -+{ -+ fprintf(stderr, "%s [OPTIONS]\n", cmd); -+ fprintf(stderr, "\n"); -+ fprintf(stderr, "%s sends CPG messages to all registered users of the CPG.\n", cmd); -+ fprintf(stderr, "The messages have a sequence number and a CRC so that missing or\n"); -+ fprintf(stderr, "corrupted messages will be detected and reported.\n"); -+ fprintf(stderr, "\n"); -+ fprintf(stderr, "%s can also be asked to simply listen for (and check) packets\n", cmd); -+ fprintf(stderr, "so that there is another node in the cluster connected to the CPG.\n"); -+ fprintf(stderr, "\n"); -+ fprintf(stderr, "When -l is present, packet size is only checked if specified by -w or -W\n"); -+ fprintf(stderr, "and it, obviously, must match that of the sender.\n"); -+ fprintf(stderr, "\n"); -+ fprintf(stderr, "Multiple copies, in different CPGs, can also be run on the same or\n"); -+ fprintf(stderr, "different nodes by using the -n option.\n"); -+ fprintf(stderr, "\n"); -+ fprintf(stderr, "%s can't handle more than 1 sender in the same CPG as it messes with the\n", cmd); -+ fprintf(stderr, "sequence numbers.\n"); -+ fprintf(stderr, "\n"); -+ fprintf(stderr, " -w Write size in Kbytes, default 4\n"); -+ fprintf(stderr, " -W Write size in bytes, default 4096\n"); -+ fprintf(stderr, " -n CPG name to use, default 'cpghum'\n"); -+ fprintf(stderr, " -d Delay between sending packets (mS), default 1000\n"); -+ fprintf(stderr, " -r Number of repetitions, default 100\n"); -+ fprintf(stderr, " -p Delay between printing output(S), default 10s\n"); -+ fprintf(stderr, " -l Listen and check CRCs only, don't send (^C to quit)\n"); -+ fprintf(stderr, " -m cpg_initialise() model. Default 1.\n"); -+ fprintf(stderr, " -s Also send errors to syslog (for daemon log correlation).\n"); -+ fprintf(stderr, " -q Quiet. Don't print messages every 10 seconds (see also -p)\n"); -+ fprintf(stderr, "\n"); -+} -+ -+int main (int argc, char *argv[]) { -+ int i; -+ unsigned int res; -+ uint32_t maxsize; -+ int opt; -+ int bs; -+ int write_size = 4096; -+ int delay_time = 1000; -+ int repetitions = 100; -+ int print_time = 10; -+ int have_size = 0; -+ int listen_only = 0; -+ int model = 1; -+ -+ while ( (opt = getopt(argc, argv, "qlsn:d:r:p:m:w:W:")) != -1 ) { -+ switch (opt) { -+ case 'w': // Write size in K -+ bs = atoi(optarg); -+ if (bs > 0) { -+ write_size = bs*1024; -+ have_size = 1; -+ } -+ break; -+ case 'W': // Write size in bytes -+ bs = atoi(optarg); -+ if (bs > 0) { -+ write_size = bs; -+ have_size = 1; -+ } -+ break; -+ case 'n': -+ strcpy(group_name.value, optarg); -+ group_name.length = strlen(group_name.value); -+ break; -+ case 'd': -+ delay_time = atoi(optarg); -+ break; -+ case 'r': -+ repetitions = atoi(optarg); -+ break; -+ case 'p': -+ print_time = atoi(optarg); -+ break; -+ case 'l': -+ listen_only = 1; -+ break; -+ case 's': -+ do_syslog = 1; -+ break; -+ case 'q': -+ quiet = 1; -+ break; -+ case 'm': -+ model = atoi(optarg); -+ if (model < 0 || model > 1) { -+ fprintf(stderr, "%s: Model must be 0-1\n", argv[0]); -+ exit(1); -+ } -+ break; -+ case '?': -+ usage(basename(argv[0])); -+ exit(0); -+ } -+ } -+ -+ qb_log_init("cpghum", LOG_USER, LOG_EMERG); -+ qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_ENABLED, QB_FALSE); -+ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD, -+ QB_LOG_FILTER_FILE, "*", LOG_DEBUG); -+ qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE); -+ -+ g_write_size = write_size; -+ -+ signal (SIGALRM, sigalrm_handler); -+ signal (SIGINT, sigint_handler); -+ switch (model) { -+ case 0: -+ res = cpg_initialize (&handle, &callbacks); -+ break; -+ case 1: -+ res = cpg_model_initialize (&handle, CPG_MODEL_V1, (cpg_model_data_t *)&model1_data, NULL); -+ break; -+ default: -+ res=999; // can't get here but it keeps the compiler happy -+ break; -+ } -+ -+ if (res != CS_OK) { -+ printf ("cpg_initialize failed with result %d\n", res); -+ exit (1); -+ } -+ pthread_create (&thread, NULL, dispatch_thread, NULL); -+ -+ res = cpg_join (handle, &group_name); -+ if (res != CS_OK) { -+ printf ("cpg_join failed with result %d\n", res); -+ exit (1); -+ } -+ -+ if (listen_only) { -+ int secs; -+ if (!quiet) { -+ printf("-- Listening on CPG %s\n", group_name.value); -+ printf("-- Ignore any starting \"counters don't match\" error while we catch up\n"); -+ } -+ -+ /* Only check packet size if specified on the command-line */ -+ if (!have_size) { -+ g_write_size = 0; -+ } -+ -+ while (!stopped) { -+ sleep(1); -+ if (++secs > print_time && !quiet) { -+ printf ("%s: %5d message%s received. %d bytes\n", group_name.value, g_recv_count, g_recv_count==1?"":"s", g_recv_length); -+ secs = 0; -+ g_recv_count = 0; -+ } -+ } -+ } -+ else { -+ cpg_max_atomic_msgsize_get (handle, &maxsize); -+ if ( write_size > maxsize) { -+ fprintf(stderr, "INFO: packet size (%d) is larger than the maximum atomic size (%d), libcpg will fragment\n", -+ write_size, maxsize); -+ } -+ for (i = 0; i < repetitions && !stopped; i++) { -+ cpg_test (handle, write_size, delay_time, print_time); -+ signal (SIGALRM, sigalrm_handler); -+ } -+ } -+ -+ res = cpg_finalize (handle); -+ if (res != CS_OK) { -+ printf ("cpg_finalize failed with result %d\n", res); -+ exit (1); -+ } -+ -+ printf("\n"); -+ printf("Stats:\n"); -+ if (!listen_only) { -+ printf(" packets sent: %d\n", packets_sent); -+ printf(" send failures: %d\n", send_fails); -+ printf(" send retries: %d\n", send_retries); -+ } -+ if (have_size) { -+ printf(" length errors: %d\n", length_errors); -+ } -+ printf(" packets recvd: %d\n", packets_recvd); -+ printf(" sequence errors: %d\n", sequence_errors); -+ printf(" crc errors: %d\n", crc_errors); -+ printf("\n"); -+ return (0); -+} --- -1.7.1 - diff --git a/SOURCES/bz682771-3-Don-t-link-with-libz-when-not-needed.patch b/SOURCES/bz682771-3-Don-t-link-with-libz-when-not-needed.patch deleted file mode 100644 index 6db67de..0000000 --- a/SOURCES/bz682771-3-Don-t-link-with-libz-when-not-needed.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 4d228554d977327fe089b8ec3cb2ced649091560 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Mon, 22 Jun 2015 16:00:07 +0200 -Subject: [PATCH] Don't link with libz when not needed - -Commit 8cc8e513633a1a8b12c416e32fb5362fcf4d65dd added check for libz -resulting in linking with lib z for all libraries. This is not expected -behavior. Patch solves it by making defining automake conditional so -cpghum is linked only if libz is available and LIBS variable is not -modified at all. - -Signed-off-by: Jan Friesse ---- - configure.ac | 4 +++- - test/Makefile.am | 8 ++++++-- - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 4b640fc..922b439 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -163,7 +163,9 @@ AC_CHECK_LIB([pthread], [pthread_create]) - AC_CHECK_LIB([socket], [socket]) - AC_CHECK_LIB([nsl], [t_open]) - AC_CHECK_LIB([rt], [sched_getscheduler]) --AC_CHECK_LIB([z], [crc32]) -+AC_CHECK_LIB([z], [crc32], -+ AM_CONDITIONAL([BUILD_CPGHUM], true), -+ AM_CONDITIONAL([BUILD_CPGHUM], false)) - - # Checks for library functions. - AC_FUNC_ALLOCA -diff --git a/test/Makefile.am b/test/Makefile.am -index bb11518..ad1489d 100644 ---- a/test/Makefile.am -+++ b/test/Makefile.am -@@ -34,7 +34,7 @@ MAINTAINERCLEANFILES = Makefile.in - - EXTRA_DIST = ploadstart.sh - --noinst_PROGRAMS = cpgverify testcpg testcpg2 cpgbench cpghum \ -+noinst_PROGRAMS = cpgverify testcpg testcpg2 cpgbench \ - testquorum testvotequorum1 testvotequorum2 \ - stress_cpgfdget stress_cpgcontext cpgbound testsam \ - testcpgzc cpgbenchzc testzcgc stress_cpgzc -@@ -48,7 +48,6 @@ testzcgc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - stress_cpgzc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - stress_cpgfdget_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - stress_cpgcontext_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la --cpghum_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la -lz - testquorum_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libquorum.la - testvotequorum1_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la - testvotequorum2_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la -@@ -59,6 +58,11 @@ cpgbench_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - cpgbenchzc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la - testsam_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libsam.la - -+if BUILD_CPGHUM -+noinst_PROGRAMS += cpghum -+cpghum_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la -lz -+endif -+ - ploadstart: ploadstart.sh - sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@ - chmod 755 $@ --- -1.7.1 - diff --git a/SOURCES/bz773464-1-config-Make-sure-user-doesn-t-mix-IPv6-and-IPv4.patch b/SOURCES/bz773464-1-config-Make-sure-user-doesn-t-mix-IPv6-and-IPv4.patch deleted file mode 100644 index 535d35e..0000000 --- a/SOURCES/bz773464-1-config-Make-sure-user-doesn-t-mix-IPv6-and-IPv4.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 6c028d4d9c53decaa9469c792ac68fd2a886e7d9 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Mon, 24 Nov 2014 10:25:05 +0100 -Subject: [PATCH] config: Make sure user doesn't mix IPv6 and IPv4 - -Checking code was there, sadly not correct, so it was possible to enter -one bindnet addr as IPv4 and second as IPv6. Fix is trivial. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/totemconfig.c | 11 ++++++----- - 1 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/exec/totemconfig.c b/exec/totemconfig.c -index daf0719..3bcf49d 100644 ---- a/exec/totemconfig.c -+++ b/exec/totemconfig.c -@@ -1055,21 +1055,22 @@ int totem_config_validate ( - goto parse_error; - } - -- if (totem_config->broadcast_use == 0 && totem_config->transport_number == 0) { -+ if (totem_config->broadcast_use == 0 && totem_config->transport_number == TOTEM_TRANSPORT_UDP) { - if (totem_config->interfaces[i].mcast_addr.family != totem_config->interfaces[i].bindnet.family) { - error_reason = "Multicast address family does not match bind address family"; - goto parse_error; - } - -- if (totem_config->interfaces[i].mcast_addr.family != totem_config->interfaces[i].bindnet.family) { -- error_reason = "Not all bind address belong to the same IP family"; -- goto parse_error; -- } - if (totemip_is_mcast (&totem_config->interfaces[i].mcast_addr) != 0) { - error_reason = "mcastaddr is not a correct multicast address."; - goto parse_error; - } - } -+ -+ if (totem_config->interfaces[0].bindnet.family != totem_config->interfaces[i].bindnet.family) { -+ error_reason = "Not all bind address belong to the same IP family"; -+ goto parse_error; -+ } - } - - if (totem_config->version != 2) { --- -1.7.1 - diff --git a/SOURCES/bz773464-2-config-Process-broadcast-option-consistently.patch b/SOURCES/bz773464-2-config-Process-broadcast-option-consistently.patch deleted file mode 100644 index c3f42a2..0000000 --- a/SOURCES/bz773464-2-config-Process-broadcast-option-consistently.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 70bd35fc06e68a010d780dfa39bd68d4bd2f7da7 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Mon, 24 Nov 2014 10:32:03 +0100 -Subject: [PATCH] config: Process broadcast option consistently - -Broadcast option is global but in config set in interface section. When -more interfaces are defined, only broadcast from last section was used. - -Solution is to use broadcast whenever at least one interface use -broadcast. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/totemconfig.c | 20 ++++++++++++++++---- - 1 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/exec/totemconfig.c b/exec/totemconfig.c -index 3bcf49d..9cb9b07 100644 ---- a/exec/totemconfig.c -+++ b/exec/totemconfig.c -@@ -812,6 +812,12 @@ extern int totem_config_read ( - free(str); - } - -+ /* -+ * Broadcast option is global but set in interface section, -+ * so reset before processing interfaces. -+ */ -+ totem_config->broadcast_use = 0; -+ - iter = icmap_iter_init("totem.interface."); - while ((iter_key = icmap_iter_next(iter, NULL, NULL)) != NULL) { - res = sscanf(iter_key, "totem.interface.%[^.].%s", ringnumber_key, tmp_key); -@@ -866,14 +872,10 @@ extern int totem_config_read ( - &totem_config->interfaces[ringnumber].mcast_addr); - } - -- totem_config->broadcast_use = 0; - snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "totem.interface.%u.broadcast", ringnumber); - if (icmap_get_string(tmp_key, &str) == CS_OK) { - if (strcmp (str, "yes") == 0) { - totem_config->broadcast_use = 1; -- totemip_parse ( -- &totem_config->interfaces[ringnumber].mcast_addr, -- "255.255.255.255", totem_config->ip_version); - } - free(str); - } -@@ -927,6 +929,16 @@ extern int totem_config_read ( - icmap_iter_finalize(iter); - - /* -+ * Use broadcast is global, so if set, make sure to fill mcast addr correctly -+ */ -+ if (totem_config->broadcast_use) { -+ for (ringnumber = 0; ringnumber < totem_config->interface_count; ringnumber++) { -+ totemip_parse (&totem_config->interfaces[ringnumber].mcast_addr, -+ "255.255.255.255", 0); -+ } -+ } -+ -+ /* - * Store automatically generated items back to icmap - */ - for (i = 0; i < totem_config->interface_count; i++) { --- -1.7.1 - diff --git a/SOURCES/bz773464-3-config-Ensure-mcast-address-port-differs-for-rrp.patch b/SOURCES/bz773464-3-config-Ensure-mcast-address-port-differs-for-rrp.patch deleted file mode 100644 index 2bbe2b9..0000000 --- a/SOURCES/bz773464-3-config-Ensure-mcast-address-port-differs-for-rrp.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6449bea835c90045baa23e3e041fed1df2abf070 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Mon, 24 Nov 2014 11:54:20 +0100 -Subject: [PATCH] config: Ensure mcast address/port differs for rrp - -When using multiple interfaces, it's necessary to use different -multicast address/port pair for each interface to make -rrp work correctly. This is now checked in parser. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/totemconfig.c | 19 ++++++++++++++++++- - man/corosync.conf.5 | 4 ++++ - 2 files changed, 22 insertions(+), 1 deletions(-) - -diff --git a/exec/totemconfig.c b/exec/totemconfig.c -index 9cb9b07..2acee2a 100644 ---- a/exec/totemconfig.c -+++ b/exec/totemconfig.c -@@ -1022,8 +1022,9 @@ int totem_config_validate ( - static char local_error_reason[512]; - char parse_error[512]; - const char *error_reason = local_error_reason; -- int i; -+ int i, j; - unsigned int interface_max = INTERFACE_MAX; -+ unsigned int port1, port2; - - if (totem_config->interface_count == 0) { - error_reason = "No interfaces defined"; -@@ -1083,6 +1084,22 @@ int totem_config_validate ( - error_reason = "Not all bind address belong to the same IP family"; - goto parse_error; - } -+ -+ /* -+ * Ensure mcast address/port differs -+ */ -+ if (totem_config->transport_number == TOTEM_TRANSPORT_UDP) { -+ for (j = i + 1; j < totem_config->interface_count; j++) { -+ port1 = totem_config->interfaces[i].ip_port; -+ port2 = totem_config->interfaces[j].ip_port; -+ if (totemip_equal(&totem_config->interfaces[i].mcast_addr, -+ &totem_config->interfaces[j].mcast_addr) && -+ (((port1 > port2 ? port1 : port2) - (port1 < port2 ? port1 : port2)) <= 1)) { -+ error_reason = "Interfaces multicast address/port pair must differ"; -+ goto parse_error; -+ } -+ } -+ } - } - - if (totem_config->version != 2) { -diff --git a/man/corosync.conf.5 b/man/corosync.conf.5 -index 95eca2d..8e774c1 100644 ---- a/man/corosync.conf.5 -+++ b/man/corosync.conf.5 -@@ -213,6 +213,10 @@ be chosen. - The maximum number of interface directives that is allowed for either - modes (active or passive) is 2. - -+When using multiple interfaces, make sure to use different multicast -+address/port (port for same address must differ by at least two) pair -+for each interface (this is checked by parser) to make rrp works. -+ - .TP - netmtu - This specifies the network maximum transmit unit. To set this value beyond --- -1.7.1 - diff --git a/SOURCES/bz773464-4-automake-Check-minimum-automake-version.patch b/SOURCES/bz773464-4-automake-Check-minimum-automake-version.patch deleted file mode 100644 index 8db1be5..0000000 --- a/SOURCES/bz773464-4-automake-Check-minimum-automake-version.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 114b826c67126fe1f690ad976b5217a8487994a4 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Fri, 2 Jan 2015 12:27:48 +0100 -Subject: [PATCH] automake: Check minimum automake version - -Corosync needs automake version at least 1.11. Patch adds minimum -version check. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 4f374fc..0c371aa 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -10,7 +10,7 @@ AC_INIT([corosync], - - AC_USE_SYSTEM_EXTENSIONS - --AM_INIT_AUTOMAKE([-Wno-portability]) -+AM_INIT_AUTOMAKE([-Wno-portability 1.11]) - - LT_PREREQ([2.2.6]) - LT_INIT --- -1.7.1 - diff --git a/SOURCES/bz773464-5-Log-auto-recovery-of-ring-only-once.patch b/SOURCES/bz773464-5-Log-auto-recovery-of-ring-only-once.patch deleted file mode 100644 index 705008d..0000000 --- a/SOURCES/bz773464-5-Log-auto-recovery-of-ring-only-once.patch +++ /dev/null @@ -1,49 +0,0 @@ -From e0ac861efdc32831366a2b5f5cc1d61e2ffa5504 Mon Sep 17 00:00:00 2001 -From: Jan Friesse -Date: Thu, 2 Oct 2014 12:09:42 +0000 -Subject: [PATCH] Log auto-recovery of ring only once - -Make sure to log auto-recovery of ring only once. Every -MESSAGE_TYPE_RING_TEST_ACTIVATE receive is logged, but with lower -priority and more detailed information. - -Signed-off-by: Jan Friesse -Reviewed-by: Christine Caulfield ---- - exec/totemrrp.c | 14 +++++++++++--- - 1 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/exec/totemrrp.c b/exec/totemrrp.c -index eee9d26..0d9a58d 100644 ---- a/exec/totemrrp.c -+++ b/exec/totemrrp.c -@@ -1910,15 +1910,23 @@ void rrp_deliver_fn ( - } - } else - if (hdr->type == MESSAGE_TYPE_RING_TEST_ACTIVATE) { -- log_printf ( -- rrp_instance->totemrrp_log_level_notice, -- "Automatically recovered ring %d", hdr->ring_number); - - if (hdr->endian_detector != ENDIAN_LOCAL) { - test_active_msg_endian_convert(hdr, &tmp_msg); - hdr = &tmp_msg; - } - -+ log_printf ( -+ rrp_instance->totemrrp_log_level_debug, -+ "Received ring test activate message for ring %d sent by node %u", -+ hdr->ring_number, -+ hdr->nodeid_activator); -+ -+ if (rrp_instance->stats.faulty[deliver_fn_context->iface_no]) { -+ log_printf (rrp_instance->totemrrp_log_level_notice, -+ "Automatically recovered ring %d", hdr->ring_number); -+ } -+ - totemrrp_ring_reenable (rrp_instance, deliver_fn_context->iface_no); - if (hdr->nodeid_activator != rrp_instance->my_nodeid) { - totemnet_token_send ( --- -1.7.1 - diff --git a/SOURCES/bz773464-6-totemsrp-Format-member-list-log-as-unsigned-int.patch b/SOURCES/bz773464-6-totemsrp-Format-member-list-log-as-unsigned-int.patch deleted file mode 100644 index f34c2ed..0000000 --- a/SOURCES/bz773464-6-totemsrp-Format-member-list-log-as-unsigned-int.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 5d9acc5604eb4e8a739cb37a4ad46bcc5ad8deb6 Mon Sep 17 00:00:00 2001 -From: Andrey N. Groshev -Date: Tue, 3 Mar 2015 05:56:12 +0300 -Subject: [PATCH] totemsrp: Format member list log as unsigned int - -Signed-off-by: Andrey N. Groshev -Reviewed-by: Jan Friesse ---- - exec/totemsrp.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/exec/totemsrp.c b/exec/totemsrp.c -index b05773a..6357f5a 100644 ---- a/exec/totemsrp.c -+++ b/exec/totemsrp.c -@@ -1999,7 +1999,7 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance) - int sptr = 0; - sptr += snprintf(joined_node_msg, sizeof(joined_node_msg)-sptr, " joined:"); - for (i=0; i< joined_list_entries; i++) { -- sptr += snprintf(joined_node_msg+sptr, sizeof(joined_node_msg)-sptr, " %d", joined_list_totemip[i]); -+ sptr += snprintf(joined_node_msg+sptr, sizeof(joined_node_msg)-sptr, " %u", joined_list_totemip[i]); - } - } - else { -@@ -2010,7 +2010,7 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance) - int sptr = 0; - sptr += snprintf(left_node_msg, sizeof(left_node_msg)-sptr, " left:"); - for (i=0; i< instance->my_left_memb_entries; i++) { -- sptr += snprintf(left_node_msg+sptr, sizeof(left_node_msg)-sptr, " %d", left_list[i]); -+ sptr += snprintf(left_node_msg+sptr, sizeof(left_node_msg)-sptr, " %u", left_list[i]); - } - } - else { --- -1.7.1 - diff --git a/SOURCES/bz773464-7-totemconfig-Check-for-duplicate-nodeids.patch b/SOURCES/bz773464-7-totemconfig-Check-for-duplicate-nodeids.patch deleted file mode 100644 index cd3d4b5..0000000 --- a/SOURCES/bz773464-7-totemconfig-Check-for-duplicate-nodeids.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 997074cc3e1ea425ca63e453b7e2181741bdcef0 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Fri, 10 Apr 2015 14:22:07 +0100 -Subject: [PATCH] totemconfig: Check for duplicate nodeids - -Having duplicate nodeids in corosync.conf can play havoc with a cluster, -so (as suggested by someone on this list) here is some code to check -that all nodeids are unique. Even if a nodeid is not specified it will -check to be sure that the ID generated from the IP address (ipv4 only) -does not clash with one that is provided. - -It logs all non-unique nodeids to syslog, but only the last is reported -on the command-line to the user which should be enough to get them to -check further. At startup this will cause corosync to fail to start. - -Signed-off-by: Christine Caulfield ---- - exec/totemconfig.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 118 insertions(+), 0 deletions(-) - -diff --git a/exec/totemconfig.c b/exec/totemconfig.c -index b678752..f232ea8 100644 ---- a/exec/totemconfig.c -+++ b/exec/totemconfig.c -@@ -481,6 +481,120 @@ static int get_cluster_mcast_addr ( - return (err); - } - -+static unsigned int generate_nodeid_for_duplicate_test( -+ struct totem_config *totem_config, -+ char *addr) -+{ -+ unsigned int nodeid; -+ struct totem_ip_address totemip; -+ -+ /* AF_INET hard-coded here because auto-generated nodeids -+ are only for IPv4 */ -+ if (totemip_parse(&totemip, addr, AF_INET) != 0) -+ return -1; -+ -+ memcpy (&nodeid, &totemip.addr, sizeof (unsigned int)); -+ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+ nodeid = swab32 (nodeid); -+#endif -+ -+ if (totem_config->clear_node_high_bit) { -+ nodeid &= 0x7FFFFFFF; -+ } -+ return nodeid; -+} -+ -+static int check_for_duplicate_nodeids( -+ struct totem_config *totem_config, -+ const char **error_string) -+{ -+ icmap_iter_t iter; -+ icmap_iter_t subiter; -+ const char *iter_key; -+ int res = 0; -+ int retval = 0; -+ char tmp_key[ICMAP_KEYNAME_MAXLEN]; -+ char *ring0_addr=NULL; -+ char *ring0_addr1=NULL; -+ unsigned int node_pos; -+ unsigned int node_pos1; -+ unsigned int nodeid; -+ unsigned int nodeid1; -+ int autogenerated; -+ -+ iter = icmap_iter_init("nodelist.node."); -+ while ((iter_key = icmap_iter_next(iter, NULL, NULL)) != NULL) { -+ res = sscanf(iter_key, "nodelist.node.%u.%s", &node_pos, tmp_key); -+ if (res != 2) { -+ continue; -+ } -+ -+ if (strcmp(tmp_key, "ring0_addr") != 0) { -+ continue; -+ } -+ -+ snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "nodelist.node.%u.nodeid", node_pos); -+ autogenerated = 0; -+ if (icmap_get_uint32(tmp_key, &nodeid) != CS_OK) { -+ -+ snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "nodelist.node.%u.ring0_addr", node_pos); -+ if (icmap_get_string(tmp_key, &ring0_addr) != CS_OK) { -+ continue; -+ } -+ -+ /* Generate nodeid so we can check that auto-generated nodeids don't clash either */ -+ nodeid = generate_nodeid_for_duplicate_test(totem_config, ring0_addr); -+ if (nodeid == -1) { -+ continue; -+ } -+ autogenerated = 1; -+ } -+ -+ node_pos1 = 0; -+ subiter = icmap_iter_init("nodelist.node."); -+ while (((iter_key = icmap_iter_next(subiter, NULL, NULL)) != NULL) && (node_pos1 < node_pos)) { -+ res = sscanf(iter_key, "nodelist.node.%u.%s", &node_pos1, tmp_key); -+ if ((res != 2) || (node_pos1 >= node_pos)) { -+ continue; -+ } -+ -+ if (strcmp(tmp_key, "ring0_addr") != 0) { -+ continue; -+ } -+ -+ snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "nodelist.node.%u.nodeid", node_pos1); -+ if (icmap_get_uint32(tmp_key, &nodeid1) != CS_OK) { -+ -+ snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "nodelist.node.%u.ring0_addr", node_pos1); -+ if (icmap_get_string(tmp_key, &ring0_addr1) != CS_OK) { -+ continue; -+ } -+ nodeid1 = generate_nodeid_for_duplicate_test(totem_config, ring0_addr1); -+ if (nodeid1 == -1) { -+ continue; -+ } -+ } -+ -+ if (nodeid == nodeid1) { -+ retval = -1; -+ snprintf (error_string_response, sizeof(error_string_response), -+ "Nodeid %u%s%s%s appears twice in corosync.conf", nodeid, -+ autogenerated?"(autogenerated from ":"", -+ autogenerated?ring0_addr:"", -+ autogenerated?")":""); -+ log_printf (LOGSYS_LEVEL_ERROR, error_string_response); -+ *error_string = error_string_response; -+ break; -+ } -+ } -+ icmap_iter_finalize(subiter); -+ } -+ icmap_iter_finalize(iter); -+ return retval; -+} -+ -+ - static int find_local_node_in_nodelist(struct totem_config *totem_config) - { - icmap_iter_t iter; -@@ -1236,6 +1350,10 @@ int totem_config_validate ( - return (-1); - } - -+ if (check_for_duplicate_nodeids(totem_config, error_string) == -1) { -+ return (-1); -+ } -+ - /* - * RRP values validation - */ --- -1.7.1 - diff --git a/SOURCES/bz773464-8-totem-Log-a-message-if-JOIN-or-LEAVE-message-is-igno.patch b/SOURCES/bz773464-8-totem-Log-a-message-if-JOIN-or-LEAVE-message-is-igno.patch deleted file mode 100644 index c8e836d..0000000 --- a/SOURCES/bz773464-8-totem-Log-a-message-if-JOIN-or-LEAVE-message-is-igno.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 53f67a2a7914228f1a406aad61ea6768525e11b0 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Fri, 17 Apr 2015 15:49:53 +0100 -Subject: [PATCH] totem: Log a message if JOIN or LEAVE message is ignored - -As per recent email thread, this patch adds a log message if a JOIN or -LEAVE message is discarded while corosync is flushing the receive queue. - -While ignoring a JOIN message is harmless (it will be resent), ignoring -a LEAVE message can cause a longer state transition as it is treated as -a node crashing rather than leaving gracefully, so the system admin -might be confused as to the cause. - -Unfortunately, we can't (at the totemudp level) distinguish between JOIN -or LEAVE messages without a lot more protocol-specific code creeping in -the lower layer so the message is left ambiguous. - -Signed-off-by: Christine Caulfield ---- - exec/totemudp.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/exec/totemudp.c b/exec/totemudp.c -index 86059af..8ed87ce 100644 ---- a/exec/totemudp.c -+++ b/exec/totemudp.c -@@ -511,6 +511,7 @@ static int net_deliver_fn ( - */ - message_type = (char *)iovec->iov_base; - if (instance->flushing == 1 && *message_type == MESSAGE_TYPE_MEMB_JOIN) { -+ log_printf(instance->totemudp_log_level_warning, "JOIN or LEAVE message was thrown away during flush operation."); - iovec->iov_len = FRAME_SIZE_MAX; - return (0); - } --- -1.7.1 - diff --git a/SOURCES/bz773464-9-totemsrp-Improve-logging-of-left-down-nodes.patch b/SOURCES/bz773464-9-totemsrp-Improve-logging-of-left-down-nodes.patch deleted file mode 100644 index 8d530ed..0000000 --- a/SOURCES/bz773464-9-totemsrp-Improve-logging-of-left-down-nodes.patch +++ /dev/null @@ -1,219 +0,0 @@ -From ab8942f6260fde93824ed2a18e09e572b59ceb25 Mon Sep 17 00:00:00 2001 -From: Christine Caulfield -Date: Fri, 12 Jun 2015 16:16:45 +0100 -Subject: [PATCH] totemsrp: Improve logging of left/down nodes - -This patch from Hideo Yamauchi improves the logging of -whether nodes leave the cluster cleanly or uncleanly, -making it easier to determine if a node ws shut down -by the operator. There is also the possibility that a -LEAVE message could get missed (due to the node being -in flush state) so this can also make that clearer. - -The modifications are as follows. - -Change 1) I added the list which maintained LEAVE node to totemsrp. -Change 2) I added registration, a search, the handling of to clear LEAVE -node. -Change 3) I added the output to log. -Change 4) I changed an output level of the log. - -Signed-off-by: Hideo Yamauchi -Reviewed-by: Christine Caulfield -Reviewed-by: Jan Friesse ---- - exec/totemsrp.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- - 1 files changed, 104 insertions(+), 1 deletions(-) - -diff --git a/exec/totemsrp.c b/exec/totemsrp.c -index 6357f5a..3aa61cc 100644 ---- a/exec/totemsrp.c -+++ b/exec/totemsrp.c -@@ -316,6 +316,8 @@ struct totemsrp_instance { - - struct srp_addr my_left_memb_list[PROCESSOR_COUNT_MAX]; - -+ unsigned int my_leave_memb_list[PROCESSOR_COUNT_MAX]; -+ - int my_proc_list_entries; - - int my_failed_list_entries; -@@ -329,6 +331,8 @@ struct totemsrp_instance { - int my_deliver_memb_entries; - - int my_left_memb_entries; -+ -+ int my_leave_memb_entries; - - struct memb_ring_id my_ring_id; - -@@ -513,6 +517,8 @@ struct totemsrp_instance { - uint32_t threaded_mode_enabled; - - uint32_t waiting_trans_ack; -+ -+ int flushing; - - void * token_recv_event_handle; - void * token_sent_event_handle; -@@ -1476,6 +1482,52 @@ static void memb_set_print ( - } - } - #endif -+static void my_leave_memb_clear( -+ struct totemsrp_instance *instance) -+{ -+ memset(instance->my_leave_memb_list, 0, sizeof(instance->my_leave_memb_list)); -+ instance->my_leave_memb_entries = 0; -+} -+ -+static unsigned int my_leave_memb_match( -+ struct totemsrp_instance *instance, -+ unsigned int nodeid) -+{ -+ int i; -+ unsigned int ret = 0; -+ -+ for (i = 0; i < instance->my_leave_memb_entries; i++){ -+ if (instance->my_leave_memb_list[i] == nodeid){ -+ ret = nodeid; -+ break; -+ } -+ } -+ return ret; -+} -+ -+static void my_leave_memb_set( -+ struct totemsrp_instance *instance, -+ unsigned int nodeid) -+{ -+ int i, found = 0; -+ for (i = 0; i < instance->my_leave_memb_entries; i++){ -+ if (instance->my_leave_memb_list[i] == nodeid){ -+ found = 1; -+ break; -+ } -+ } -+ if (found == 1) { -+ return; -+ } -+ if (instance->my_leave_memb_entries < (PROCESSOR_COUNT_MAX - 1)) { -+ instance->my_leave_memb_list[instance->my_leave_memb_entries] = nodeid; -+ instance->my_leave_memb_entries++; -+ } else { -+ log_printf (instance->totemsrp_log_level_warning, -+ "Cannot set LEAVE nodeid=%d", nodeid); -+ } -+} -+ - - static void *totemsrp_buffer_alloc (struct totemsrp_instance *instance) - { -@@ -1837,6 +1889,7 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance) - unsigned int res; - char left_node_msg[1024]; - char joined_node_msg[1024]; -+ char failed_node_msg[1024]; - - instance->originated_orf_token = 0; - -@@ -2008,15 +2061,30 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance) - - if (instance->my_left_memb_entries) { - int sptr = 0; -+ int sptr2 = 0; - sptr += snprintf(left_node_msg, sizeof(left_node_msg)-sptr, " left:"); - for (i=0; i< instance->my_left_memb_entries; i++) { - sptr += snprintf(left_node_msg+sptr, sizeof(left_node_msg)-sptr, " %u", left_list[i]); - } -+ for (i=0; i< instance->my_left_memb_entries; i++) { -+ if (my_leave_memb_match(instance, left_list[i]) == 0) { -+ if (sptr2 == 0) { -+ sptr2 += snprintf(failed_node_msg, sizeof(failed_node_msg)-sptr2, " failed:"); -+ } -+ sptr2 += snprintf(failed_node_msg+sptr2, sizeof(left_node_msg)-sptr2, " %u", left_list[i]); -+ } -+ } -+ if (sptr2 == 0) { -+ failed_node_msg[0] = '\0'; -+ } - } - else { - left_node_msg[0] = '\0'; -+ failed_node_msg[0] = '\0'; - } - -+ my_leave_memb_clear(instance); -+ - log_printf (instance->totemsrp_log_level_debug, - "entering OPERATIONAL state."); - log_printf (instance->totemsrp_log_level_notice, -@@ -2025,6 +2093,13 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance) - instance->my_ring_id.seq, - joined_node_msg, - left_node_msg); -+ -+ if (strlen(failed_node_msg)) { -+ log_printf (instance->totemsrp_log_level_notice, -+ "Failed to receive the leave message.%s", -+ failed_node_msg); -+ } -+ - instance->memb_state = MEMB_STATE_OPERATIONAL; - - instance->stats.operational_entered++; -@@ -3597,8 +3672,9 @@ static int message_handler_orf_token ( - return (0); - } - #endif -- -+ instance->flushing = 1; - totemrrp_recv_flush (instance->totemrrp_context); -+ instance->flushing = 0; - - /* - * Determine if we should hold (in reality drop) the token -@@ -4130,6 +4206,32 @@ static void memb_join_process ( - memb_set_print ("my_faillist", instance->my_failed_list, instance->my_failed_list_entries); - -*/ - -+ if (memb_join->header.type == MESSAGE_TYPE_MEMB_JOIN) { -+ if (instance->flushing) { -+ if (memb_join->header.nodeid == LEAVE_DUMMY_NODEID) { -+ log_printf (instance->totemsrp_log_level_warning, -+ "Discarding LEAVE message during flush, nodeid=%u", -+ memb_join->failed_list_entries > 0 ? failed_list[memb_join->failed_list_entries - 1 ].addr[0].nodeid : LEAVE_DUMMY_NODEID); -+ if (memb_join->failed_list_entries > 0) { -+ my_leave_memb_set(instance, failed_list[memb_join->failed_list_entries - 1 ].addr[0].nodeid); -+ } -+ } else { -+ log_printf (instance->totemsrp_log_level_warning, -+ "Discarding JOIN message during flush, nodeid=%d", memb_join->header.nodeid); -+ } -+ return; -+ } else { -+ if (memb_join->header.nodeid == LEAVE_DUMMY_NODEID) { -+ log_printf (instance->totemsrp_log_level_debug, -+ "Recieve LEAVE message from %u", memb_join->failed_list_entries > 0 ? failed_list[memb_join->failed_list_entries - 1 ].addr[0].nodeid : LEAVE_DUMMY_NODEID); -+ if (memb_join->failed_list_entries > 0) { -+ my_leave_memb_set(instance, failed_list[memb_join->failed_list_entries - 1 ].addr[0].nodeid); -+ } -+ } -+ } -+ -+ } -+ - if (memb_set_equal (proc_list, - memb_join->proc_list_entries, - instance->my_proc_list, -@@ -4573,6 +4675,7 @@ void main_deliver_fn ( - return; - } - -+ - switch (message_header->type) { - case MESSAGE_TYPE_ORF_TOKEN: - instance->stats.orf_token_rx++; --- -1.7.1 - diff --git a/SPECS/corosync.spec b/SPECS/corosync.spec index 2c9dbc7..457df13 100644 --- a/SPECS/corosync.spec +++ b/SPECS/corosync.spec @@ -14,51 +14,25 @@ %bcond_with upstart %bcond_without xmlconf %bcond_without runautogen +%bcond_without qdevices +%bcond_without qnetd %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}} %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 2.3.4 -Release: 7%{?gitver}%{?dist}.3 +Version: 2.4.0 +Release: 4%{?gitver}%{?dist} License: BSD Group: System Environment/Base -URL: http://www.corosync.org/ -Source0: http://corosync.org/download/%{name}-%{version}%{?gittarver}.tar.gz - -Patch0: bz1136429-1-crypto-fix-crypto-block-rounding-padding-calculation.patch -Patch1: bz1136429-2-Adjust-MTU-for-IPv6-correctly.patch -Patch2: bz1149916-1-init-Don-t-wait-for-ipc-if-corosync-doesn-t-start.patch -Patch3: bz1078361-1-manpage-Fix-English.patch -Patch4: bz1078361-2-Store-configuration-values-used-by-totem-to-cmap.patch -Patch5: bz1078361-3-man-page-Improve-description-of-token-timeout.patch -Patch6: bz1184154-1-Handle-adding-and-removing-UDPU-members-atomically.patch -Patch7: bz1197091-1-Votequorum-Fix-auto_tie_breaker-default.patch -Patch8: bz1197671-1-Don-t-allow-both-two_node-and-auto_tie_breaker-in-co.patch -Patch9: bz773464-1-config-Make-sure-user-doesn-t-mix-IPv6-and-IPv4.patch -Patch10: bz773464-2-config-Process-broadcast-option-consistently.patch -Patch11: bz773464-3-config-Ensure-mcast-address-port-differs-for-rrp.patch -Patch12: bz1234261-1-Reset-timer_problem_decrementer-on-fault.patch -Patch13: bz773464-4-automake-Check-minimum-automake-version.patch -Patch14: bz1170347-1-Set-RR-priority-by-default.patch -Patch15: bz773464-5-Log-auto-recovery-of-ring-only-once.patch -Patch16: bz1234261-2-totem-Ignore-duplicated-commit-tokens-in-recovery.patch -Patch17: bz1234266-1-corosync_ring_id_store-Use-safer-permissions.patch -Patch18: bz773464-6-totemsrp-Format-member-list-log-as-unsigned-int.patch -Patch19: bz682771-1-cpg-Add-support-for-messages-larger-than-1Mb.patch -Patch20: bz682771-2-Really-add-cpghum.patch -Patch21: bz1229194-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch -Patch22: bz773464-7-totemconfig-Check-for-duplicate-nodeids.patch -Patch23: bz773464-8-totem-Log-a-message-if-JOIN-or-LEAVE-message-is-igno.patch -Patch24: bz773464-9-totemsrp-Improve-logging-of-left-down-nodes.patch -Patch25: bz1229194-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch -Patch26: bz1226842-1-Add-note-about-rrp-active-beeing-unsupported.patch -Patch27: bz1225441-1-Log-Add-logrotate-configuration-file.patch -Patch28: bz682771-3-Don-t-link-with-libz-when-not-needed.patch -Patch29: bz1283067-1-totemudp-Move-udp-bind-so-that-multicast-works-with-.patch -Patch30: bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch -Patch31: bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch +URL: http://corosync.github.io/corosync/ +Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz + +Patch0: bz1363654-1-Config-Flag-config-uidgid-entries.patch +Patch1: bz1367813-1-Man-Fix-corosync-qdevice-net-certutil-link.patch +Patch2: bz1367813-2-man-mention-qdevice-incompatibilites-in-votequorum.5.patch +Patch3: bz1367813-3-Qnetd-LMS-Fix-two-partition-use-case.patch %if 0%{?rhel} ExclusiveArch: i686 x86_64 s390x @@ -102,43 +76,21 @@ Requires(postun): systemd %if %{with xmlconf} Requires: libxslt %endif +%if %{with qdevices} || %{with qnetd} +Requires: nss-tools +%endif +%if %{with qnetd} +BuildRequires: sed +%endif BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %prep %setup -q -n %{name}-%{version}%{?gittarver} -%patch0 -p1 -b .bz1136429-1 -%patch1 -p1 -b .bz1136429-2 -%patch2 -p1 -b .bz1149916-1 -%patch3 -p1 -b .bz1078361-1 -%patch4 -p1 -b .bz1078361-2 -%patch5 -p1 -b .bz1078361-3 -%patch6 -p1 -b .bz1184154-1 -%patch7 -p1 -b .bz1197091-1 -%patch8 -p1 -b .bz1197671-1 -%patch9 -p1 -b .bz773464-1 -%patch10 -p1 -b .bz773464-2 -%patch11 -p1 -b .bz773464-3 -%patch12 -p1 -b .bz1234261-1 -%patch13 -p1 -b .bz773464-4 -%patch14 -p1 -b .bz1170347-1 -%patch15 -p1 -b .bz773464-5 -%patch16 -p1 -b .bz1234261-2 -%patch17 -p1 -b .bz1234266-1 -%patch18 -p1 -b .bz773464-6 -%patch19 -p1 -b .bz682771-1 -%patch20 -p1 -b .bz682771-2 -%patch21 -p1 -b .bz1229194-1 -%patch22 -p1 -b .bz773464-7 -%patch23 -p1 -b .bz773464-8 -%patch24 -p1 -b .bz773464-9 -%patch25 -p1 -b .bz1229194-2 -%patch26 -p1 -b .bz1226842-1 -%patch27 -p1 -b .bz1225441-1 -%patch28 -p1 -b .bz682771-3 -%patch29 -p1 -b .bz1283067-1 -%patch30 -p1 -b .bz1333397-1 -%patch31 -p1 -b .bz1338667-1 +%patch0 -p1 -b .bz1363654-1 +%patch1 -p1 -b .bz1367813-1 +%patch2 -p1 -b .bz1367813-2 +%patch3 -p1 -b .bz1367813-3 %build %if %{with runautogen} @@ -179,9 +131,16 @@ export rdmacm_LIBS=-lrdmacm \ %if %{with xmlconf} --enable-xmlconf \ %endif +%if %{with qdevices} + --enable-qdevices \ +%endif +%if %{with qnetd} + --enable-qnetd \ +%endif --with-initddir=%{_initrddir} \ --with-systemddir=%{_unitdir} \ - --with-upstartdir=%{_sysconfdir}/init + --with-upstartdir=%{_sysconfdir}/init \ + --with-tmpfilesdir=%{_tmpfilesdir} make %{_smp_mflags} @@ -209,6 +168,27 @@ install -m 644 tools/corosync-notifyd.sysconfig.example \ install -m 644 init/corosync.sysconfig.example \ %{buildroot}%{_sysconfdir}/sysconfig/corosync +%if %{with qdevices} +# /etc/sysconfig/corosync-qdevice +install -m 644 init/corosync-qdevice.sysconfig.example \ + %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice +%endif + +%if %{with qnetd} +# /etc/sysconfig/corosync-qnetd +install -m 644 init/corosync-qnetd.sysconfig.example \ + %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd +%if %{with systemd} +sed -i -e 's/^#User=/User=/' \ + %{buildroot}%{_unitdir}/corosync-qnetd.service +sed -i -e 's/root/coroqnetd/g' \ + %{buildroot}%{_tmpfilesdir}/corosync-qnetd.conf +%else +sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \ + %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd +%endif +%endif + %clean rm -rf %{buildroot} @@ -401,24 +381,180 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/cmap_overview.8* %{_mandir}/man8/quorum_overview.8* -%changelog -* Mon May 23 2016 Jan Friesse 2.3.4-7.3 -- Resolves: rhbz#1338667 +# optional qdevices +# +%if %{with qdevices} + +%package -n corosync-qdevice +Summary: The Corosync Cluster Engine Qdevice +Group: System Environment/Base +Requires: %{name} = %{version}-%{release} +Requires: corosynclib = %{version}-%{release} +Requires: nss-tools + +%if %{with systemd} +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +%endif + +%description -n corosync-qdevice +This package contains the Corosync Cluster Engine Qdevice, script for creating +NSS certificates and an init script. + +%post -n corosync-qdevice +%if %{with systemd} && 0%{?systemd_post:1} +%systemd_post corosync-qdevice.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add corosync-qdevice || : +fi +%endif + +%preun -n corosync-qdevice +%if %{with systemd} && 0%{?systemd_preun:1} +%systemd_preun corosync-qdevice.service +%else +if [ $1 -eq 0 ]; then + /sbin/service corosync-qdevice stop &>/dev/null || : + /sbin/chkconfig --del corosync-qdevice || : +fi +%endif + +%postun -n corosync-qdevice +%if %{with systemd} && 0%{?systemd_postun:1} +%systemd_postun +%endif + +%files -n corosync-qdevice +%defattr(-,root,root,-) +%dir %{_sysconfdir}/corosync/qdevice +%dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net +%dir %{_localstatedir}/run/corosync-qdevice +%{_sbindir}/corosync-qdevice +%{_sbindir}/corosync-qdevice-net-certutil +%{_sbindir}/corosync-qdevice-tool +%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice +%if %{with systemd} +%{_unitdir}/corosync-qdevice.service +%dir %{_datadir}/corosync +%{_datadir}/corosync/corosync-qdevice +%else +%{_initrddir}/corosync-qdevice +%endif +%{_mandir}/man8/corosync-qdevice-tool.8* +%{_mandir}/man8/corosync-qdevice-net-certutil.8* +%{_mandir}/man8/corosync-qdevice.8* +%endif + +# optional qnetd +# +%if %{with qnetd} + +%package -n corosync-qnetd +Summary: The Corosync Cluster Engine Qdevice Network Daemon +Group: System Environment/Base +Requires: nss-tools +Requires(pre): shadow-utils + +%if %{with systemd} +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +%endif + +%description -n corosync-qnetd +This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating +NSS certificates and an init script. + +%pre -n corosync-qnetd +getent group coroqnetd >/dev/null || groupadd -r coroqnetd +getent passwd coroqnetd >/dev/null || \ + useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd +exit 0 -- cmapctl: Handle corosync errors in print_key func (rhbz#1338667) -- merge upstream commit 8ab7743068cc6cd5bf235d1ccae65de1d91784f0 (rhbz#1338667) +%post -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_post:1} +%systemd_post corosync-qnetd.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add corosync-qnetd || : +fi +%endif -* Fri May 06 2016 Jan Friesse 2.3.4-7.2 -- Resolves: rhbz#1333397 +%preun -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_preun:1} +%systemd_preun corosync-qnetd.service +%else +if [ $1 -eq 0 ]; then + /sbin/service corosync-qnetd stop &>/dev/null || : + /sbin/chkconfig --del corosync-qnetd || : +fi +%endif -- totemconfig: Explicitly pass IP version (rhbz#1333397) -- merge upstream commit 60565b7da7d271651c30cd7fdca6e3f3eb5327ac (rhbz#1333397) +%postun -n corosync-qnetd +%if %{with systemd} && 0%{?systemd_postun:1} +%systemd_postun +%endif -* Wed Nov 18 2015 Jan Friesse 2.3.4-7.1 -- Resolves: rhbz#1283067 +%files -n corosync-qnetd +%defattr(-,root,root,-) +%dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd +%dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd +%{_bindir}/corosync-qnetd +%{_bindir}/corosync-qnetd-certutil +%{_bindir}/corosync-qnetd-tool +%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd +%if %{with systemd} +%{_unitdir}/corosync-qnetd.service +%dir %{_datadir}/corosync +%{_datadir}/corosync/corosync-qnetd +%{_tmpfilesdir}/corosync-qnetd.conf +%else +%{_initrddir}/corosync-qnetd +%endif +%{_mandir}/man8/corosync-qnetd-tool.8* +%{_mandir}/man8/corosync-qnetd-certutil.8* +%{_mandir}/man8/corosync-qnetd.8* +%endif -- totemudp: Move udp bind() so that multicast works with IPv6 (rhbz#1283067) -- merge upstream commit 165561df9ba1e0be2a11ff550b70da94990eb2f5 (rhbz#1283067) +%changelog +* Wed Aug 31 2016 Jan Friesse 2.4.0-4 +- Resolves: rhbz#1367813 + +- Man: Fix corosync-qdevice-net-certutil link (rhbz#1367813) +- merge upstream commit 49a9f722bba13e4b2762151b7b96b1d4196fd5e0 (rhbz#1367813) +- man: mention qdevice incompatibilites in votequorum.5 (rhbz#1367813) +- merge upstream commit 0da1b7446239424b76b1d5eb7c3640afce9b054e (rhbz#1367813) +- Qnetd LMS: Fix two partition use case (rhbz#1367813) +- merge upstream commit b0c850f308d44ddcdf1a1f881c1e1142ad489385 (rhbz#1367813) + +* Thu Aug 04 2016 Jan Friesse 2.4.0-3 +- Related: rhbz#1363654 + +- Enhance spec so corosync-qdevice subpackage depends on same version of + the corosync and corosynclib packages. + +* Thu Aug 04 2016 Jan Friesse 2.4.0-2 +- Resolves: rhbz#1363654 + +- Config: Flag config uidgid entries (rhbz#1363654) +- merge upstream commit f837f95dfe96d60f2367e900efd4def7a07b2a89 (rhbz#1363654) + +* Thu Jun 30 2016 Jan Friesse 2.4.0-1 +- Resolves: rhbz#614122 +- Resolves: rhbz#1185000 +- Resolves: rhbz#1306680 + +* Thu Jun 16 2016 Jan Friesse 2.3.6-1 +- Related: rhbz#1306680 +- Resolves: rhbz#1289169 +- Resolves: rhbz#1306349 +- Resolves: rhbz#1282372 +- Resolves: rhbz#1317573 +- Resolves: rhbz#1336462 + +- Rebase to Corosync 2.3.6 * Mon Jun 22 2015 Jan Friesse 2.3.4-7 - Related: rhbz#682771