cluster: STABLE32 - cman init: allow sysconfig/cman to pass options to dlm_controld
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 10ebf6e26eff7fd21ac245cac9876ef62ae049ca
Parent: 199101a3d89bc14ff99394f69cd0861b37b862b3
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue May 15 13:53:28 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 15 13:53:28 2012 +0200
cman init: allow sysconfig/cman to pass options to dlm_controld
DLM_CONTROLD_OPTS="" can now be used to pass startup options to the
daemon.
Resolves: rhbz#821016
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 5 ++++-
cman/init.d/cman.init.defaults.in | 3 +++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index a39f19f..dddfe6e 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -116,6 +116,9 @@ fi
# empty or any other value (default) | cman init will start the daemons
#CMAN_DAEMONS_START=
+# DLM_CONTROLD_OPTS -- allow extra options to be passed to dlm_controld daemon.
+[ -z "$DLM_CONTROLD_OPTS" ] && DLM_CONTROLD_OPTS=""
+
# FENCE_JOIN_TIMEOUT -- seconds to wait for fence domain join to
# complete. If the join hasn't completed in this time, fence_tool join
# exits with an error, and this script exits with an error. To wait
@@ -674,7 +677,7 @@ stop_fenced()
start_dlm_controld()
{
- start_daemon dlm_controld || return 1
+ start_daemon dlm_controld "$DLM_CONTROLD_OPTS" || return 1
if [ "$INITLOGLEVEL" = "full" ]; then
ok
diff --git a/cman/init.d/cman.init.defaults.in b/cman/init.d/cman.init.defaults.in
index 04b3b5b..adde8d9 100644
--- a/cman/init.d/cman.init.defaults.in
+++ b/cman/init.d/cman.init.defaults.in
@@ -39,6 +39,9 @@
# empty or any other value (default) | cman init will start the daemons
#CMAN_DAEMONS_START=
+# DLM_CONTROLD_OPTS -- allow extra options to be passed to dlm_controld daemon.
+#DLM_CONTROLD_OPTS=""
+
# FENCE_JOIN_TIMEOUT -- seconds to wait for fence domain join to
# complete. If the join hasn't completed in this time, fence_tool join
# exits with an error, and this script exits with an error. To wait
11 years, 11 months
dlm: tag dlm-3.99.3 has been created
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 213749ea11fd9ed2fabb998d710d83cc69aebf8b
Parent: 4fb9b3c95de063b1797293c97cab1925b34e40e2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon May 14 13:56:20 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon May 14 13:56:20 2012 -0500
release 3.99.3
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
include/version.cf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/version.cf b/include/version.cf
index 17c2c7b..41cd547 100644
--- a/include/version.cf
+++ b/include/version.cf
@@ -1,6 +1,6 @@
#ifndef _RELEASE_VERSION_CF_
#define _RELEASE_VERSION_CF_
-#define RELEASE_VERSION "3.99.2"
+#define RELEASE_VERSION "3.99.3"
#endif
11 years, 11 months
dlm: master - release 3.99.3
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 213749ea11fd9ed2fabb998d710d83cc69aebf8b
Parent: 4fb9b3c95de063b1797293c97cab1925b34e40e2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon May 14 13:56:20 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon May 14 13:56:20 2012 -0500
release 3.99.3
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
include/version.cf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/version.cf b/include/version.cf
index 17c2c7b..41cd547 100644
--- a/include/version.cf
+++ b/include/version.cf
@@ -1,6 +1,6 @@
#ifndef _RELEASE_VERSION_CF_
#define _RELEASE_VERSION_CF_
-#define RELEASE_VERSION "3.99.2"
+#define RELEASE_VERSION "3.99.3"
#endif
11 years, 11 months
dlm: master - dlm_tool: new master format
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4fb9b3c95de063b1797293c97cab1925b34e40e2
Parent: 6e92dab912882158b19c16971328dda3e0387e1d
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon May 14 13:50:58 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon May 14 13:54:52 2012 -0500
dlm_tool: new master format
Change the way master nodeid's are displayed from:
"Master" (on master nodeid N)
"Local N" (on other nodes)
to:
"Master" (on master nodeid N)
"Master:N" (on other nodes)
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_tool/main.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlm_tool/main.c b/dlm_tool/main.c
index a512f9c..bcaf8e4 100644
--- a/dlm_tool/main.c
+++ b/dlm_tool/main.c
@@ -474,7 +474,7 @@ static char *pr_master(int nodeid)
memset(buf, 0, sizeof(buf));
if (nodeid > 0)
- sprintf(buf, "Local %d", nodeid);
+ sprintf(buf, "Master:%d", nodeid);
else if (!nodeid)
sprintf(buf, "Master");
else if (nodeid == -1)
@@ -779,18 +779,25 @@ static void print_rsb_toss(char *line)
else
goto fail;
- printf("Dir %d master %d our %d ",
- dir_nodeid, master_nodeid, our_nodeid);
+ if (master_nodeid != our_nodeid)
+ printf("Master:%d", master_nodeid);
+ else
+ printf("Master");
+
+ if (dir_nodeid != our_nodeid)
+ printf(" Dir:%d", dir_nodeid);
+ else
+ printf(" Dir");
if (master_nodeid == our_nodeid && res_nodeid != 0)
- printf("res %d", res_nodeid);
+ printf(" res_nodeid %d", res_nodeid);
printf("\n");
return;
fail:
- fprintf(stderr, "print_rsb error rv %d line \"%s\"\n", rv, line);
+ fprintf(stderr, "print_rsb_toss error rv %d line \"%s\"\n", rv, line);
}
static void clear_rinfo(struct rinfo *ri)
11 years, 11 months
dlm: master - dlm_controld: fix command line with no options
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 6e92dab912882158b19c16971328dda3e0387e1d
Parent: 81525d747202084fd878f27b51bba10156485467
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon May 14 13:49:37 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon May 14 13:49:37 2012 -0500
dlm_controld: fix command line with no options
Fix copy-paste error in command line arg processing
that required argc > 1.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/main.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index e8c8af3..c002520 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1403,14 +1403,18 @@ struct dlm_option *get_dlm_option(char *name)
static void set_opt_cli(int argc, char **argv)
{
struct dlm_option *o;
- char *arg1 = argv[1];
- char *p, *arg_str;
+ char *arg1, *p, *arg_str;
char bundled_letters[8];
int b, blc = 0, blc_max = 8;
int debug_options = 0;
int i, ind;
- if (argc < 2 || !strcmp(arg1, "help") || !strcmp(arg1, "--help") || !strcmp(arg1, "-h")) {
+ if (argc < 2)
+ return;
+
+ arg1 = argv[1];
+
+ if (!strcmp(arg1, "help") || !strcmp(arg1, "--help") || !strcmp(arg1, "-h")) {
print_usage();
exit(EXIT_SUCCESS);
}
11 years, 11 months
dlm: master - dlm_tool: print lockspace toss debugfs list
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 81525d747202084fd878f27b51bba10156485467
Parent: 995ead49d7aeab6c3e65a55119976ae85a4d3767
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 19 10:46:51 2011 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 4 14:41:09 2012 -0500
dlm_tool: print lockspace toss debugfs list
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_tool/main.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 90 insertions(+), 1 deletions(-)
diff --git a/dlm_tool/main.c b/dlm_tool/main.c
index 36f8bf8..a512f9c 100644
--- a/dlm_tool/main.c
+++ b/dlm_tool/main.c
@@ -119,6 +119,7 @@ struct summary {
unsigned int lkb_local_copy;
unsigned int lkb_process_copy;
unsigned int expect_replies;
+ unsigned int toss_total;
};
static const char *mode_str(int mode)
@@ -735,6 +736,63 @@ static void print_lkb(char *line, struct rinfo *ri)
printf("%s\n", pr_verbose(&lkb));
}
+static void print_rsb_toss(char *line)
+{
+ char type[4], namefmt[4], *p;
+ char addr[64];
+ char toss_time[16];
+ int res_nodeid, master_nodeid, dir_nodeid, our_nodeid;
+ int rv, namelen;
+ uint32_t flags;
+
+ rv = sscanf(line, "%s %s %d %d %d %d %s %u %u %s",
+ type,
+ addr,
+ &res_nodeid,
+ &master_nodeid,
+ &dir_nodeid,
+ &our_nodeid,
+ toss_time,
+ &flags,
+ &namelen,
+ namefmt);
+
+ if (rv != 10)
+ goto fail;
+
+ p = strchr(line, '\n');
+ if (!p)
+ goto fail;
+ *p = '\0';
+
+ p = strstr(line, namefmt);
+ if (!p)
+ goto fail;
+ p += 4;
+
+ strcat(addr, " ");
+
+ if (!strncmp(namefmt, "str", 3))
+ printf("Resource len %2d \"%s\"\n", namelen, p);
+ else if (!strncmp(namefmt, "hex", 3))
+ printf("Resource len %2d hex %s\n", namelen, p);
+ else
+ goto fail;
+
+ printf("Dir %d master %d our %d ",
+ dir_nodeid, master_nodeid, our_nodeid);
+
+ if (master_nodeid == our_nodeid && res_nodeid != 0)
+ printf("res %d", res_nodeid);
+
+ printf("\n");
+
+ return;
+
+ fail:
+ fprintf(stderr, "print_rsb error rv %d line \"%s\"\n", rv, line);
+}
+
static void clear_rinfo(struct rinfo *ri)
{
memset(ri, 0, sizeof(struct rinfo));
@@ -780,13 +838,14 @@ static void count_rinfo(struct summary *s, struct rinfo *ri)
static void print_summary(struct summary *s)
{
printf("rsb\n");
- printf(" total %u\n", s->rsb_total);
+ printf(" active %u\n", s->rsb_total);
printf(" master %u\n", s->rsb_master);
printf(" remote master %u\n", s->rsb_local);
printf(" lookup master %u\n", s->rsb_lookup);
printf(" with lvb %u\n", s->rsb_with_lvb);
printf(" with no locks %u\n", s->rsb_no_locks);
printf(" nodeid error %u\n", s->rsb_nodeid_error);
+ printf(" inactive %u\n", s->toss_total);
printf("\n");
printf("lkb\n");
@@ -860,6 +919,31 @@ static void do_waiters(char *name, struct summary *sum)
fclose(file);
}
+static void do_toss(char *name, struct summary *sum)
+{
+ FILE *file;
+ char path[PATH_MAX];
+ char line[LOCK_LINE_MAX];
+
+ snprintf(path, PATH_MAX, "/sys/kernel/debug/dlm/%s_toss", name);
+
+ file = fopen(path, "r");
+ if (!file)
+ return;
+
+ while (fgets(line, LOCK_LINE_MAX, file)) {
+ if (!strncmp(line, "version", 7))
+ continue;
+
+ if (!strncmp(line, "rsb", 3)) {
+ print_rsb_toss(line);
+ sum->toss_total++;
+ printf("\n");
+ }
+ }
+ fclose(file);
+}
+
static void do_lockdebug(char *name)
{
struct summary summary;
@@ -914,8 +998,13 @@ static void do_lockdebug(char *name)
raw:
printf("%s", line);
}
+ count_rinfo(&summary, &info);
+ clear_rinfo(&info);
+ printf("\n");
fclose(file);
+ do_toss(name, &summary);
+
do_waiters(name, &summary);
if (summarize) {
11 years, 11 months
cluster: RHEL6 - cpglockd: Fix a hang triggered when fencing completes in less than 1s
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e01a564837cc5f5310a046da3c71f995c301e649
Parent: e577c6d731c33b8309f02d7805d5a6fa59da5773
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Mon May 14 10:34:48 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Mon May 14 10:43:53 2012 -0400
cpglockd: Fix a hang triggered when fencing completes in less than 1s
Acked-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/cpglockd.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/daemons/cpglockd.c b/rgmanager/src/daemons/cpglockd.c
index 1a5832c..95cb371 100644
--- a/rgmanager/src/daemons/cpglockd.c
+++ b/rgmanager/src/daemons/cpglockd.c
@@ -1655,9 +1655,9 @@ main(int argc, char **argv)
lft = fn.last_fenced_time;
}
- if (lft > pf_node->fail_time) {
+ if (lft >= pf_node->fail_time) {
logt_print(LOG_DEBUG,
- "Fencing for node %d finished at %ld (>%ld)\n",
+ "Fencing for node %d finished at %ld (lost at %ld)\n",
pf_node->nodeid, lft, pf_node->fail_time);
list_remove(&pending_fencing, pf_node);
free(pf_node);
11 years, 11 months
cluster: STABLE32 - cpglockd: Fix a hang triggered when fencing completes in less than 1s
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 199101a3d89bc14ff99394f69cd0861b37b862b3
Parent: 6329b3688fca66f5821dedb3f98268c06d2ef122
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Mon May 14 10:34:48 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Mon May 14 10:34:48 2012 -0400
cpglockd: Fix a hang triggered when fencing completes in less than 1s
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/cpglockd.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/daemons/cpglockd.c b/rgmanager/src/daemons/cpglockd.c
index 1a5832c..95cb371 100644
--- a/rgmanager/src/daemons/cpglockd.c
+++ b/rgmanager/src/daemons/cpglockd.c
@@ -1655,9 +1655,9 @@ main(int argc, char **argv)
lft = fn.last_fenced_time;
}
- if (lft > pf_node->fail_time) {
+ if (lft >= pf_node->fail_time) {
logt_print(LOG_DEBUG,
- "Fencing for node %d finished at %ld (>%ld)\n",
+ "Fencing for node %d finished at %ld (lost at %ld)\n",
pf_node->nodeid, lft, pf_node->fail_time);
list_remove(&pending_fencing, pf_node);
free(pf_node);
11 years, 11 months
cluster: RHEL62 - cmannotifyd: deliver cluster status at startup and fix daemon init
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 188a980e506b14cfdf94de9129360dd10f5a53d6
Parent: 17bacf59aea4f2d021ba8127f71e9d840703b692
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue May 8 14:22:25 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed May 9 20:30:14 2012 +0200
cmannotifyd: deliver cluster status at startup and fix daemon init
cmannotifyd is very often (if not always) started _after_ cman is
completely settled. That means cmannotifyd does not receive/dispatch
any notifications on the current cluster status at startup.
change cman connection loop to generate a fake notification that
config and membership have changed (we can't poll if they did)
and use those information internally too, to reinit logging with
new cman connection.
Resolves: rhbz#820357
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/notifyd/main.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/cman/notifyd/main.c b/cman/notifyd/main.c
index d5c90c5..a5fe323 100644
--- a/cman/notifyd/main.c
+++ b/cman/notifyd/main.c
@@ -201,6 +201,10 @@ static void init_logging(int reconf)
ccs_read_logging(ccs_handle, "cmannotifyd", &debug, &mode,
&syslog_facility, &syslog_priority, &logfile_priority, logfile);
ccs_disconnect(ccs_handle);
+ } else {
+ if (debug) {
+ logfile_priority = LOG_DEBUG;
+ }
}
if (!daemonize)
@@ -320,6 +324,8 @@ static void byebye_cman(void)
static void setup_cman(int forever)
{
int init = 0, active = 0;
+ int quorate;
+ const char *str = NULL;
retry_init:
cman_handle = cman_init(NULL);
@@ -355,6 +361,14 @@ retry_active:
exit(EXIT_FAILURE);
}
+ logt_print(LOG_DEBUG, "Dispatching first cluster status\n");
+ init_logging(1);
+ str = "CMAN_REASON_CONFIG_UPDATE";
+ dispatch_notification(str, 0);
+ str = "CMAN_REASON_STATECHANGE";
+ quorate = cman_is_quorate(cman_handle);
+ dispatch_notification(str, &quorate);
+
return;
out:
11 years, 12 months
cluster: RHEL6 - cmannotifyd: deliver cluster status at startup and fix daemon init
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e577c6d731c33b8309f02d7805d5a6fa59da5773
Parent: 854cf3464251cdb132b9768cefb849d49ec1d4a9
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue May 8 14:22:25 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 8 15:27:03 2012 +0200
cmannotifyd: deliver cluster status at startup and fix daemon init
cmannotifyd is very often (if not always) started _after_ cman is
completely settled. That means cmannotifyd does not receive/dispatch
any notifications on the current cluster status at startup.
change cman connection loop to generate a fake notification that
config and membership have changed (we can't poll if they did)
and use those information internally too, to reinit logging with
new cman connection.
Resolves: rhbz#819787
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/notifyd/main.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/cman/notifyd/main.c b/cman/notifyd/main.c
index d5c90c5..a5fe323 100644
--- a/cman/notifyd/main.c
+++ b/cman/notifyd/main.c
@@ -201,6 +201,10 @@ static void init_logging(int reconf)
ccs_read_logging(ccs_handle, "cmannotifyd", &debug, &mode,
&syslog_facility, &syslog_priority, &logfile_priority, logfile);
ccs_disconnect(ccs_handle);
+ } else {
+ if (debug) {
+ logfile_priority = LOG_DEBUG;
+ }
}
if (!daemonize)
@@ -320,6 +324,8 @@ static void byebye_cman(void)
static void setup_cman(int forever)
{
int init = 0, active = 0;
+ int quorate;
+ const char *str = NULL;
retry_init:
cman_handle = cman_init(NULL);
@@ -355,6 +361,14 @@ retry_active:
exit(EXIT_FAILURE);
}
+ logt_print(LOG_DEBUG, "Dispatching first cluster status\n");
+ init_logging(1);
+ str = "CMAN_REASON_CONFIG_UPDATE";
+ dispatch_notification(str, 0);
+ str = "CMAN_REASON_STATECHANGE";
+ quorate = cman_is_quorate(cman_handle);
+ dispatch_notification(str, &quorate);
+
return;
out:
11 years, 12 months