From 8500676bd93d2358081167cce7639b3003fedb86 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 15 2015 09:07:54 +0000 Subject: import corosync-2.3.4-4.el7_1.3 --- diff --git a/SOURCES/bz1260002-1-Set-RR-priority-by-default.patch b/SOURCES/bz1260002-1-Set-RR-priority-by-default.patch new file mode 100644 index 0000000..e8104aa --- /dev/null +++ b/SOURCES/bz1260002-1-Set-RR-priority-by-default.patch @@ -0,0 +1,68 @@ +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/bz1260719-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch b/SOURCES/bz1260719-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch new file mode 100644 index 0000000..9186720 --- /dev/null +++ b/SOURCES/bz1260719-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch @@ -0,0 +1,114 @@ +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/bz1260719-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch b/SOURCES/bz1260719-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch new file mode 100644 index 0000000..b4bd454 --- /dev/null +++ b/SOURCES/bz1260719-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch @@ -0,0 +1,77 @@ +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/SPECS/corosync.spec b/SPECS/corosync.spec index 8a817dd..be64b43 100644 --- a/SPECS/corosync.spec +++ b/SPECS/corosync.spec @@ -21,7 +21,7 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces Version: 2.3.4 -Release: 4%{?gitver}%{?dist}.1 +Release: 4%{?gitver}%{?dist}.3 License: BSD Group: System Environment/Base URL: http://www.corosync.org/ @@ -36,6 +36,9 @@ Patch5: bz1078361-3-man-page-Improve-description-of-token-timeout.patch Patch6: bz1184154-1-Handle-adding-and-removing-UDPU-members-atomically.patch Patch7: bz1205336-1-Votequorum-Fix-auto_tie_breaker-default.patch Patch8: bz1205338-1-Don-t-allow-both-two_node-and-auto_tie_breaker-in-co.patch +Patch9: bz1260002-1-Set-RR-priority-by-default.patch +Patch10: bz1260719-1-quorum-don-t-allow-quorum_trackstart-to-be-called-tw.patch +Patch11: bz1260719-2-votequorum-Fix-auto_tie_breaker-behaviour-in-odd-siz.patch %if 0%{?rhel} ExclusiveArch: i686 x86_64 s390x @@ -92,6 +95,9 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %patch6 -p1 -b .bz1184154-1 %patch7 -p1 -b .bz1205336-1 %patch8 -p1 -b .bz1205338-1 +%patch9 -p1 -b .bz1260002-1 +%patch10 -p1 -b .bz1260719-1 +%patch11 -p1 -b .bz1260719-2 %build %if %{with runautogen} @@ -354,6 +360,20 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/quorum_overview.8* %changelog +* Mon Sep 07 2015 Jan Friesse 2.3.4-4.3 +- Resolves: rhbz#1260719 + +- quorum: don't allow quorum_trackstart to be called twice (rhbz#1260719) +- merge upstream commit 82526d2fe9137e8b604f1bbae6d6e39ba41377f9 (rhbz#1260719) +- votequorum: Fix auto_tie_breaker behaviour in odd-sized clusters (rhbz#1260719) +- merge upstream commit b9f5c290b7dedd0a677cdfc25db7dd111245a745 (rhbz#1260719) + +* Fri Sep 04 2015 Jan Friesse 2.3.4-4.2 +- Resolves: rhbz#1260002 + +- Set RR priority by default (rhbz#1260002) +- merge upstream commit 177ef0e5240b4060ff5b14eab6f2eefee3aa777d (rhbz#1260002) + * Wed Mar 25 2015 Jan Friesse 2.3.4-4.1 - Resolves: rhbz#1205336 - Resolves: rhbz#1205338