From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cman lib/libcman.h daemon/cnxman-socke ...
Date: 5 Nov 2007 15:15:54 -0000 [thread overview]
Message-ID: <20071105151554.17458.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2007-11-05 15:15:53
Modified files:
cman/lib : libcman.h
cman/daemon : cnxman-socket.h commands.c
Log message:
Enhance API to retrive just the quorum device information using cman_get_node()
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.h.diff?cvsroot=cluster&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cnxman-socket.h.diff?cvsroot=cluster&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.73&r2=1.74
--- cluster/cman/lib/libcman.h 2007/08/28 13:30:23 1.34
+++ cluster/cman/lib/libcman.h 2007/11/05 15:15:53 1.35
@@ -38,7 +38,13 @@
/*
* Pass this into cman_get_node() as the nodeid to get local node information
*/
-#define CMAN_NODEID_US 0
+#define CMAN_NODEID_US 0
+
+/*
+ * Pass this into cman_get_node() as the nodeid to get quorum device information
+ */
+#define CMAN_NODEID_QDISK -1
+
/* Pass this into cman_send_data to send a message to all nodes */
#define CMAN_NODEID_ALL 0
--- cluster/cman/daemon/cnxman-socket.h 2007/08/28 13:14:10 1.19
+++ cluster/cman/daemon/cnxman-socket.h 2007/11/05 15:15:53 1.20
@@ -2,7 +2,7 @@
*******************************************************************************
**
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-** Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
+** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
**
** This copyrighted material is made available to anyone wishing to use,
** modify, copy, or redistribute it subject to the terms and conditions
@@ -83,6 +83,9 @@
* transition */
#define HIGH_PROTECTED_PORT 9
+/* Nodeid passed to CMD_GETNODE to return the quorum device info */
+#define CLUSTER_GETNODE_QUORUMDEV -1
+
/* Reasons for leaving the cluster */
#define CLUSTER_LEAVEFLAG_DOWN 0 /* Normal shutdown */
#define CLUSTER_LEAVEFLAG_KILLED 1
--- cluster/cman/daemon/commands.c 2007/10/03 10:06:21 1.73
+++ cluster/cman/daemon/commands.c 2007/11/05 15:15:53 1.74
@@ -599,17 +599,25 @@
if (!we_are_a_cluster_member)
return -ENOENT;
- if (!u_node->name[0]) {
- if (u_node->node_id == 0)
- u_node->node_id = us->node_id;
- node = find_node_by_nodeid(u_node->node_id);
+ if (u_node->node_id == CLUSTER_GETNODE_QUORUMDEV) {
+ if (quorum_device)
+ node = quorum_device;
+ else
+ return -ENOENT;
}
- else
- node = find_node_by_name(u_node->name);
+ else {
+ if (!u_node->name[0]) {
+ if (u_node->node_id == 0)
+ u_node->node_id = us->node_id;
+ node = find_node_by_nodeid(u_node->node_id);
+ }
+ else
+ node = find_node_by_name(u_node->name);
- if (!node) {
- P_MEMB("cmd_get_node failed: id=%d, name='%s'\n", u_node->node_id, u_node->name);
- return -ENOENT;
+ if (!node) {
+ P_MEMB("cmd_get_node failed: id=%d, name='%s'\n", u_node->node_id, u_node->name);
+ return -ENOENT;
+ }
}
copy_to_usernode(node, r_node);
@@ -1046,6 +1054,7 @@
if (!quorum_device || quorum_device->state == NODESTATE_DEAD)
return;
+ P_MEMB("quorum_device_timer_fn\n");
gettimeofday(&now, NULL);
if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) {
quorum_device->state = NODESTATE_DEAD;
@@ -2024,9 +2033,9 @@
node->state = NODESTATE_DEAD;
cluster_members--;
- if ((node->leave_reason & 0xF) & CLUSTER_LEAVEFLAG_REMOVED)
+ if ((node->leave_reason & 0xF) & CLUSTER_LEAVEFLAG_REMOVED)
recalculate_quorum(1, 1);
- else
+ else
recalculate_quorum(0, 0);
break;
reply other threads:[~2007-11-05 15:15 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=20071105151554.17458.qmail@sourceware.org \
--to=pcaulfield@sourceware.org \
/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.