diff --git a/.corosync.metadata b/.corosync.metadata index 8e50688..7f2fe27 100644 --- a/.corosync.metadata +++ b/.corosync.metadata @@ -1 +1 @@ -1550c140c60611fb8672e35f87fb8a767522233e SOURCES/corosync-2.3.2.tar.gz +0f1d2624715a9b8bc9657e23ab002ed332c8ac5c SOURCES/corosync-2.3.3.tar.gz diff --git a/SOURCES/bz1067028-1-cpg-Refactor-mh_req_exec_cpg_procleave.patch b/SOURCES/bz1067028-1-cpg-Refactor-mh_req_exec_cpg_procleave.patch new file mode 100644 index 0000000..30436f5 --- /dev/null +++ b/SOURCES/bz1067028-1-cpg-Refactor-mh_req_exec_cpg_procleave.patch @@ -0,0 +1,111 @@ +From fcf26e03036b6ae5a8ef762ea0b5691a4f790c92 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Tue, 11 Feb 2014 15:27:31 +0100 +Subject: [PATCH] cpg: Refactor mh_req_exec_cpg_procleave + +Most of functionality is moved to do_proc_leave function to make it +reusable. + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +--- + exec/cpg.c | 67 +++++++++++++++++++++++++++++++++++++++-------------------- + 1 files changed, 44 insertions(+), 23 deletions(-) + +diff --git a/exec/cpg.c b/exec/cpg.c +index bc5feb6..9981440 100644 +--- a/exec/cpg.c ++++ b/exec/cpg.c +@@ -313,6 +313,12 @@ static void do_proc_join( + unsigned int nodeid, + int reason); + ++static void do_proc_leave( ++ const mar_cpg_name_t *name, ++ uint32_t pid, ++ unsigned int nodeid, ++ int reason); ++ + static int notify_lib_totem_membership ( + void *conn, + int member_list_entries, +@@ -1195,6 +1201,37 @@ static void do_proc_join( + MESSAGE_RES_CPG_CONFCHG_CALLBACK); + } + ++static void do_proc_leave( ++ const mar_cpg_name_t *name, ++ uint32_t pid, ++ unsigned int nodeid, ++ int reason) ++{ ++ struct process_info *pi; ++ struct list_head *iter; ++ mar_cpg_address_t notify_info; ++ ++ notify_info.pid = pid; ++ notify_info.nodeid = nodeid; ++ notify_info.reason = reason; ++ ++ notify_lib_joinlist(name, NULL, ++ 0, NULL, ++ 1, ¬ify_info, ++ MESSAGE_RES_CPG_CONFCHG_CALLBACK); ++ ++ for (iter = process_info_list_head.next; iter != &process_info_list_head; ) { ++ pi = list_entry(iter, struct process_info, list); ++ iter = iter->next; ++ ++ if (pi->pid == pid && pi->nodeid == nodeid && ++ mar_name_compare (&pi->group, name)==0) { ++ list_del (&pi->list); ++ free (pi); ++ } ++ } ++} ++ + static void message_handler_req_exec_cpg_downlist_old ( + const void *message, + unsigned int nodeid) +@@ -1269,31 +1306,15 @@ static void message_handler_req_exec_cpg_procleave ( + unsigned int nodeid) + { + const struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = message; +- struct process_info *pi; +- struct list_head *iter; +- mar_cpg_address_t notify_info; +- +- log_printf(LOGSYS_LEVEL_DEBUG, "got procleave message from cluster node %d", nodeid); +- +- notify_info.pid = req_exec_cpg_procjoin->pid; +- notify_info.nodeid = nodeid; +- notify_info.reason = req_exec_cpg_procjoin->reason; +- +- notify_lib_joinlist(&req_exec_cpg_procjoin->group_name, NULL, +- 0, NULL, +- 1, ¬ify_info, +- MESSAGE_RES_CPG_CONFCHG_CALLBACK); + +- for (iter = process_info_list_head.next; iter != &process_info_list_head; ) { +- pi = list_entry(iter, struct process_info, list); +- iter = iter->next; ++ log_printf(LOGSYS_LEVEL_DEBUG, "got procleave message from cluster node %x (%s) for pid %u", ++ nodeid, ++ api->totem_ifaces_print(nodeid), ++ (unsigned int)req_exec_cpg_procjoin->pid); + +- if (pi->pid == req_exec_cpg_procjoin->pid && pi->nodeid == nodeid && +- mar_name_compare (&pi->group, &req_exec_cpg_procjoin->group_name)==0) { +- list_del (&pi->list); +- free (pi); +- } +- } ++ do_proc_leave (&req_exec_cpg_procjoin->group_name, ++ req_exec_cpg_procjoin->pid, nodeid, ++ req_exec_cpg_procjoin->reason); + } + + +-- +1.7.1 + diff --git a/SOURCES/bz1067028-2-cpg-Make-sure-nodid-is-always-logged-as-hex-num.patch b/SOURCES/bz1067028-2-cpg-Make-sure-nodid-is-always-logged-as-hex-num.patch new file mode 100644 index 0000000..2123f0c --- /dev/null +++ b/SOURCES/bz1067028-2-cpg-Make-sure-nodid-is-always-logged-as-hex-num.patch @@ -0,0 +1,57 @@ +From 83c63b247f4030fe8123df7c9f96d7a1c8e245b1 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Tue, 11 Feb 2014 15:30:33 +0100 +Subject: [PATCH] cpg: Make sure nodid is always logged as hex num + +Also number is prefixed by 0x so it's easier to spot that number is +hexadecimal. + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +--- + exec/cpg.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/exec/cpg.c b/exec/cpg.c +index 9981440..db8d987 100644 +--- a/exec/cpg.c ++++ b/exec/cpg.c +@@ -1236,7 +1236,7 @@ static void message_handler_req_exec_cpg_downlist_old ( + const void *message, + unsigned int nodeid) + { +- log_printf (LOGSYS_LEVEL_WARNING, "downlist OLD from node %d", ++ log_printf (LOGSYS_LEVEL_WARNING, "downlist OLD from node 0x%x", + nodeid); + } + +@@ -1291,7 +1291,7 @@ static void message_handler_req_exec_cpg_procjoin ( + { + const struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = message; + +- log_printf(LOGSYS_LEVEL_DEBUG, "got procjoin message from cluster node %d (%s) for pid %u", ++ log_printf(LOGSYS_LEVEL_DEBUG, "got procjoin message from cluster node 0x%x (%s) for pid %u", + nodeid, + api->totem_ifaces_print(nodeid), + (unsigned int)req_exec_cpg_procjoin->pid); +@@ -1307,7 +1307,7 @@ static void message_handler_req_exec_cpg_procleave ( + { + const struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = message; + +- log_printf(LOGSYS_LEVEL_DEBUG, "got procleave message from cluster node %x (%s) for pid %u", ++ log_printf(LOGSYS_LEVEL_DEBUG, "got procleave message from cluster node 0x%x (%s) for pid %u", + nodeid, + api->totem_ifaces_print(nodeid), + (unsigned int)req_exec_cpg_procjoin->pid); +@@ -1328,7 +1328,7 @@ static void message_handler_req_exec_cpg_joinlist ( + const struct join_list_entry *jle = (const struct join_list_entry *)(message + sizeof(struct qb_ipc_response_header)); + struct joinlist_msg *stored_msg; + +- log_printf(LOGSYS_LEVEL_DEBUG, "got joinlist message from node %x", ++ log_printf(LOGSYS_LEVEL_DEBUG, "got joinlist message from node 0x%x", + nodeid); + + while ((const char*)jle < message + res->size) { +-- +1.7.1 + diff --git a/SOURCES/bz1067028-3-cpg-Make-sure-left-nodes-are-really-removed.patch b/SOURCES/bz1067028-3-cpg-Make-sure-left-nodes-are-really-removed.patch new file mode 100644 index 0000000..6e2d0f5 --- /dev/null +++ b/SOURCES/bz1067028-3-cpg-Make-sure-left-nodes-are-really-removed.patch @@ -0,0 +1,91 @@ +From fbe8768f1bbab6d546023d70e7f7b91a9dc213b0 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Mon, 17 Feb 2014 15:36:19 +0100 +Subject: [PATCH] cpg: Make sure left nodes are really removed + +When node is paused and other nodes has in meantime exited cpg process, +paused node after resume doesn't update it's membership correctly so on +previously paused node exited cpg process is still visible. + +Solution is to compare join list with cpd and remove all pids which are +not included in join list. + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +--- + exec/cpg.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 52 insertions(+), 0 deletions(-) + +diff --git a/exec/cpg.c b/exec/cpg.c +index db8d987..1c6fbb9 100644 +--- a/exec/cpg.c ++++ b/exec/cpg.c +@@ -931,6 +931,56 @@ static void downlist_master_choose_and_send (void) + qb_map_destroy(group_map); + } + ++/* ++ * Remove processes that might have left the group while we were suspended. ++ */ ++static void joinlist_remove_zombie_pi_entries (void) ++{ ++ struct list_head *pi_iter; ++ struct list_head *jl_iter; ++ struct process_info *pi; ++ struct joinlist_msg *stored_msg; ++ int found; ++ ++ for (pi_iter = process_info_list_head.next; pi_iter != &process_info_list_head; ) { ++ pi = list_entry (pi_iter, struct process_info, list); ++ pi_iter = pi_iter->next; ++ ++ /* ++ * Ignore local node ++ */ ++ if (pi->nodeid == api->totem_nodeid_get()) { ++ continue ; ++ } ++ ++ /* ++ * Try to find message in joinlist messages ++ */ ++ found = 0; ++ for (jl_iter = joinlist_messages_head.next; ++ jl_iter != &joinlist_messages_head; ++ jl_iter = jl_iter->next) { ++ ++ stored_msg = list_entry(jl_iter, struct joinlist_msg, list); ++ ++ if (stored_msg->sender_nodeid == api->totem_nodeid_get()) { ++ continue ; ++ } ++ ++ if (pi->nodeid == stored_msg->sender_nodeid && ++ pi->pid == stored_msg->pid && ++ mar_name_compare (&pi->group, &stored_msg->group_name) == 0) { ++ found = 1; ++ break ; ++ } ++ } ++ ++ if (!found) { ++ do_proc_leave(&pi->group, pi->pid, pi->nodeid, CONFCHG_CPG_REASON_PROCDOWN); ++ } ++ } ++} ++ + static void joinlist_inform_clients (void) + { + struct joinlist_msg *stored_msg; +@@ -957,6 +1007,8 @@ static void joinlist_inform_clients (void) + do_proc_join (&stored_msg->group_name, stored_msg->pid, stored_msg->sender_nodeid, + CONFCHG_CPG_REASON_NODEUP); + } ++ ++ joinlist_remove_zombie_pi_entries (); + } + + static void downlist_messages_delete (void) +-- +1.7.1 + diff --git a/SPECS/corosync.spec b/SPECS/corosync.spec index b9ed3b4..356b98f 100644 --- a/SPECS/corosync.spec +++ b/SPECS/corosync.spec @@ -20,13 +20,17 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 2.3.2 +Version: 2.3.3 Release: 2%{?gitver}%{?dist} License: BSD Group: System Environment/Base URL: http://www.corosync.org/ Source0: http://corosync.org/download/%{name}-%{version}%{?gittarver}.tar.gz +Patch0: bz1067028-1-cpg-Refactor-mh_req_exec_cpg_procleave.patch +Patch1: bz1067028-2-cpg-Make-sure-nodid-is-always-logged-as-hex-num.patch +Patch2: bz1067028-3-cpg-Make-sure-left-nodes-are-really-removed.patch + %if 0%{?rhel} ExclusiveArch: i686 x86_64 %endif @@ -73,6 +77,9 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %prep %setup -q -n %{name}-%{version}%{?gittarver} +%patch0 -p1 -b .bz1067028-1 +%patch1 -p1 -b .bz1067028-2 +%patch2 -p1 -b .bz1067028-3 %build %if %{with runautogen} @@ -331,6 +338,30 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/quorum_overview.8* %changelog +* Thu Feb 20 2014 Jan Friesse 2.3.3-2 +- Resolves: rhbz#1067028 + +- cpg: Refactor mh_req_exec_cpg_procleave (rhbz#1067028) +- merge upstream commit fcf26e03036b6ae5a8ef762ea0b5691a4f790c92 (rhbz#1067028) +- cpg: Make sure nodid is always logged as hex num (rhbz#1067028) +- merge upstream commit 83c63b247f4030fe8123df7c9f96d7a1c8e245b1 (rhbz#1067028) +- cpg: Make sure left nodes are really removed (rhbz#1067028) +- merge upstream commit fbe8768f1bbab6d546023d70e7f7b91a9dc213b0 (rhbz#1067028) + +* Tue Jan 14 2014 Jan Friesse - 2.3.3-1 +- Resolves: rhbz#1030559 +- Resolves: rhbz#1038652 +- Resolves: rhbz#1052049 + +* Fri Dec 27 2013 Daniel Mach - 2.3.2-4 +- Mass rebuild 2013-12-27 + +* Wed Dec 04 2013 Jan Friesse 2.3.2-3 +- Resolves: rhbz#1031832 + +- cfgtool: return error on reload failure (rhbz#1031832) +- merge upstream commit 7014f10123a634cf026491edc9a09d6044106116 (rhbz#1031832) + * Thu Nov 7 2013 Jan Friesse 2.3.2-2 - Resolves: rhbz#1008561