[sheepdog] [PATCH 2/2] Revert "sheep: let all sheeps with smaller epoch added into delayed_nodes list"

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sun Sep 9 19:15:47 CEST 2012


This reverts commit 98241c50d23d99047c37a606a845f5f0bccbbf50.

We cannot pass test 002 after the commit and it looks difficult to fix
the problem.  The benefit of the commit is not mandatory, so let's
revert it for now and fix it in future.
---
 sheep/group.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index d229d17..8c3b499 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -411,6 +411,7 @@ static bool add_delayed_node(uint32_t epoch, struct sd_node *node)
 
 	if (find_entry_list(node, &sys->delayed_nodes))
 		return false;
+	assert(!find_entry_epoch(node, epoch));
 
 	n = xmalloc(sizeof(*n));
 	n->ent = *node;
@@ -545,6 +546,10 @@ static int cluster_wait_for_join_check(struct sd_node *joined,
 		eprintf("joining node epoch too small: %"
 			PRIu32 " vs %" PRIu32 "\n",
 			jm->epoch, local_epoch);
+
+		if (bsearch(joined, local_entries, nr_local_entries,
+			    sizeof(struct sd_node), node_id_cmp))
+			return CJ_RES_FAIL;
 		return CJ_RES_JOIN_LATER;
 	}
 
-- 
1.7.2.5




More information about the sheepdog mailing list