All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaju Zhang <jjzhang.linux@gmail.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] dlm_controld.pcmk: Fix membership	change judging issue
Date: Fri, 14 May 2010 13:33:15 +0800	[thread overview]
Message-ID: <20100514053314.GA17468@linux-jjzhang> (raw)
In-Reply-To: <AANLkTimbNlduQjR0wjrGlW-Pi7pF2nQyddXTCkDK6OFk@mail.gmail.com>

On Fri, May 14, 2010 at 12:08:25PM +0800, Jiaju Zhang wrote:
 
> Both update_cluster and process_cluster can't be removed. Yes, moving
> the place of ais_dispatch should have nothing to do with this issue.
> Oh, this is because I added it in the debugging stage and forgot to
> remove it in the final version, just sending the working version to
> the list, sorry, I'll posted an updated patch soon ;-)
> 

This is the updated version of this patch, thanks a lot for your
review and comments ;-)

Thanks,
Jiaju

Signed-off-by: Jiaju Zhang <jjzhang.linux@gmail.com>
---
 group/dlm_controld/pacemaker.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/group/dlm_controld/pacemaker.c b/group/dlm_controld/pacemaker.c
index 3150a1f..0c30c5a 100644
--- a/group/dlm_controld/pacemaker.c
+++ b/group/dlm_controld/pacemaker.c
@@ -102,6 +102,14 @@ void close_cluster(void) {
 #include <arpa/inet.h>
 #include <corosync/totem/totemip.h>
 
+static gboolean is_member(const crm_node_t *node)
+{
+    if(node && safe_str_eq(node->state, CRM_NODE_MEMBER))
+	return TRUE;
+
+    return FALSE;
+}
+
 void dlm_process_node(gpointer key, gpointer value, gpointer user_data)
 {
     int rc = 0;
@@ -119,7 +127,7 @@ void dlm_process_node(gpointer key, gpointer value, gpointer user_data)
     snprintf(path, PATH_MAX, "%s/%d", COMMS_DIR, node->id);
 
     rc = stat(path, &tmp);
-    is_active = crm_is_member_active(node);
+    is_active = is_member(node);
     
     if(rc == 0 && is_active) {
 	/* nothing to do?
@@ -212,7 +220,7 @@ void dlm_process_node(gpointer key, gpointer value, gpointer user_data)
     }
 
     log_debug("%s %sctive node %u '%s': born-on=%llu, last-seen=%llu, this-event=%llu, last-event=%llu",
-	       action, crm_is_member_active(value)?"a":"ina",
+	       action, is_member(value)?"a":"ina",
 	       node->id, node->uname, node->born, node->last_seen,
 	       crm_peer_seq, (unsigned long long)*last);
 }
@@ -220,7 +228,7 @@ void dlm_process_node(gpointer key, gpointer value, gpointer user_data)
 int is_cluster_member(uint32_t nodeid)
 {
     crm_node_t *node = crm_get_peer(nodeid, NULL);
-    return crm_is_member_active(node);
+    return is_member(node);
 }
 
 char *nodeid2name(int nodeid) {



      reply	other threads:[~2010-05-14  5:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13  8:49 [Cluster-devel] [PATCH] dlm_controld.pcmk: Fix membership change judging issue Jiaju Zhang
     [not found] ` <20100513095117.GM20952@suse.de>
2010-05-13 10:18   ` Jiaju Zhang
2010-05-13 16:25   ` Andrew Beekhof
     [not found]     ` <20100513183215.GP20952@suse.de>
2010-05-13 20:19       ` Andrew Beekhof
2010-05-14  3:04         ` Tim Serong
2010-05-14 10:15           ` Andrew Beekhof
2010-05-14 11:28             ` Jiaju Zhang
     [not found]         ` <20100513203604.GQ20952@suse.de>
2010-05-14  9:52           ` Andrew Beekhof
2010-05-14 11:25             ` Jiaju Zhang
2010-05-14  4:08     ` Jiaju Zhang
2010-05-14  5:33       ` Jiaju Zhang [this message]

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=20100514053314.GA17468@linux-jjzhang \
    --to=jjzhang.linux@gmail.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.