dlm: master - dlm_controld/dlm_tool: dump daemon status
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: d8d82c5f026b306dad35c50a1b038105c19c3324
Parent: a2a97c61ed6bb1b0aa82954f1f29c6e317de50ad
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Mar 30 13:54:12 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Mar 30 13:54:12 2012 -0500
dlm_controld/dlm_tool: dump daemon status
dlm_tool status to print current daemon node state.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/daemon_cpg.c | 130 ++++++++++++++++++++++++++++++++++++++----
dlm_controld/dlm_controld.h | 17 ++++++
dlm_controld/dlm_daemon.h | 2 +
dlm_controld/lib.c | 104 +++++++++++++++++++++++++++++++++
dlm_controld/libdlmcontrol.h | 1 +
dlm_controld/main.c | 4 +
dlm_tool/main.c | 11 ++++
7 files changed, 257 insertions(+), 12 deletions(-)
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index 3b7e140..dc9e780 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -54,27 +54,25 @@ struct fence_result {
struct node_daemon {
struct list_head list;
int nodeid;
-
- uint64_t daemon_add_time;
- uint64_t daemon_rem_time;
- int daemon_member;
-
int killed;
-
- struct protocol proto;
-
- struct fence_config fence_config;
-
- int fence_in_progress_unknown;
+ int daemon_member;
int left_reason;
int recover_setup;
+ int fence_in_progress_unknown;
int need_fence_clear;
int need_fencing;
int delay_fencing;
int fence_pid;
int fence_pid_wait;
- int fence_actor_done;
+ int fence_actor_done; /* for status/debug */
+ int fence_actor_last; /* for status/debug */
int fence_actors[MAX_NODES];
+
+ struct protocol proto;
+ struct fence_config fence_config;
+
+ uint64_t daemon_add_time;
+ uint64_t daemon_rem_time;
uint64_t fail_walltime;
uint64_t fail_monotime;
uint64_t fence_walltime;
@@ -553,6 +551,8 @@ static int get_fence_actor(struct node_daemon *node)
goto retry;
}
+ node->fence_actor_last = low;
+
return low;
}
@@ -793,6 +793,7 @@ static void daemon_fence_work(void)
node->delay_fencing = 0;
node->fence_monotime = 0;
node->fence_walltime = 0;
+ node->fence_actor_last = 0;
node->fence_actor_done = 0;
node->fence_pid_wait = 0;
node->fence_pid = 0;
@@ -1865,6 +1866,7 @@ static void confchg_cb_daemon(cpg_handle_t handle,
node->delay_fencing = 0;
node->fence_monotime = 0;
node->fence_walltime = 0;
+ node->fence_actor_last = 0;
node->fence_actor_done = 0;
node->fence_pid_wait = 0;
node->fence_pid = 0;
@@ -2011,3 +2013,107 @@ void init_daemon(void)
INIT_LIST_HEAD(&startup_nodes);
}
+
+static int print_state_daemon_node(struct node_daemon *node, char *str)
+{
+ snprintf(str, DLMC_STATE_MAXSTR-1,
+ "member=%d "
+ "killed=%d "
+ "left_reason=%d "
+ "need_fencing=%d "
+ "delay_fencing=%d "
+ "fence_pid=%d "
+ "fence_actor_last=%d "
+ "fence_actor_done=%d "
+ "add_time=%llu "
+ "rem_time=%llu "
+ "fail_walltime=%llu "
+ "fail_monotime=%llu "
+ "fence_walltime=%llu "
+ "fence_monotime=%llu ",
+ node->daemon_member,
+ node->killed,
+ node->left_reason,
+ node->need_fencing,
+ node->delay_fencing,
+ node->fence_pid,
+ node->fence_actor_last,
+ node->fence_actor_done,
+ (unsigned long long)node->daemon_add_time,
+ (unsigned long long)node->daemon_rem_time,
+ (unsigned long long)node->fail_walltime,
+ (unsigned long long)node->fail_monotime,
+ (unsigned long long)node->fence_walltime,
+ (unsigned long long)node->fence_monotime);
+
+ return strlen(str) + 1;
+}
+
+void send_state_daemon_nodes(int fd)
+{
+ struct node_daemon *node;
+ struct dlmc_state st;
+ char str[DLMC_STATE_MAXSTR];
+ int str_len;
+
+ list_for_each_entry(node, &daemon_nodes, list) {
+ memset(&st, 0, sizeof(st));
+ st.type = DLMC_STATE_DAEMON_NODE;
+ st.nodeid = node->nodeid;
+
+ memset(str, 0, sizeof(str));
+ str_len = print_state_daemon_node(node, str);
+
+ st.str_len = str_len;
+
+ send(fd, &st, sizeof(st), MSG_NOSIGNAL);
+ if (str_len)
+ send(fd, str, str_len, MSG_NOSIGNAL);
+ }
+}
+
+static int print_state_daemon(char *str)
+{
+ snprintf(str, DLMC_STATE_MAXSTR-1,
+ "member_count=%d "
+ "joined_count=%d "
+ "remove_count=%d "
+ "daemon_ringid=%llu "
+ "cluster_ringid=%llu "
+ "quorate=%d "
+ "fence_pid=%d "
+ "fence_in_progress_unknown=%d "
+ "zombie_count=%d ",
+ daemon_member_count,
+ daemon_joined_count,
+ daemon_remove_count,
+ (unsigned long long)daemon_ringid.seq,
+ (unsigned long long)cluster_ringid_seq,
+ cluster_quorate,
+ daemon_fence_pid,
+ fence_in_progress_unknown,
+ zombie_count);
+
+ return strlen(str) + 1;
+}
+
+void send_state_daemon(int fd)
+{
+ struct dlmc_state st;
+ char str[DLMC_STATE_MAXSTR];
+ int str_len;
+
+ memset(&st, 0, sizeof(st));
+ st.type = DLMC_STATE_DAEMON;
+ st.nodeid = our_nodeid;
+
+ memset(str, 0, sizeof(str));
+ str_len = print_state_daemon(str);
+
+ st.str_len = str_len;
+
+ send(fd, &st, sizeof(st), MSG_NOSIGNAL);
+ if (str_len)
+ send(fd, str, str_len, MSG_NOSIGNAL);
+}
+
diff --git a/dlm_controld/dlm_controld.h b/dlm_controld/dlm_controld.h
index 96b425c..84662eb 100644
--- a/dlm_controld/dlm_controld.h
+++ b/dlm_controld/dlm_controld.h
@@ -30,6 +30,7 @@
#define DLMC_CMD_DEADLOCK_CHECK 10
#define DLMC_CMD_DUMP_LOG_PLOCK 11
#define DLMC_CMD_FENCE_ACK 12
+#define DLMC_CMD_DUMP_STATUS 13
struct dlmc_header {
unsigned int magic;
@@ -43,5 +44,21 @@ struct dlmc_header {
char name[DLM_LOCKSPACE_LEN]; /* no terminating null space */
};
+#define DLMC_STATE_MAXSTR 4096
+#define DLMC_STATE_MAXBIN 4096
+
+#define DLMC_STATE_DAEMON 1
+#define DLMC_STATE_DAEMON_NODE 2
+
+struct dlmc_state {
+ uint32_t type; /* DLMC_STATE_ */
+ uint32_t flags;
+ int32_t nodeid;
+ uint32_t data32;
+ uint32_t data64;
+ uint32_t str_len;
+ uint32_t bin_len;
+};
+
#endif
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 66e008e..6adb16b 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -339,6 +339,8 @@ void close_cpg_daemon(void);
void process_cpg_daemon(int ci);
void set_protocol_stateful(void);
int set_protocol(void);
+void send_state_daemon_nodes(int fd);
+void send_state_daemon(int fd);
void log_config(const struct cpg_name *group_name,
const struct cpg_address *member_list,
diff --git a/dlm_controld/lib.c b/dlm_controld/lib.c
index 228f037..a7cd443 100644
--- a/dlm_controld/lib.c
+++ b/dlm_controld/lib.c
@@ -152,6 +152,110 @@ int dlmc_dump_plocks(char *name, char *buf)
return do_dump(DLMC_CMD_DUMP_PLOCKS, name, buf);
}
+static void print_str(char *str, int len)
+{
+ char *p;
+ int i;
+
+ p = &str[0];
+ for (i = 0; i < len-1; i++) {
+ if (str[i] == ' ') {
+ str[i] = '\0';
+ printf(" %s\n", p);
+ p = &str[i+1];
+ }
+ }
+
+ if (p)
+ printf(" %s\n", p);
+}
+
+static void print_daemon(struct dlmc_state *st, char *str, char *bin, uint32_t flags)
+{
+ printf("our_nodeid %d\n", st->nodeid);
+ print_str(str, st->str_len);
+}
+
+static void print_daemon_node(struct dlmc_state *st, char *str, char *bin, uint32_t flags)
+{
+ printf("nodeid %d\n", st->nodeid);
+ print_str(str, st->str_len);
+}
+
+int dlmc_print_status(uint32_t flags)
+{
+ struct dlmc_header h;
+ struct dlmc_state state;
+ struct dlmc_state *st;
+ char maxstr[DLMC_STATE_MAXSTR];
+ char maxbin[DLMC_STATE_MAXBIN];
+ char *str, *bin;
+ int fd, rv, off;
+
+ init_header(&h, DLMC_CMD_DUMP_STATUS, NULL, 0);
+
+ fd = do_connect(DLMC_QUERY_SOCK_PATH);
+ if (fd < 0) {
+ printf("cannot connect to dlm_controld\n");
+ rv = fd;
+ goto out;
+ }
+
+ rv = do_write(fd, &h, sizeof(h));
+ if (rv < 0) {
+ printf("cannot send to dlm_controld\n");
+ goto out_close;
+ }
+
+ st = &state;
+ str = maxstr;
+ bin = maxbin;
+ off = 0;
+
+ while (1) {
+ memset(&state, 0, sizeof(state));
+ memset(maxstr, 0, sizeof(maxstr));
+ memset(maxbin, 0, sizeof(maxbin));
+
+ rv = recv(fd, st, sizeof(struct dlmc_state), MSG_WAITALL);
+ if (!rv)
+ break;
+ if (rv != sizeof(struct dlmc_state))
+ break;
+
+ if (st->str_len) {
+ rv = recv(fd, str, st->str_len, MSG_WAITALL);
+ if (rv != st->str_len)
+ break;
+ }
+
+ if (st->bin_len) {
+ rv = recv(fd, bin, st->bin_len, MSG_WAITALL);
+ if (rv != st->bin_len)
+ break;
+ }
+
+ switch (st->type) {
+ case DLMC_STATE_DAEMON:
+ print_daemon(st, str, bin, flags);
+ break;
+ case DLMC_STATE_DAEMON_NODE:
+ print_daemon_node(st, str, bin, flags);
+ break;
+ default:
+ break;
+ }
+
+ if (rv < 0)
+ break;
+ }
+
+ out_close:
+ close(fd);
+ out:
+ return rv;
+}
+
int dlmc_node_info(char *name, int nodeid, struct dlmc_node *node)
{
struct dlmc_header h, *rh;
diff --git a/dlm_controld/libdlmcontrol.h b/dlm_controld/libdlmcontrol.h
index 970f705..2af30de 100644
--- a/dlm_controld/libdlmcontrol.h
+++ b/dlm_controld/libdlmcontrol.h
@@ -86,6 +86,7 @@ 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_print_status(uint32_t flags);
#define DLMC_RESULT_REGISTER 1
#define DLMC_RESULT_NOTIFIED 2
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 8e63bb3..794a5c8 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -823,6 +823,10 @@ static void *process_queries(void *arg)
case DLMC_CMD_LOCKSPACE_NODES:
query_lockspace_nodes(f, h.name, h.option, h.data);
break;
+ case DLMC_CMD_DUMP_STATUS:
+ send_state_daemon(f);
+ send_state_daemon_nodes(f);
+ break;
default:
break;
}
diff --git a/dlm_tool/main.c b/dlm_tool/main.c
index 7dddac9..5df5c59 100644
--- a/dlm_tool/main.c
+++ b/dlm_tool/main.c
@@ -39,6 +39,7 @@
#define OP_LOCKDEBUG 9
#define OP_LOG_PLOCK 10
#define OP_FENCE_ACK 11
+#define OP_STATUS 12
static char *prog_name;
static char *lsname;
@@ -317,6 +318,12 @@ static void decode_arguments(int argc, char **argv)
opt_ind = optind + 1;
need_lsname = 0;
break;
+ } else if (!strncmp(argv[optind], "status", 6) &&
+ (strlen(argv[optind]) == 6)) {
+ operation = OP_STATUS;
+ opt_ind = optind + 1;
+ need_lsname = 0;
+ break;
} else if (!strncmp(argv[optind], "deadlock_check", 14) &&
(strlen(argv[optind]) == 14)) {
operation = OP_DEADLOCK_CHECK;
@@ -1322,6 +1329,10 @@ int main(int argc, char **argv)
do_list(lsname);
break;
+ case OP_STATUS:
+ dlmc_print_status(0);
+ break;
+
case OP_DUMP:
do_dump();
break;
12 years
dlm: master - dlm_controld: log useful fence info
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 3d7b2195b78fa5c70e94024c777e1c178abd0282
Parent: d8d82c5f026b306dad35c50a1b038105c19c3324
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Mar 30 15:27:40 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Mar 30 15:27:40 2012 -0500
dlm_controld: log useful fence info
log each fence request and corresponding result,
and final fence status when received.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/daemon_cpg.c | 38 ++++++++++++++++++++++++--------------
dlm_controld/dlm_daemon.h | 2 +-
dlm_controld/fence.c | 34 ++++++++++++++++++++--------------
3 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index dc9e780..0339b5d 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -190,6 +190,8 @@ void log_ringid(const char *name,
const char *reason_str(int reason)
{
switch (reason) {
+ case REASON_STARTUP_FENCING:
+ return "startup";
case CPG_REASON_JOIN:
return "join";
case CPG_REASON_LEAVE:
@@ -868,11 +870,15 @@ static void daemon_fence_work(void)
continue;
}
- log_debug("fence request %d", node->nodeid);
+ log_debug("fence request %d pos %d",
+ node->nodeid, node->fence_config.pos);
rv = fence_request(node->nodeid,
- node->fail_walltime, node->fail_monotime,
- &node->fence_config, &pid);
+ node->fail_walltime,
+ node->fail_monotime,
+ &node->fence_config,
+ node->left_reason,
+ &pid);
if (rv < 0) {
/* FIXME: keep ourself from retrying between here
* and receiving this message */
@@ -1189,6 +1195,7 @@ static void receive_fence_result(struct dlm_header *hd, int len)
{
struct fence_result *fr;
struct node_daemon *node;
+ uint64_t now;
int count;
fr = (struct fence_result *)((char *)hd + sizeof(struct dlm_header));
@@ -1206,33 +1213,36 @@ static void receive_fence_result(struct dlm_header *hd, int len)
count = clear_startup_node(fr->nodeid, 0);
if (count) {
- log_debug("receive_fence_result from %d for %d clear startup",
- hd->nodeid, fr->nodeid);
+ log_debug("receive_fence_result %d from %d clear startup",
+ fr->nodeid, hd->nodeid);
}
node = get_node_daemon(fr->nodeid);
if (!node) {
- log_error("receive_fence_result from %d for %d no daemon node",
- hd->nodeid, fr->nodeid);
+ log_error("receive_fence_result %d from %d result %d no daemon node",
+ fr->nodeid, hd->nodeid, fr->result);
return;
}
- log_debug("receive_fence_result from %d for %d result %d walltime %llu",
- hd->nodeid, fr->nodeid, fr->result,
- (unsigned long long)fr->fence_walltime);
-
if (!node->need_fencing) {
/* should never happen */
- log_error("receive_fence_result from %d for %d result %d no need_fencing",
- hd->nodeid, fr->nodeid, fr->result);
+ log_error("receive_fence_result %d from %d result %d no need_fencing",
+ fr->nodeid, hd->nodeid, fr->result);
return;
}
+ now = monotime();
+
+ log_error("fence status %d receive %d from %d walltime %llu local %llu",
+ fr->nodeid, fr->result, hd->nodeid,
+ (unsigned long long)fr->fence_walltime,
+ (unsigned long long)now);
+
if (!fr->result || (fr->result == -ECANCELED)) {
node->need_fencing = 0;
node->delay_fencing = 0;
node->fence_walltime = fr->fence_walltime;
- node->fence_monotime = monotime();
+ node->fence_monotime = now;
node->fence_actor_done = hd->nodeid;
} else {
/* causes the next lowest nodeid to request fencing */
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 6adb16b..f0ce9b4 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -400,7 +400,7 @@ int setup_node_config(void);
/* fence.c */
int fence_request(int nodeid, uint64_t fail_walltime, uint64_t fail_monotime,
- struct fence_config *fc, int *pid_out);
+ struct fence_config *fc, int reason, int *pid_out);
int fence_result(int nodeid, int pid, int *result);
/* netlink.c */
diff --git a/dlm_controld/fence.c b/dlm_controld/fence.c
index 6d01be9..9807d66 100644
--- a/dlm_controld/fence.c
+++ b/dlm_controld/fence.c
@@ -78,7 +78,7 @@ static int run_agent(char *agent, char *args, int *pid_out)
}
int fence_request(int nodeid, uint64_t fail_walltime, uint64_t fail_monotime,
- struct fence_config *fc, int *pid_out)
+ struct fence_config *fc, int reason, int *pid_out)
{
struct fence_device *dev;
char args[FENCE_CONFIG_ARGS_MAX];
@@ -91,24 +91,28 @@ int fence_request(int nodeid, uint64_t fail_walltime, uint64_t fail_monotime,
snprintf(extra, sizeof(extra)-1, "fail_time=%llu\n", (unsigned long long)fail_walltime);
dev = fc->dev[fc->pos];
- if (!dev)
+ if (!dev) {
+ log_error("fence request %d no config pos %d", nodeid, fc->pos);
return -1;
+ }
rv = fence_config_agent_args(fc, extra, args);
if (rv < 0) {
- log_error("fence_request %d args error %d", nodeid, rv);
+ log_error("fence request %d args error %d", nodeid, rv);
return rv;
}
rv = run_agent(dev->agent, args, &pid);
if (rv < 0) {
- log_error("fence_request %d pos %d name %s agent %s pid %d run error %d",
- nodeid, fc->pos, dev->name, dev->agent, pid, rv);
+ log_error("fence request %d pid %d %s time %llu %s %s run error %d",
+ nodeid, pid, reason_str(reason), (unsigned long long)fail_walltime,
+ dev->name, dev->agent, rv);
return rv;
}
- log_debug("fence_request %d pos %d name %s agent %s pid %d running",
- nodeid, fc->pos, dev->name, dev->agent, pid);
+ log_error("fence request %d pid %d %s time %llu %s %s",
+ nodeid, pid, reason_str(reason), (unsigned long long)fail_walltime,
+ dev->name, dev->agent);
*pid_out = pid;
return 0;
@@ -133,7 +137,7 @@ int fence_result(int nodeid, int pid, int *result)
if (rv < 0) {
/* shouldn't happen */
- log_error("waitpid %d nodeid %d error rv %d errno %d",
+ log_error("fence result %d pid %d waitpid %d errno %d",
pid, nodeid, rv, errno);
return rv;
}
@@ -149,15 +153,17 @@ int fence_result(int nodeid, int pid, int *result)
if (WIFEXITED(status)) {
/* pid exited with an exit code */
*result = WEXITSTATUS(status);
- log_error("waitpid %d nodeid %d exit status %d",
- pid, nodeid, *result);
+
+ log_error("fence result %d pid %d result %d exit status",
+ nodeid, pid, *result);
return 0;
}
if (WIFSIGNALED(status)) {
- /* pid exited due to a signal */
+ /* pid terminated due to a signal */
*result = -1;
- log_error("waitpid %d nodeid %d term signal %d",
- pid, nodeid, WTERMSIG(status));
+
+ log_error("fence result %d pid %d result %d term signal %d",
+ nodeid, pid, *result, WTERMSIG(status));
return 0;
}
@@ -166,7 +172,7 @@ int fence_result(int nodeid, int pid, int *result)
}
/* shouldn't happen */
- log_error("waitpid %d nodeid %d error rv %d", pid, nodeid, rv);
+ log_error("fence result %d pid %d waitpid rv %d", nodeid, pid, rv);
return -1;
}
12 years
cluster: RHEL6 - config: update relax ng schema to include totem miss_count_const
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 662f23bf7316e892de7922b7cec37e0407dab738
Parent: 5dd1e9351f56ddd88dcd40aabbe3289ff4a18701
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Mar 30 09:40:02 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Mar 30 10:22:42 2012 +0200
config: update relax ng schema to include totem miss_count_const
Resolves: rhbz#804938
Reviewed-by: Christine Caulfield <ccaulfie(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
config/tools/xml/cluster.rng.in.head | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/cluster.rng.in.head b/config/tools/xml/cluster.rng.in.head
index a669c98..1bdb836 100644
--- a/config/tools/xml/cluster.rng.in.head
+++ b/config/tools/xml/cluster.rng.in.head
@@ -255,6 +255,15 @@ To validate your cluster.conf against this schema, run:
calculated from retransmits_before_loss and token." rha:default="4"
rha:sample="5"/>
</optional>
+ <optional>
+ <attribute name="miss_count_const"
+ rha:description="This constant defines the maximum number of times
+ on receipt of a token a message is checked for retransmission before
+ retransmission occurs. This parameter is useful to modify for switches
+ that delay multicast packets compared to unicast packets.
+ The default setting works well for nearly all modern switches."
+ rha:default="5" rha:sample="10"/>
+ </optional>
<!-- FIXME: The following description was adapted from the man page.
It may be tool long for the schema document. Consider cutting text
after the second sentence and referring the reader to the openais.conf
12 years
cluster: RHEL6 - cman init: fix start sequence error handling
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: ff280bc349cb7ce973aaab1f1a3dd1b289dff711
Parent: 662f23bf7316e892de7922b7cec37e0407dab738
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Mar 30 09:58:36 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Mar 30 10:26:58 2012 +0200
cman init: fix start sequence error handling
Any daemon that fails to start would leave no traces.
the problem with cman init is that we need to handle multiple daemons
and tools. If one in the chain fails, we never reverted to the original
state of the system. This can indeed cause other issues.
Fix the init script to "stop" cman if any error happens during "start.
Resolves: rhbz#806002
Reviewed-by: Christine Caulfield <ccaulfie(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 48fab3c..1268b59 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -19,6 +19,9 @@
# set secure PATH
PATH="/bin:/usr/bin:/sbin:/usr/sbin:@SBINDIR@"
+# save invokation for rollback ops
+thisinvokation="$0"
+
local_chkconfig()
{
case "$1" in
@@ -183,6 +186,9 @@ nok() {
echo -e "$errmsg"
failure
echo
+ if [ "$currentaction" = "start" ]; then
+ $thisinvokation stop
+ fi
exit 1
}
@@ -695,6 +701,7 @@ leave_fence_domain()
start()
{
+ currentaction="start"
breakpoint="$1"
sshd_enabled && service sshd start
12 years
cluster: STABLE32 - cman init: fix start sequence error handling
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 65a0eef71377d2de4ad94e8f20065c4467a441e9
Parent: b1695c02cb48f34f1d937585429ef4fdbbb570c7
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Mar 30 09:58:36 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Mar 30 09:58:36 2012 +0200
cman init: fix start sequence error handling
Any daemon that fails to start would leave no traces.
the problem with cman init is that we need to handle multiple daemons
and tools. If one in the chain fails, we never reverted to the original
state of the system. This can indeed cause other issues.
Fix the init script to "stop" cman if any error happens during "start.
Resolves: rhbz#806002
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index d0c6f70..a39f19f 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -19,6 +19,9 @@
# set secure PATH
PATH="/bin:/usr/bin:/sbin:/usr/sbin:@SBINDIR@"
+# save invokation for rollback ops
+thisinvokation="$0"
+
chkconfig2()
{
case "$1" in
@@ -199,6 +202,9 @@ nok() {
echo -e "$errmsg"
failure
echo
+ if [ "$currentaction" = "start" ]; then
+ $thisinvokation stop
+ fi
exit 1
}
@@ -744,6 +750,7 @@ leave_fence_domain()
start()
{
+ currentaction="start"
breakpoint="$1"
sshd_enabled && cd @INITDDIR@ && ./sshd start
12 years
cluster: STABLE32 - config: update relax ng schema to include totem miss_count_const
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: b1695c02cb48f34f1d937585429ef4fdbbb570c7
Parent: 6815deffc9f90106f21d049bd694a6592d935597
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Mar 30 09:40:02 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Mar 30 09:40:02 2012 +0200
config: update relax ng schema to include totem miss_count_const
Resolves: rhbz#804938
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
config/tools/xml/cluster.rng.in.head | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/cluster.rng.in.head b/config/tools/xml/cluster.rng.in.head
index c2fed3e..4e3d901 100644
--- a/config/tools/xml/cluster.rng.in.head
+++ b/config/tools/xml/cluster.rng.in.head
@@ -255,6 +255,15 @@ To validate your cluster.conf against this schema, run:
calculated from retransmits_before_loss and token." rha:default="4"
rha:sample="5"/>
</optional>
+ <optional>
+ <attribute name="miss_count_const"
+ rha:description="This constant defines the maximum number of times
+ on receipt of a token a message is checked for retransmission before
+ retransmission occurs. This parameter is useful to modify for switches
+ that delay multicast packets compared to unicast packets.
+ The default setting works well for nearly all modern switches."
+ rha:default="5" rha:sample="10"/>
+ </optional>
<!-- FIXME: The following description was adapted from the man page.
It may be tool long for the schema document. Consider cutting text
after the second sentence and referring the reader to the openais.conf
12 years
dlm: master - dlm_controld: concurrent fence pids option
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: a2a97c61ed6bb1b0aa82954f1f29c6e317de50ad
Parent: ee6f0991586138d9470944e16e54c32dec3c72df
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Mar 28 14:26:23 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Mar 29 13:57:11 2012 -0500
dlm_controld: concurrent fence pids option
Serialize agent pids by default in case they would
disrupt each other, e.g. log into same switch.
Handle cleaning up multiple zombie agent pids.
Fix collection of pid result after killing it.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/config.c | 3 +
dlm_controld/daemon_cpg.c | 194 +++++++++++++++++++++++++++++----------------
dlm_controld/dlm_daemon.h | 3 +
dlm_controld/fence.c | 55 +++++++++----
4 files changed, 167 insertions(+), 88 deletions(-)
diff --git a/dlm_controld/config.c b/dlm_controld/config.c
index 1066fbe..040784b 100644
--- a/dlm_controld/config.c
+++ b/dlm_controld/config.c
@@ -98,6 +98,9 @@ void setup_config(int update)
else if (!optd_enable_startup_fencing && !strncmp(line, "enable_startup_fencing", strlen("enable_startup_fencing")) && !update)
set_val(line, &cfgd_enable_startup_fencing);
+ else if (!optd_enable_concurrent_fencing && !strncmp(line, "enable_concurrent_fencing", strlen("enable_concurrent_fencing")) && !update)
+ set_val(line, &cfgd_enable_concurrent_fencing);
+
else if (!optd_enable_quorum_fencing && !strncmp(line, "enable_quorum_fencing", strlen("enable_quorum_fencing")) && !update)
set_val(line, &cfgd_enable_quorum_fencing);
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index 89788cd..3b7e140 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -77,7 +77,6 @@ struct node_daemon {
int fence_actors[MAX_NODES];
uint64_t fail_walltime;
uint64_t fail_monotime;
- uint64_t fence_request_time;
uint64_t fence_walltime;
uint64_t fence_monotime;
};
@@ -97,14 +96,17 @@ static int daemon_joined_count;
static int daemon_remove_count;
static int daemon_ringid_wait;
static struct cpg_ring_id daemon_ringid;
-static int daemon_clear_nodeid;
-static int daemon_clear_pid;
+static int daemon_fence_pid;
static uint64_t daemon_last_join_monotime;
static uint32_t last_join_seq;
static uint32_t send_fipu_seq;
static int wait_clear_fipu;
static int fence_in_progress_unknown = 1;
+#define MAX_ZOMBIES 16
+static int zombie_pids[MAX_ZOMBIES];
+static int zombie_count;
+
static void send_fence_result(int nodeid, int result, uint32_t flags, uint64_t walltime);
static void send_fence_clear(int nodeid, int result, uint32_t flags, uint64_t walltime);
@@ -575,12 +577,44 @@ static void clear_fence_actor(int nodeid, int actor)
}
}
-/* TODO: handle delayed cleanup of more than one pid */
+static void clear_zombies(void)
+{
+ int i, rv, result = 0;
+
+ for (i = 0; i < MAX_ZOMBIES; i++) {
+ if (!zombie_count)
+ break;
+ if (!zombie_pids[i])
+ continue;
+
+ rv = fence_result(-1, zombie_pids[i], &result);
+ if (rv == -EAGAIN)
+ continue;
+
+ log_debug("cleared zombie %d rv %d result %d",
+ zombie_pids[i], rv, result);
+
+ zombie_pids[i] = 0;
+ zombie_count--;
+ }
+}
+
+static void add_zombie(int pid)
+{
+ int i;
+
+ for (i = 0; i < MAX_ZOMBIES; i++) {
+ if (!zombie_pids[i]) {
+ zombie_pids[i] = pid;
+ zombie_count++;
+ return;
+ }
+ }
+}
static void fence_pid_cancel(int nodeid, int pid)
{
- struct node_daemon *node;
- int rv, result;
+ int rv, result = 0;
log_debug("fence_pid_cancel nodeid %d pid %d", nodeid, pid);
@@ -588,23 +622,11 @@ static void fence_pid_cancel(int nodeid, int pid)
usleep(500000);
rv = fence_result(nodeid, pid, &result);
- if (rv == -EAGAIN) {
- /* Try again later */
- daemon_clear_nodeid = nodeid;
- daemon_clear_pid = pid;
- } else {
- log_debug("fence_pid_cancel nodeid %d pid %d done %d",
- nodeid, pid, result);
-
- daemon_clear_nodeid = 0;
- daemon_clear_pid = 0;
+ if (rv == -EAGAIN)
+ add_zombie(pid);
- node = get_node_daemon(nodeid);
- if (node && node->fence_pid == pid) {
- node->fence_pid_wait = 0;
- node->fence_pid = 0;
- }
- }
+ log_debug("fence_pid_cancel nodeid %d pid %d rv %d result %d",
+ nodeid, pid, rv, result);
}
/*
@@ -723,6 +745,7 @@ static void daemon_fence_work(void)
/* wait for quorum before doing any fencing, but if there
is none, send_fence_clear below can unblock new nodes */
log_debug("fence work wait for quorum");
+ poll_fencing++;
goto out_fipu;
}
@@ -732,7 +755,7 @@ static void daemon_fence_work(void)
list_for_each_entry_safe(node, safe, &startup_nodes, list) {
if (is_clean_daemon_member(node->nodeid)) {
- log_debug("fence startup %d member skip", node->nodeid);
+ log_debug("fence startup %d skip member", node->nodeid);
list_del(&node->list);
free(node);
continue;
@@ -767,13 +790,16 @@ static void daemon_fence_work(void)
continue;
}
node->need_fencing = 1;
+ node->delay_fencing = 0;
+ node->fence_monotime = 0;
+ node->fence_walltime = 0;
+ node->fence_actor_done = 0;
+ node->fence_pid_wait = 0;
+ node->fence_pid = 0;
node->fence_config.pos = 0;
node->left_reason = REASON_STARTUP_FENCING;
node->fail_monotime = cluster_joined_monotime - 1;
node->fail_walltime = cluster_joined_walltime - 1;
- node->fence_monotime = 0;
- node->fence_walltime = 0;
- node->fence_request_time = 0;
low = set_fence_actors(node, 1);
log_debug("fence startup nodeid %d act %d", node->nodeid, low);
@@ -791,23 +817,27 @@ static void daemon_fence_work(void)
continue;
if (is_clean_daemon_member(node->nodeid)) {
- /* node rejoined cleanly, doesn't need fencing */
- log_debug("fence request %d member skip", node->nodeid);
+ /*
+ * node has rejoined in clean state
+ */
+ log_debug("fence request %d skip member", node->nodeid);
+
node->need_fencing = 0;
+ node->delay_fencing = 0;
node->fence_walltime = time(NULL);
node->fence_monotime = monotime();
+ node->fence_actor_done = node->nodeid;
continue;
}
- /*
- if (daemon_pid_wait) {
+ if (!cfgd_enable_concurrent_fencing && daemon_fence_pid) {
+ /* run one agent at a time in case they need the same switch */
log_debug("fence request %d delay for other pid %d",
- node->nodeid, daemon_pid_wait);
+ node->nodeid, daemon_fence_pid);
node->delay_fencing = 1;
poll_fencing++;
continue;
}
- */
if (monotime() - cluster_last_join_monotime < cfgd_post_join_delay) {
log_debug("fence request %d delay %d from %llu",
@@ -843,13 +873,15 @@ static void daemon_fence_work(void)
node->fail_walltime, node->fail_monotime,
&node->fence_config, &pid);
if (rv < 0) {
+ /* FIXME: keep ourself from retrying between here
+ * and receiving this message */
send_fence_result(node->nodeid, rv, 0, time(NULL));
continue;
}
node->fence_pid_wait = 1;
node->fence_pid = pid;
- node->fence_request_time = monotime();
+ daemon_fence_pid = pid;
}
/*
@@ -866,71 +898,81 @@ static void daemon_fence_work(void)
if (!node->fence_pid_wait) {
/*
* another node is the actor, or we were actor,
- * sent done msg and are waiting to recv it
+ * and are between our own send_fence_result()
+ * and receive_fence_result()
*/
log_debug("fence wait %d for done", node->nodeid);
continue;
}
- if (is_clean_daemon_member(node->nodeid)) {
+ if (!node->fence_pid) {
+ /* shouldn't happen */
+ log_error("fence wait %d zero pid", node->nodeid);
+ node->fence_pid_wait = 0;
+ continue;
+ }
+
+ nodeid = node->nodeid;
+ pid = node->fence_pid;
+
+ if (is_clean_daemon_member(nodeid)) {
/*
* node has rejoined in clean state so we can
* abort outstanding fence op for it. all nodes
* will see and do this, so we don't need to send
* a fence result.
*/
- log_debug("fence wait %d member skip", node->nodeid);
+ log_debug("fence wait %d pid %d skip member", nodeid, pid);
+
node->need_fencing = 0;
+ node->delay_fencing = 0;
node->fence_walltime = time(NULL);
node->fence_monotime = monotime();
- fence_pid_cancel(node->nodeid, node->fence_pid);
+ node->fence_actor_done = nodeid;
+
+ node->fence_pid_wait = 0;
+ node->fence_pid = 0;
+ daemon_fence_pid = 0;
+
+ fence_pid_cancel(nodeid, pid);
continue;
}
poll_fencing++;
- rv = fence_result(node->nodeid, node->fence_pid, &result);
+ rv = fence_result(nodeid, pid, &result);
if (rv == -EAGAIN) {
/* agent pid is still running */
- log_debug("fence wait %d pid %d running",
- node->nodeid, node->fence_pid);
+ log_debug("fence wait %d pid %d running", nodeid, pid);
continue;
}
+ node->fence_pid_wait = 0;
+ node->fence_pid = 0;
+ daemon_fence_pid = 0;
+
if (rv < 0) {
/* shouldn't happen */
- log_error("fence wait %d pid %d error %d",
- node->nodeid, node->fence_pid, rv);
- node->fence_pid_wait = 0;
+ log_error("fence wait %d pid %d error %d", nodeid, pid, rv);
continue;
}
+ log_debug("fence wait %d pid %d result %d", nodeid, pid, result);
+
if (!result) {
/* agent exit 0, if there's another agent to run in
parallel, set it to run next, otherwise success */
- log_debug("fence nodeid %d pid %d succeeded",
- node->nodeid, node->fence_pid);
-
- node->fence_pid_wait = 0;
- node->fence_pid = 0;
-
rv = fence_config_next_parallel(&node->fence_config);
if (rv < 0)
- send_fence_result(node->nodeid, 0, 0, time(NULL));
+ send_fence_result(nodeid, 0, 0, time(NULL));
} else {
/* agent exit 1, if there's another agent to run at
next priority, set it to run next, otherwise fail */
- log_debug("fence nodeid %d pid %d failed %d",
- node->nodeid, node->fence_pid, result);
-
- node->fence_pid_wait = 0;
- node->fence_pid = 0;
-
rv = fence_config_next_priority(&node->fence_config);
if (rv < 0)
- send_fence_result(node->nodeid, result, 0, time(NULL));
+ send_fence_result(nodeid, result, 0, time(NULL));
}
}
@@ -1026,8 +1068,8 @@ static void daemon_fence_work(void)
* clean up a zombie pid from an agent we killed
*/
- if (daemon_clear_pid)
- fence_pid_cancel(daemon_clear_nodeid, daemon_clear_pid);
+ if (zombie_count)
+ clear_zombies();
}
void process_fencing_changes(void)
@@ -1185,21 +1227,24 @@ static void receive_fence_result(struct dlm_header *hd, int len)
return;
}
- if (fr->result == -ECANCELED) {
- /* if an agent pid is running, kill it and clean up */
- if (node->fence_pid_wait && node->fence_pid)
- fence_pid_cancel(node->nodeid, node->fence_pid);
- fr->result = 0; /* force success below */
- }
-
- if (!fr->result) {
+ if (!fr->result || (fr->result == -ECANCELED)) {
node->need_fencing = 0;
+ node->delay_fencing = 0;
node->fence_walltime = fr->fence_walltime;
node->fence_monotime = monotime();
node->fence_actor_done = hd->nodeid;
} else {
+ /* causes the next lowest nodeid to request fencing */
clear_fence_actor(fr->nodeid, hd->nodeid);
}
+
+ if ((fr->result == -ECANCELED) && node->fence_pid_wait && node->fence_pid) {
+ fence_pid_cancel(node->nodeid, node->fence_pid);
+
+ node->fence_pid_wait = 0;
+ node->fence_pid = 0;
+ daemon_fence_pid = 0;
+ }
}
static void send_fence_result(int nodeid, int result, uint32_t flags, uint64_t walltime)
@@ -1810,14 +1855,23 @@ static void confchg_cb_daemon(cpg_handle_t handle,
}
if (reason == CPG_REASON_NODEDOWN || reason == CPG_REASON_PROCDOWN) {
+ if (node->fence_pid_wait || node->fence_pid) {
+ /* sanity check, should never happen */
+ log_error("daemon remove nodeid %d pid_wait %d pid %d",
+ node->nodeid, node->fence_pid_wait, node->fence_pid);
+ }
+
node->need_fencing = 1;
+ node->delay_fencing = 0;
+ node->fence_monotime = 0;
+ node->fence_walltime = 0;
+ node->fence_actor_done = 0;
+ node->fence_pid_wait = 0;
+ node->fence_pid = 0;
node->fence_config.pos = 0;
node->left_reason = reason;
node->fail_monotime = now;
node->fail_walltime = now_wall;
- node->fence_monotime = 0;
- node->fence_walltime = 0;
- node->fence_request_time = 0;
low = set_fence_actors(node, 0);
}
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index da53627..66e008e 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -84,6 +84,7 @@
#define DEFAULT_POST_JOIN_DELAY 30
#define DEFAULT_ENABLE_FENCING 1
#define DEFAULT_ENABLE_STARTUP_FENCING 1
+#define DEFAULT_ENABLE_CONCURRENT_FENCING 0
#define DEFAULT_ENABLE_QUORUM_FENCING 1
#define DEFAULT_ENABLE_QUORUM_LOCKSPACE 0
#define DEFAULT_ENABLE_FSCONTROL 0
@@ -152,6 +153,7 @@ EXTERN int optd_debug_logfile;
EXTERN int optd_post_join_delay;
EXTERN int optd_enable_fencing;
EXTERN int optd_enable_startup_fencing;
+EXTERN int optd_enable_concurrent_fencing;
EXTERN int optd_enable_quorum_fencing;
EXTERN int optd_enable_quorum_lockspace;
EXTERN int optd_enable_fscontrol;
@@ -171,6 +173,7 @@ EXTERN int cfgd_debug_logfile;
EXTERN int cfgd_post_join_delay;
EXTERN int cfgd_enable_fencing;
EXTERN int cfgd_enable_startup_fencing;
+EXTERN int cfgd_enable_concurrent_fencing;
EXTERN int cfgd_enable_quorum_fencing;
EXTERN int cfgd_enable_quorum_lockspace;
EXTERN int cfgd_enable_fscontrol;
diff --git a/dlm_controld/fence.c b/dlm_controld/fence.c
index 91c5e67..6d01be9 100644
--- a/dlm_controld/fence.c
+++ b/dlm_controld/fence.c
@@ -102,21 +102,26 @@ int fence_request(int nodeid, uint64_t fail_walltime, uint64_t fail_monotime,
rv = run_agent(dev->agent, args, &pid);
if (rv < 0) {
- log_error("fence_request %d agent %s pid %d run error %d",
- nodeid, dev->agent, pid, rv);
+ log_error("fence_request %d pos %d name %s agent %s pid %d run error %d",
+ nodeid, fc->pos, dev->name, dev->agent, pid, rv);
return rv;
}
- log_debug("fence_request %d pos %d agent %s pid %d running",
- nodeid, fc->pos, dev->agent, pid);
+ log_debug("fence_request %d pos %d name %s agent %s pid %d running",
+ nodeid, fc->pos, dev->name, dev->agent, pid);
*pid_out = pid;
return 0;
}
/*
- * if pid has exited, return 0 with exit code in result
+ * if pid has exited, return 0
+ * result is 0 for success, non-zero for fail
+ * success if pid exited with exit status 0
+ * fail if pid exited with non-zero exit status, or was terminated by signal
+ *
* if pid is running, return -EAGAIN
+ *
* other error, return -EXXX
*/
@@ -128,26 +133,40 @@ int fence_result(int nodeid, int pid, int *result)
if (rv < 0) {
/* shouldn't happen */
- log_error("agent pid %d nodeid %d errno %d",
- pid, nodeid, errno);
+ log_error("waitpid %d nodeid %d error rv %d errno %d",
+ pid, nodeid, rv, errno);
return rv;
+ }
- } else if (!rv) {
- /* pid still running */
+ if (!rv) {
+ /* pid still running, has not changed state */
return -EAGAIN;
+ }
- } else if (WIFEXITED(status)) {
- /* pid exited */
-
- *result = WEXITSTATUS(status);
-
- log_error("agent pid %d nodeid %d result %d",
- pid, nodeid, *result);
- return 0;
+ if (rv == pid) {
+ /* pid state has changed */
+
+ if (WIFEXITED(status)) {
+ /* pid exited with an exit code */
+ *result = WEXITSTATUS(status);
+ log_error("waitpid %d nodeid %d exit status %d",
+ pid, nodeid, *result);
+ return 0;
+ }
+ if (WIFSIGNALED(status)) {
+ /* pid exited due to a signal */
+ *result = -1;
+ log_error("waitpid %d nodeid %d term signal %d",
+ pid, nodeid, WTERMSIG(status));
+ return 0;
+ }
- } else {
/* pid state changed but still running */
return -EAGAIN;
}
+
+ /* shouldn't happen */
+ log_error("waitpid %d nodeid %d error rv %d", pid, nodeid, rv);
+ return -1;
}
12 years
fence-agents: annotated tag v3.1.8 has been created
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 62c370362243e989e34ce43d67dab82b44cb48bd
Parent: 0000000000000000000000000000000000000000
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: 2012-03-29 11:25 +0000
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: 2012-03-29 11:25 +0000
annotated tag: v3.1.8 has been created
at 62c370362243e989e34ce43d67dab82b44cb48bd (tag)
tagging d26471873aafd5db53d71faccc7ca2ac18e8cff3 (commit)
replaces v3.1.7
v3.1.8 release
Marek 'marx' Grac (10):
fence_ipmilan: Possible buffer overflow
fence_vmware_soap: Support for 100+ VM in VMWare
fencing: Missing password is not reported properly
fence_rhevm: Incorrect status detected when VM is not in up/down
fence_ipmilan: power_wait timeout is not used for power off operation
fence agents: Using "delay" option can ends with timeout problems
fence agents: Attribute unique should be set to 0 (false) by default
fence_ipmilan: return code can be invalid when using -M cycle
fence_ipmilan: Using "delay" option
fence_ipmilan: Fix typo
Ryan O'Hara (1):
fence_scsi: remove unlink of fence_scsi.dev file
12 years
dlm: master - dlm_controld: fix startup fence case
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: ee6f0991586138d9470944e16e54c32dec3c72df
Parent: 9d26aa2f383cfc1864d6cfc7f7d6cf01b3ab17ee
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 27 16:41:22 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 27 16:41:22 2012 -0500
dlm_controld: fix startup fence case
Clearing nodes from startup fencing due to a
fence_clear message, inadvertently caused the
node to clear fence_in_progress_unknown itself
by thinking it had completed all startup fencing.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/daemon_cpg.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index d1f0e19..89788cd 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -102,6 +102,7 @@ static int daemon_clear_pid;
static uint64_t daemon_last_join_monotime;
static uint32_t last_join_seq;
static uint32_t send_fipu_seq;
+static int wait_clear_fipu;
static int fence_in_progress_unknown = 1;
static void send_fence_result(int nodeid, int result, uint32_t flags, uint64_t walltime);
@@ -937,9 +938,11 @@ static void daemon_fence_work(void)
* clear fence_in_progress_unknown
*/
out_fipu:
- need = nodes_need_fencing();
-
- if (cfgd_enable_startup_fencing && fence_in_progress_unknown && !need && list_empty(&startup_nodes)) {
+ if (cfgd_enable_startup_fencing &&
+ fence_in_progress_unknown &&
+ list_empty(&startup_nodes) &&
+ !wait_clear_fipu &&
+ !nodes_need_fencing()) {
/*
* case A in comment above
* all nodes are starting and have fipu set, they all do
@@ -958,8 +961,11 @@ static void daemon_fence_work(void)
* once all fencing is done so they clear fipu.
*/
low = 0;
+ need = 0;
list_for_each_entry(node, &daemon_nodes, list) {
+ if (node->need_fencing)
+ need++;
if (!node->daemon_member || node->need_fence_clear)
continue;
if (!low || node->nodeid < low)
@@ -1079,16 +1085,22 @@ static void receive_fence_clear(struct dlm_header *hd, int len)
* may come in separate messages if there is a pending fencing op
* when the new member joins (CLEAR_STARTUP will come right away,
* but CLEAR_FIPU will come once the fencing op is done.)
+ *
+ * We need wait_clear_fipu after emptying startup_nodes to avoid
+ * thinking we've finished startup fencing in case A below, and
+ * clearing fipu ourselves.
*/
if (!fr->result && (node->nodeid == our_nodeid)) {
if ((fr->flags & FR_CLEAR_STARTUP) && !list_empty(&startup_nodes)) {
count = clear_startup_node(0, 1);
log_debug("clear_startup_nodes %d", count);
+ wait_clear_fipu = 1;
}
if ((fr->flags & FR_CLEAR_FIPU) && fence_in_progress_unknown) {
fence_in_progress_unknown = 0;
log_debug("fence_in_progress_unknown 0 recv");
+ wait_clear_fipu = 0;
}
}
12 years, 1 month
dlm: master - dlm_controld: limit repeating log messages
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9d26aa2f383cfc1864d6cfc7f7d6cf01b3ab17ee
Parent: e3a0d33dddf556dc698f31ff6ae0ce2fa66afbd3
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 27 15:19:14 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 27 15:19:14 2012 -0500
dlm_controld: limit repeating log messages
avoid filling the log buffer with the same
info during log waits
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/cpg.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c
index b2f6e3b..83e9b17 100644
--- a/dlm_controld/cpg.c
+++ b/dlm_controld/cpg.c
@@ -8,6 +8,14 @@
#include "dlm_daemon.h"
+#define log_limit(ls, fmt, args...) ({ \
+ static uint32_t __change_nr; \
+ if (ls->change_seq > __change_nr) { \
+ __change_nr = ls->change_seq; \
+ log_group(ls, fmt, ##args); \
+ } \
+})
+
/* per lockspace cpg: ls->node_history */
struct node {
@@ -374,10 +382,11 @@ static int check_ringid_done(struct lockspace *ls)
return 0;
}
- log_group(ls, "check_ringid done cluster %u cpg %u:%llu",
+ log_limit(ls, "check_ringid done cluster %u cpg %u:%llu",
cluster_ringid_seq, ls->cpg_ringid.nodeid,
(unsigned long long)ls->cpg_ringid.seq);
- return 1;
+
+ return 1;
}
static int check_fencing_done(struct lockspace *ls)
@@ -426,7 +435,7 @@ static int check_fencing_done(struct lockspace *ls)
}
if (wait_count) {
- log_group(ls, "check_fencing wait_count %d", wait_count);
+ log_limit(ls, "check_fencing wait_count %d", wait_count);
return 0;
}
@@ -441,7 +450,7 @@ static int check_fencing_done(struct lockspace *ls)
}
if (in_progress) {
- log_group(ls, "check_fencing in progress %d", in_progress);
+ log_limit(ls, "check_fencing in progress %d", in_progress);
return 0;
}
12 years, 1 month