public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: master - rgmanager: Wait for fence domain join to complete Date: Wed, 24 Sep 2008 17:58:00 -0000 [thread overview] Message-ID: <20080924175655.294E312042E@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0bdab80b760ea52742cb144c53f4c212d2b7c184 Commit: 0bdab80b760ea52742cb144c53f4c212d2b7c184 Parent: 9f0d36f3fee3c7c00e2f5cf7cbd9ea878220a69d Author: Lon Hohberger <lhh@redhat.com> AuthorDate: Thu Aug 28 16:53:11 2008 -0400 Committer: Lon Hohberger <lhh@redhat.com> CommitterDate: Wed Sep 24 13:40:12 2008 -0400 rgmanager: Wait for fence domain join to complete rhbz 459754, take 3 --- rgmanager/src/daemons/main.c | 25 ++++++++++++++++++++++++- rgmanager/src/daemons/rg_event.c | 14 ++++++++++++++ 2 files changed, 38 insertions(+), 1 deletions(-) diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c index 89bdcd1..0c168f5 100644 --- a/rgmanager/src/daemons/main.c +++ b/rgmanager/src/daemons/main.c @@ -42,6 +42,9 @@ int svc_exists(char *); int watchdog_init(void); int32_t master_event_callback(char *key, uint64_t viewno, void *data, uint32_t datalen); +int node_has_fencing(int nodeid); +int fence_domain_joined(void); + int shutdown_pending = 0, running = 1, need_reconfigure = 0; char debug = 0; /* XXX* */ static int signalled = 0; @@ -892,7 +895,25 @@ clu_initialize(cman_handle_t *ch) while (cman_is_quorate(*ch) == 0) { sleep(1); } - clulog(LOG_NOTICE, "Quorum formed, starting\n"); + clulog(LOG_NOTICE, "Quorum formed\n"); + } + +} + + +void +wait_for_fencing(void) +{ + if (node_has_fencing(my_id()) && !fence_domain_joined()) { + clulog(LOG_INFO, "Waiting for fence domain join operation " + "to complete\n"); + + while (fence_domain_joined() == 0) + sleep(1); + clulog(LOG_INFO, "Fence domain joined\n"); + } else { + clulog(LOG_DEBUG, "Fence domain already joined " + "or no fencing configured\n"); } } @@ -1001,6 +1022,8 @@ main(int argc, char **argv) clulog(LOG_INFO, "I am node #%d\n", my_id()); + wait_for_fencing(); + /* We know we're quorate. At this point, we need to read the resource group trees from ccsd. diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c index af3bf08..fc5b1cb 100644 --- a/rgmanager/src/daemons/rg_event.c +++ b/rgmanager/src/daemons/rg_event.c @@ -157,6 +157,20 @@ node_has_fencing(int nodeid) } +/* Since the API for groupd is private, use group_tool to find + out if we've joined the fence domain */ +int +fence_domain_joined(void) +{ + int rv; + + rv = system("group_tool ls fence default &> /dev/null"); + if (rv == 0) + return 1; + return 0; +} + + /** Quick query to cman to see if a node has been fenced. */
reply other threads:[~2008-09-24 17:58 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=20080924175655.294E312042E@lists.fedorahosted.org \ --to=lon@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).