[sheepdog] [PATCH v2 9/9] sheep: use the same logic in sd_check_join_cb()
MORITA Kazutaka
morita.kazutaka at gmail.com
Fri Jul 12 22:25:59 CEST 2013
From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Even if the joining node is the first one, we can use the same logic.
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
sheep/group.c | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/sheep/group.c b/sheep/group.c
index 238c884..e5256ba 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -815,36 +815,6 @@ enum cluster_join_result sd_check_join_cb(const struct sd_node *joining,
return CJ_RES_FAIL;
}
- if (node_is_local(joining)) {
- struct sd_node entries[SD_MAX_NODES];
- int nr_entries;
- uint32_t epoch;
-
- /*
- * If I'm the first sheep joins in corosync, I
- * becomes the master without sending JOIN.
- */
-
- sd_printf(SDOG_DEBUG, "%s", node_to_str(&sys->this_node));
-
- jm->cluster_status = sys->status;
-
- epoch = get_latest_epoch();
- if (!epoch)
- return CJ_RES_SUCCESS;
-
- nr_entries = epoch_log_read(epoch, entries, sizeof(entries));
- if (nr_entries == -1)
- return CJ_RES_FAIL;
-
- sys->cinfo.epoch = epoch;
- jm->cinfo.ctime = sys->cinfo.ctime;
-
- if (nr_entries == 1)
- jm->cluster_status = SD_STATUS_OK;
- return CJ_RES_SUCCESS;
- }
-
jm->cluster_status = sys->status;
switch (sys->status) {
--
1.7.9.5
More information about the sheepdog
mailing list