public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: David Teigland <teigland@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: master - fenced: kill the cluster on misbehaving nodes Date: Tue, 19 Aug 2008 21:28:00 -0000 [thread overview] Message-ID: <20080819211858.F41661202A5@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=55e768917ecd4e3e252d5606c10f9cf0dda54d94 Commit: 55e768917ecd4e3e252d5606c10f9cf0dda54d94 Parent: 34679f895b267f6efdfa83a63aa65d09e631d5ed Author: David Teigland <teigland@redhat.com> AuthorDate: Tue Aug 19 16:09:18 2008 -0500 Committer: David Teigland <teigland@redhat.com> CommitterDate: Tue Aug 19 16:09:18 2008 -0500 fenced: kill the cluster on misbehaving nodes Kill cman on other nodes where the fenced process fails. Signed-off-by: David Teigland <teigland@redhat.com> --- fence/fenced/cpg.c | 3 +++ fence/fenced/fd.h | 1 + fence/fenced/member_cman.c | 22 ++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c index 1a0ff17..ccebbd9 100644 --- a/fence/fenced/cpg.c +++ b/fence/fenced/cpg.c @@ -1069,6 +1069,9 @@ static int add_change(struct fd *fd, log_debug("add_change %u nodeid %d remove reason %d", cg->seq, memb->nodeid, left_list[i].reason); + + if (left_list[i].reason == CPG_REASON_PROCDOWN) + kick_node_from_cluster(memb->nodeid); } for (i = 0; i < joined_list_entries; i++) { diff --git a/fence/fenced/fd.h b/fence/fenced/fd.h index 96c8a1d..21cac39 100644 --- a/fence/fenced/fd.h +++ b/fence/fenced/fd.h @@ -249,6 +249,7 @@ int is_cman_member(int nodeid); char *nodeid_to_name(int nodeid); int name_to_nodeid(char *name); struct node *get_new_node(struct fd *fd, int nodeid); +void kick_node_from_cluster(int nodeid); /* recover.c */ diff --git a/fence/fenced/member_cman.c b/fence/fenced/member_cman.c index 7820d64..16e08a8 100644 --- a/fence/fenced/member_cman.c +++ b/fence/fenced/member_cman.c @@ -5,9 +5,21 @@ #define BUFLEN MAX_NODENAME_LEN+1 static cman_handle_t ch; +static cman_handle_t ch_admin; static cman_node_t cman_nodes[MAX_NODES]; static int cman_node_count; +void kick_node_from_cluster(int nodeid) +{ + if (!nodeid) { + log_error("telling cman to shut down cluster locally"); + cman_shutdown(ch_admin, CMAN_SHUTDOWN_ANYWAY); + } else { + log_error("telling cman to remove nodeid %d from cluster", + nodeid); + cman_kill_node(ch_admin, nodeid); + } +} static int name_equal(char *name1, char *name2) { @@ -146,12 +158,18 @@ int setup_cman(void) int init = 0, active = 0; retry_init: - ch = cman_init(NULL); - if (!ch) { + ch_admin = cman_admin_init(NULL); + if (!ch_admin) { if (init++ < 2) { sleep(1); goto retry_init; } + log_error("cman_admin_init error %d", errno); + return -ENOTCONN; + } + + ch = cman_init(NULL); + if (!ch) { log_error("cman_init error %d", errno); return -ENOTCONN; }
reply other threads:[~2008-08-19 21:20 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080819211858.F41661202A5@lists.fedorahosted.org \ --to=teigland@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).