This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".
The branch, master has been updated
via 4f3e5eeb333dc74fb81470131d8d0e8b3d383ed4 (commit)
from f47515ef985da41de67f7f5c4158371bb13d44c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4f3e5eeb333dc74fb81470131d8d0e8b3d383ed4
Author: David Teigland <teigland@redhat.com>
Date: Tue May 6 14:28:03 2008 -0500
dlm_controld: code for info/debug queries
Signed-off-by: David Teigland <teigland@redhat.com>
-/* dlmc_lockspace_nodes() types */
+/* dlmc_lockspace_nodes() types
+
+ MEMBERS: members in completed (prev) change,
+ zero if there's no completed (prev) change
+ NEXT: members in in-progress (next) change,
+ zero if there's no in-progress (next) change
+ ALL: NEXT + nonmembers if there's an in-progress (next) change,
+ MEMBERS + nonmembers if there's no in-progress (next) change, but
+ there is a completed (prev) change
+ nonmembers if there's no in-progress (next) or completed (prev)
+ change (possible?)
+
+ dlmc_node_info() returns info for in-progress (next) change, if one exists,
+ otherwise it returns info for completed (prev) change.
+*/
+
#define DLMC_NODES_ALL 1
#define DLMC_NODES_MEMBERS 2
+#define DLMC_NODES_NEXT 3
int dlmc_dump_debug(char *buf);
int dlmc_dump_plocks(char *name, char *buf);
-int dlmc_node_info(char *name, int nodeid, struct dlmc_node *node);
-int dlmc_lockspace_info(char *name, struct dlmc_lockspace *ls);
-int dlmc_lockspace_nodes(char *name, int type, int max, int *count,
+int dlmc_lockspace_info(char *lsname, struct dlmc_lockspace *ls);
+int dlmc_node_info(char *lsname, int nodeid, struct dlmc_node *node);
+int dlmc_lockspaces(int max, int *count, struct dlmc_lockspace *lss);
+int dlmc_lockspace_nodes(char *lsname, int type, int max, int *count,
struct dlmc_node *nodes);
int dlmc_fs_connect(void);
@@ -56,3 +105,4 @@ int dlmc_fs_result(int fd, char *name, int *type, int *nodeid, int *result);
int dlmc_deadlock_check(char *name);
- reply_len = sizeof(struct dlmc_header) + (max * sizeof(struct dlmc_node));
+ reply_len = sizeof(struct dlmc_header) +
+ (max * sizeof(struct dlmc_node));
reply = malloc(reply_len);
if (!reply) {
rv = -1;
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index b9c9dee..e49a377 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -38,6 +38,9 @@ struct node {
int check_fs;
int fs_notified;
uint64_t add_time;
+ uint32_t added_seq; /* for queries */
+ uint32_t removed_seq; /* for queries */
+ int failed_reason; /* for queries */
};
/* One of these change structs is created for every confchg a cpg gets. */
@@ -55,7 +58,8 @@ struct change {
int failed_count;
int state;
int we_joined;
- uint32_t seq; /* just used as a reference when debugging */
+ uint32_t seq; /* used as a reference for debugging, and for queries */
+ uint32_t combined_seq; /* for queries */
};
static int check_fencing_done(struct lockspace *ls)
@@ -399,6 +411,8 @@ static int check_fencing_done(struct lockspace *ls)
return 1;
}
+/* wait for cman to see all the same nodes removed, and to say there's quorum */
+
static int check_quorum_done(struct lockspace *ls)
{
struct node *node;
@@ -429,6 +443,8 @@ static int check_quorum_done(struct lockspace *ls)
return 1;
}
+/* wait for local fs_controld to ack each failed node */
+
static int check_fs_done(struct lockspace *ls)
{
struct node *node;
@@ -605,6 +621,7 @@ static void cleanup_changes(struct lockspace *ls)
ls->started_change = cg;
+static int is_added(struct lockspace *ls, int nodeid)
+{
+ struct change *cg;
+ struct member *memb;
+
+ list_for_each_entry(cg, &ls->changes, list) {
+ memb = find_memb(cg, nodeid);
+ if (memb && memb->added)
+ return 1;
+ }
+ return 0;
+}
+
/* We require new members (memb->added) to be joining the lockspace
(memb->joining). New members that are not joining the lockspace can happen
when the cpg partitions and is then merged back together (shouldn't happen
in general, but is possible). We label these new members that are not
joining as "disallowed", and ignore their start message. */
+/* The added/joining checks to detect disallowed nodes need to consider
+ the whole set of changes that are being started. */
+
/* Handle spurious joins by ignoring this start message if the node says it's
not joining (i.e. it's already a member), but we see it being added (i.e.
it's not already a member) */
@@ -850,7 +883,7 @@ static void receive_start(struct lockspace *ls, struct dlm_header *hd, int len)
{
struct change *cg;
struct member *memb;
- int joining = 0;
+ int joining, added;
uint32_t seq = hd->msgdata;
struct dlmc_header {
unsigned int magic;
diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index 370989a..b35f655 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -222,8 +222,9 @@ char *msg_name(int type);
void update_flow_control_status(void);
int set_node_info(struct lockspace *ls, int nodeid, struct dlmc_node *node);
int set_lockspace_info(struct lockspace *ls, struct dlmc_lockspace *lockspace);
+int set_lockspaces(int *count, struct dlmc_lockspace **lss_out);
int set_lockspace_nodes(struct lockspace *ls, int option, int *node_count,
- struct dlmc_node **nodes);
+ struct dlmc_node **nodes_out);
int set_fs_notified(struct lockspace *ls, int nodeid);
/* deadlock.c */
@@ -278,9 +279,11 @@ int setup_groupd(void);
void process_groupd(int ci);
int dlm_join_lockspace_group(struct lockspace *ls);
int dlm_leave_lockspace_group(struct lockspace *ls);
-int set_node_info_group(struct lockspace *ls, int nodeid, struct dlmc_node *node);
+int set_node_info_group(struct lockspace *ls, int nodeid,
+ struct dlmc_node *node);
int set_lockspace_info_group(struct lockspace *ls,
struct dlmc_lockspace *lockspace);
+int set_lockspaces_group(int *count, struct dlmc_lockspace **lss_out);
int set_lockspace_nodes_group(struct lockspace *ls, int option, int *node_count,
struct dlmc_node **nodes);
diff --git a/group/dlm_controld/group.c b/group/dlm_controld/group.c
index 7f31f69..023fadd 100644
--- a/group/dlm_controld/group.c
+++ b/group/dlm_controld/group.c
@@ -240,19 +240,28 @@ int setup_groupd(void)
return rv;
}
-int set_node_info_group(struct lockspace *ls, int nodeid, struct dlmc_node *node)
+/* FIXME: most of the query info doesn't apply in the LIBGROUP mode,
+ but we can emulate some basic parts of it */
+
+int set_lockspace_info_group(struct lockspace *ls,
+ struct dlmc_lockspace *lockspace)
{
return 0;
}
int set_lockspace_nodes_group(struct lockspace *ls, int option, int *node_count,
- struct dlmc_node **nodes)
+ struct dlmc_node **nodes_out)
{
return 0;
}
diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c
index 39bbdba..46d3fe8 100644
--- a/group/dlm_controld/main.c
+++ b/group/dlm_controld/main.c
@@ -436,7 +436,8 @@ static void query_dump_plocks(int fd, char *name)
/* combines a header and the data and sends it back to the client in
a single do_write() call */
-static void do_reply(int fd, int cmd, char *name, int result, char *buf, int buflen)
+static void do_reply(int fd, int cmd, char *name, int result, char *buf,
+ int buflen)
{
char *reply;
int reply_len;
@@ -457,10 +458,10 @@ static void do_reply(int fd, int cmd, char *name, int result, char *buf, int buf
free(reply);
}