diff -Nru corosync-1.4.2/debian/changelog corosync-1.4.2/debian/changelog --- corosync-1.4.2/debian/changelog 2014-04-10 19:21:37.000000000 +0000 +++ corosync-1.4.2/debian/changelog 2014-05-12 14:37:06.000000000 +0000 @@ -1,3 +1,9 @@ +corosync (1.4.2-2ubuntu0.2) precise; urgency=medium + + * Fixed consensus being empty in case failed_to_recv is set (LP: #1318441) + + -- Rafael David Tinoco Mon, 12 May 2014 09:37:06 -0500 + corosync (1.4.2-2ubuntu0.1) precise-proposed; urgency=low [ Martin Loschwitz ] diff -Nru corosync-1.4.2/debian/patches/if-failed_to_recv-is-set-consensus-can-be-empty.patch corosync-1.4.2/debian/patches/if-failed_to_recv-is-set-consensus-can-be-empty.patch --- corosync-1.4.2/debian/patches/if-failed_to_recv-is-set-consensus-can-be-empty.patch 1970-01-01 00:00:00.000000000 +0000 +++ corosync-1.4.2/debian/patches/if-failed_to_recv-is-set-consensus-can-be-empty.patch 2014-05-12 14:37:03.000000000 +0000 @@ -0,0 +1,53 @@ +Description: If failed_to_recv is set, consensus can be empty + +Actual logic subtracts all failed nodes from the nodes list and +check for consensus for the online ones. Since one node can mark +itself as a failed node (failed_to_recv), incapable of receiving +messages, there is a possibility of having no nodes left on the +list and the final assert (to have more than 1 member) fails, +making corosync to exit. + +Author: Jan Friesse +Origin: upstream, commit: d4db2ea +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1318441 +Last-Update: 2014-05-11 +--- + exec/totemsrp.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/exec/totemsrp.c b/exec/totemsrp.c +index ec951df..a4cc19a 100644 +--- a/exec/totemsrp.c ++++ b/exec/totemsrp.c +@@ -1247,6 +1247,16 @@ static int memb_consensus_agreed ( + break; + } + } ++ ++ if (agreed && instance->failed_to_recv == 1) { ++ /* ++ * Both nodes agreed on our failure. We don't care how many proc list items left because we ++ * will create single ring anyway. ++ */ ++ ++ return (agreed); ++ } ++ + assert (token_memb_entries >= 1); + + return (agreed); +@@ -3617,6 +3627,11 @@ printf ("token seq %d\n", token->seq); + instance->my_aru_count = 0; + } + ++ /* ++ * We really don't follow specification there. In specification, OTHER nodes ++ * detect failure of one node (based on aru_count) and my_id IS NEVER added ++ * to failed list (so node never mark itself as failed) ++ */ + if (instance->my_aru_count > instance->totem_config->fail_to_recv_const && + token->aru_addr == instance->my_id.addr[0].nodeid) { + +-- +1.9.1 + diff -Nru corosync-1.4.2/debian/patches/series corosync-1.4.2/debian/patches/series --- corosync-1.4.2/debian/patches/series 2011-10-19 14:15:48.000000000 +0000 +++ corosync-1.4.2/debian/patches/series 2014-05-12 14:37:03.000000000 +0000 @@ -1 +1,2 @@ 0001-Define-semun-on-KFreeBSD.patch +if-failed_to_recv-is-set-consensus-can-be-empty.patch